Questions tagged [code-coverage]

"Code coverage" (synonym: test coverage) is a measure of the amount of application source code that has been exercised, usually by some testing regime, often by unit testing.

Filter by
Sorted by
Tagged with
0 votes
0 answers
9 views

Automation code coverage when application code is in different repo

Requirement : I want to get the coverage of application code being tested by the automation code. Problem : Automation and application code are in separate repos Tech Stack : WebdriverIO, Typescript. ...
Arushi gupta's user avatar
-1 votes
0 answers
39 views

Merging bins of different coverpoints [closed]

Suppose I have 2 coverpoints as follows: cp1: coverpoint signal_a { bins a1 = {1}; bins a2 = {2}; } cp2: coverpoint signal_b { bins b1 = {1}; bins b2 = {2}; } I want to create a ...
Rutuja14's user avatar
1 vote
1 answer
31 views

Minitest data submission format for datetime

A controller action parses an optional datetime collection select with if params[:individual]["birth_date_ui(1i)"].present? However when testing one cannot format the request as: post ...
Jerome's user avatar
  • 5,737
0 votes
2 answers
89 views

Devops pipeline provide test- and coverage results

Having an Azure devops pipeline I'd like to build my project using docker and to provide code coverage results for the devops dashboard. My problem is that even the test- and coverage results are ...
messerke's user avatar
1 vote
0 answers
112 views

Cannot obtain expected Coverage report by Excluding classes and packages using Jacoco (Gradle) plugin in Android

I'm trying to exclude some classes & packages which are based on HILT generated contents, few modules & all BindingImplementations from the JACOCO report. It does not return the expected ...
Ahamed Mujeeb's user avatar
0 votes
1 answer
56 views

Filter Code Coverage results in Azure DevOps Pipelines

I run my tests with VSTest@2 step with codeCoverageEnabled: true (.NET project) - task: VSTest@2 displayName: 'Run Tests' inputs: vsTestVersion: 'toolsInstaller' platform: '$(buildPlatform)...
nrofis's user avatar
  • 9,156
0 votes
0 answers
15 views

Can PHPUnit code coverage produce HTML diff of two coverages that correspond to two git commits

In the same sense that when I want to review code, I am reviewing only changes, I would also be interested only in the changes of unit coverage. So, what I'd like to see is the difference of the code ...
user_51's user avatar
0 votes
0 answers
32 views

Scala 3 - Sonar - Not getting unit tests coverage

I am using sbt-sonar 2.2.0 with Scala 3.3.1. I have a code with for comprehension and pattern matching and created tests for it. When I debugged it, all lines are covered and I certified that running ...
André Luís Oliveira's user avatar
0 votes
0 answers
14 views

junit platform console "--classpath DIR/*" doesn't work

So I have been trying to use intelliJ coverage agent "intellij-coverage-agent-1.0.735.jar" to generate a report for test coverage same as intellij's results. To execute the tests I have to ...
Hassan Shamseddine's user avatar
0 votes
0 answers
14 views

How can I prevent an invalid file warning when running a Matlab code coverage report?

Overview I am getting a warning from Matlab's code coverage that a file is "invalid", and I would like to get rid of that warning. I can think of two approaches, but I don't know how to ...
Rich006's user avatar
  • 175
-1 votes
2 answers
59 views

Constructing loop coverage for nested conditional loops in Java

I am currently learning about code coverage testing, specifically loop coverage, in Java. From context, loop coverage involves running a loop 0, 1 and >1 times. However, I've encountered a problem ...
Kenny Ynnek's user avatar
0 votes
0 answers
12 views

How to track the code coverage progress in sonarqube community edition Version 7.9.3 for a specific time period

Currently we are using the sonarqube community edition 7.9.3, we have multiple projects on sonar, we want to track the code coverage progress(progress in a sprint) in single place.Can someone ...
Murugesh Subramaniam's user avatar
0 votes
2 answers
64 views

ModuleNotFoundError when running coverage run -m pytest . in GitHub Actions

I have a very simple project like below // ├─ src/ │ ├─ sample/ │ │ ├─ __init__.py │ │ ├─ simple.py ├─ tests/ │ ├─ __init__.py │ ├─ test_simple.py When I tried running the coverage command ...
Petra Barus's user avatar
  • 3,835
0 votes
1 answer
19 views

Unable to cover specific lines in Angular method

I have this class where I am using a couple of services to get data and then transform it and return it as observable. Test coverage is not covering just one specific part of it no matter what I try. ...
Kashif999's user avatar
0 votes
0 answers
20 views

SonarQube Report Shows Uncovered Conditions for Minimal Vue.js Extension File Changes

I'm encountering an issue with my SonarQube report generated locally for a Vue.js extension file. Despite making only three lines of code changes, the report indicates 22 uncovered conditions, ...
Prem's user avatar
  • 11
0 votes
0 answers
23 views

dotCover code coverage script - GPU process isn't usable

I encountered an issue with my C# code coverage calculation script using dotcover: dotcover c configuration_file.xml Everything was working well until a few days ago when I started getting the ...
EagleOne's user avatar
  • 551
-3 votes
2 answers
90 views

The sequence of executed statements of a Java program [closed]

Given a Java program, I would like to run it and determine the sequence of statements that were executed. For instance, upon running the program import java.util.Scanner; public class Temp { ...
Luka Fürst's user avatar
0 votes
0 answers
15 views

Code Coverage Tool Branch Coverage tree illustrator for Java

Is there any code coverage tool or debugger tool for Java that displays the branch coverage as a tree? I just thought that it is easier for the developer to debug and cover the code when there's a ...
DanDev's user avatar
  • 1
0 votes
0 answers
33 views

PHPUnitCode Coverage readonly classes

I have a project with Laravel 9, phpunit/php-code-coverage: "^9.2" and phpunit/phpunit: "^9.3.3". I can run individual tests and everything works correctly, but if I try to ...
juan manuel Sivianes Guisasola's user avatar
0 votes
0 answers
17 views

Coverage not considering codes called from resource urls when using Flask

Python coverage is not considering codes that have been executed via resource urls. Example: I have resource url api.add_resource(Register, '/register') in server.py file. The /register url points to ...
Curious's user avatar
  • 127
0 votes
1 answer
32 views

Does Docker need to be installed ona Windows server that's hosting a GitLab CICD runner?

I'm using an on-premise hosted GitLab andt have a CI/CD pipeline which builds a .NET 6 application, executes unit tests and deploys the binaries to a ZIP file for later deployment. I want to add code-...
endurium's user avatar
  • 872
0 votes
0 answers
16 views

code coverage breaks while running ng test

We have around 5000 odd spec files, when we run code coverage using the following command: node --max_old_space_size=10240 node_modules/@angular/cli/bin/ng test --code-coverage=true the code coverage ...
shivangi arora's user avatar
1 vote
0 answers
76 views

Xcode xccov command throws error "Failed to load coverage archive in scheme action"

I have been using the following command on CI to generate a code coverage report for years: xcrun xccov view --report --json path/to/App.xcresult > ./test_output/reports/xccov.json In the last day ...
jshapy8's user avatar
  • 1,993
0 votes
0 answers
31 views

ISTQB question: Statement Coverage and Decision Coverage

I interesting and studying about statement and decision coverage . What type of problem will be found with 100% decision coverage that would be missed by 100% statement coverage? A. A ...
Poorna Senani Gamage's user avatar
0 votes
0 answers
35 views

async method reducing the coverage under branches

Here's my code: it('test method', async () => { const self = {} const a = await identityModule.init(self); expect(a).to.equal("abc") }); Note that the coverage is 100% ...
ABGR's user avatar
  • 4,771
0 votes
0 answers
26 views

Get PHP project coverage in real time without ending the program running

I want to test the coverage of a php web application. I need to get the coverage in real time while the program is running, like nyc or jacoco. Instead of getting it when ending the program, or ...
kreamyu's user avatar
0 votes
1 answer
72 views

Azure Pipeline Error in generating code coverage results

I am trying to generate code coverage results for my .net core project using Azure Pipelines. This is my pipeline.yml trigger: - sonar-analysis pool: vmImage: 'ubuntu-latest' variables: solution:...
Ajinkya Bapat's user avatar
0 votes
1 answer
71 views

Merge python and javascript coverage to appear in one SonarCloud key

I've got a monorepo that contains a Python Flask API with a Svelte Javascript frontend. I'm trying to get the coverage into Sonarcloud. It works when I set it up only for Python OR Javascript, but not ...
Lilian Delouvy's user avatar
0 votes
1 answer
161 views

Adding azurepipelines-coverage.yml to the root of the repo doesn't work

I wanted to set up an optional code coverage check for PRs in Azure DevOps pipeline. So I followed the official doc by adding an azurepipelines-coverage.yml file at the root of the repo that I am at, ...
stargirl's user avatar
0 votes
0 answers
11 views

How to run CTest with coverage by Visual Studio 2019 from the command line?

I have a CMake project with x86 native (win32) tests using CTest. I succesfully ran them with coverage results from Visual Studio Enterprise 2019 IDE using the Test Explorer. Now I’m trying to run ...
Nicolas D.'s user avatar
0 votes
0 answers
50 views

How to set up Mocha with Instanbul coverage for ESM code in 2023?

I am almost done shaving a yak, but this one has me stumped... My code base and the tests are ES6 code. All tests are running as expected through Mocha, but I cannot get coverage. All I get is: -------...
Michael Jonker's user avatar
0 votes
0 answers
11 views

Is there way to get Code coverage for classes which doesn't contain any unit test using OpenCover

I am trying to see how much code in my source project(.net) is covered by the unit test in my test project using OpenCover.exe. 'Path to OpenCover.exe' - target:'dotnet.exe' -targetargs:'test project ...
Sasiru Vishmika's user avatar
0 votes
3 answers
88 views

Throwing nullpointerexception for nested bean that autowired in Junit mockito test case

I have Junit test case for service layer, from service method logic calling some other beans with autowired and in the unit test case I used that bean as Autowired beacuse that also should cover as ...
Anil Nivargi's user avatar
  • 1,525
0 votes
1 answer
36 views

pytest coverage reports differently both locally and on CI

I write a Django boilerplate here: https://github.com/trouchet/tarzan. So far, so good! On a file Makefile, I write the following target, and run make report when I need to see how development is ...
Tarzan Django's user avatar
0 votes
1 answer
71 views

how to integrate a test coverage reports in maven site for a multi modules project?

I would like to add a coverage report in my maven site website in the case of a multi-modules project. I found how to have an aggregated coverage report in a module created just to for that. see . But ...
nizery's user avatar
  • 43
0 votes
0 answers
13 views

How to specify the position information of a node - on which line, when inserting a new node using babel

here is my resource code const a = 1 + 2; function Controller() { console.log('hi'); } I wanna to convert it to as following by babel const a = 1 + 2;log(); function Controller() { console....
zuoyuan's user avatar
  • 11
0 votes
0 answers
27 views

Codecov on github: why is Codecov failing?

Context: I'm dipping my toe into GitHub's lovely CI/CD facility and having a bit of difficulty. https://github.com/rdpoor/basic-cicd is a super-simple repo designed to run unit tests and coverage ...
fearless_fool's user avatar
0 votes
1 answer
28 views

How to ensure Codecov test the right code coverage?

I'm trying to use Codecov to get the test coverage of Transformers. But when I look into transformers' workflows, many .yml files with pytest exist. How can I get the coverage report that accurately ...
Yunbo's user avatar
  • 1
1 vote
0 answers
49 views

Coverage of C++ Code called via Pybind from Python Test

Currently working with a legacy codebase that creates a number of Pybind modules and tests most of the exposed C++ code via Python tests. Is it possible to determine code coverage of the C++ code via ...
celestialorb's user avatar
  • 1,911
0 votes
0 answers
18 views

How to merge code coverage from two different sonar projects

I have two sonar projects, one is getting UT coverage and other one is capturing FT coverage. Since these are two different sonar project thats why I can not bind both to my single git repo. Is there ...
Deepu--Java's user avatar
  • 3,761
1 vote
0 answers
35 views

Why is a "Baseline" step needed for LCOV to get "correct" results?

man lcov says: --initial Capture initial zero coverage data. Run lcov with -c and this option on the directories containing .bb, .bbg or .gcno files before running any test case. The result is a &...
Johannes Schaub - litb's user avatar
0 votes
0 answers
71 views

Avoid including coverage folder created from running yarn coverage using vitest in git commit

Our team is using vitest, vitest-environment-nuxt, nuxt-vitest for component unit testing,provider for creating coverage report is v8,using package @vitest/coverage-v8. What I want to achieve is ...
EquilibriumOfMyOwn's user avatar
0 votes
0 answers
15 views

How do I enable and publish code coverage?

This is the dotnet test command that I am using to test and publish code coverage, but it is not publishing code coverage. What am I doing wrong? dotnet test $TestProjectDirectory --results-directory $...
DERK's user avatar
  • 11
0 votes
0 answers
47 views

how to ignore log statements in scoverage

i am using sbt-scoverage plugin for code coverage I am getting a very low code coverage of 21%, in codeCoverage report i can see red lines on all the log statements i have used in my classes how can i ...
swaheed's user avatar
  • 3,855
1 vote
0 answers
153 views

Slather Coverage.profdata not found - Xcode 14.3 - Xcode 15.0

Premise: it works with Xcode 14.2 I have a problem with fastlane and slather, it gives me an error that it cannot find the "code coverage folder" Here are some details Fastlane file slather( ...
nonickname's user avatar
4 votes
1 answer
107 views

C++ code coverage - gitlab runners, cmake, and absolute paths

When a project is integrated in a gitlab CI pipeline, this pipeline is often broken into several steps : compilation unit tests integration tests These tests can be executed on a runner pool, with ...
Charles G's user avatar
  • 477
1 vote
0 answers
86 views

Xcode test coverage for Swift APIs that don't have explicit body

I'm looking for a way to get test coverage for the Swift APIs that don't have explicit implementations (e.g., properties, enum cases, type names, protocols, etc). Specifically, to understand whether ...
skyylex's user avatar
  • 815
0 votes
1 answer
30 views

Is there a tool or an approach that will give us the code coverage of a Java app by running the UI functional tests written using selenium with python

We have a an application built using Java. The JUnit tests are run and configured with JaCoCo to get the code coverage of the unit tests. We have our testframework built using Python with Selenium for ...
Kavya Padmanabha's user avatar
1 vote
1 answer
81 views

Azure DevOps - Comparing Code Coverage Against Different Branches

In Azure DevOps, is there a way to create a status check for a build pipeline for branch A, that compares the code coverage of branch B to A? e.g. When creating a PR to merge branch B to A, the status ...
stargirl's user avatar
0 votes
1 answer
61 views

Eclipse coverage reports that branches missed but why?

I want to coverage all of if branches. I create a dumb class with multiple if...else, and test it with all branches conditions to test coverage. The Eclipse reports abount 1 of 4 branches missed and 2 ...
sdorof's user avatar
  • 539

1
2 3 4 5
107