384 questions
0
votes
1
answer
56
views
Why does SimpleCov generate a coverage report before running tests?
I'm trying to build a Ruby gem. I set up a development environment using a Docker image based on Ruby 3.3 and a devcontainer.
I initialized a gem using the bundle gem tooling. This set up the basic ...
0
votes
0
answers
68
views
Individual test passes, but fails with --coverage in Jest. Why?
I'm facing an issue running my tests with Jest in a React Native project. When I run the tests individually (using the command to run a specific test), they pass without a hitch. However, when I run ...
0
votes
0
answers
37
views
Why is Maven finding JUnit test cases without the Surefire plugin?
I'm trying to configure Maven to find and run my JUnit test cases, and I initially added the Surefire plugin for this purpose. However, I noticed that Maven is able to find and run the test cases even ...
1
vote
0
answers
98
views
How to exclude "branch not taken" reporting for specific lines in gcovr?
I am working on a C++ project compiled with g++ --coverage so that unit testing generates coverage metrics, which are converted to html reports by gcovr.
The branch coverage information is misleading, ...
-1
votes
1
answer
60
views
coverage for array with a fixed value of each element
I have a 1D array of 512 elements, which is 8 bit wide.
I want the coverage to hit 100% only when a specific unique value is present in each of these 512 elements.
For eg, let say we had only 4 ...
0
votes
0
answers
19
views
How to measure the test coverage of data quality checks?
Assume we have data quality checks for the output of data pipelines. How can we measure the share of data quality issues we can detect with our data quality checks?
Is there something similar like ...
0
votes
1
answer
82
views
System Verilog: Biitwise coverage for multibit signal
I'm beginner in System Verilog. I want to implement a coverage such that a user will send a signal - lets call it input_signal[Width-1 :0] Where width is variable. I want to have bitwise toggle ...
0
votes
0
answers
114
views
Python Coverage is not increasing using Pytest
I have multiple python modules to be tested and I'm testing it using the tox file with the command "coverage run -m test_folder".
While testing, for few modules I'm getting lower test ...
1
vote
0
answers
70
views
get only test coverage in sonarqube and not run the static code analysis of all the files
I am trying to get only test coverage report generated by jacoco plugin in multi-module gradle project and dont want to run static code analysis(takes lotta time).
I have tried till now:
sonar....
1
vote
1
answer
44
views
Angular conditional coverage inside ngAfterViewInit
I have a code under ngAfterViewInit unable to coverage conditions/branches
As i need to cover 100% on new code, please give me suggestions (currently at 68%)
Tried few tests but not covering branches
0
votes
0
answers
146
views
Pytest coverage is not working with Python3.9, error out, no module named '_sqlite3'
I am trying to run pytest with coverage option (i.e. --cov) with python 3.9, it is not working, but when I run on Python 3.6 or 3.7 version it works.
python -m pytest --cov=my_package --cov-report=xml
...
1
vote
3
answers
122
views
How do I tell IntelliJ to do a "full" path coverage sweep?
Suppose I have the following code:
class NetPay {
/**
* Computes the net pay of an employee given certain conditions.
* @param hours - the number of hours worked.
* @param rate - the ...
2
votes
1
answer
86
views
How to test all branches of a range test?
While aiming at 100% branch coverage, I am experiencing some difficulties in testing both conditions of a range check:
// Find the matching tier
for (uint256 i = 0; i < tiers.length; i++) {
...
4
votes
2
answers
2k
views
MSW - Error: No known conditions for "./browser" specifier in "msw" package
After doing successful MSW (Mock Service worker) setup for browser. Everything is working fine.
Here is my setup files ->
//handlers.ts
import { http, HttpResponse } from 'msw';
const handlers = [
...
0
votes
0
answers
94
views
Unable to generate code coverage for integration test module using jacoco
I have a maven project with the attached directory structure.
It contains a parent.pom and two modules.
plugin
1.1 It contains the actual source code inside src/main
1.2 It contains the unit test ...
0
votes
0
answers
16
views
can anyone advise on how to get the test coverage for istio/proxy?
build_envoy:
export PATH=$(PATH) CC=$(CC) CXX=$(CXX) &&
bazel $(BAZEL_STARTUP_ARGS) build $(BAZEL_BUILD_ARGS) $(BAZEL_CONFIG_REL) @com_googlesource_chromium_v8//:build &&
bazel $(...
0
votes
0
answers
35
views
Strategy to ensure assemblies are loaded during unit testing in ADO and are counted against testing metrics
So I ran into a bit of an embarrassing situation recently where my test coverage via pipeline was fantastic but a bug came out, and root cause analysis found that it was in a very small project/dll/...
0
votes
0
answers
448
views
Exclude Branch from coverage with Gcov / Gcovr
I'm trying to get some branches that I am not interested in testing removed from my test results, but I'm unable to get the "EXCL_BR" markers to work.
With this sample code
int32_t function(...
0
votes
0
answers
48
views
coverage.py how to exclude contexts
I run different coverage tests each with a different context.
After combining them I would like to exclude some contexts from an html report.
From my small experience and understanding of the ...
1
vote
0
answers
64
views
Can test written on PyTest calculate the code coverage using Jacoco of Java code?
We have a test automation framework using pytest and the codebase of the mobile applications is in Java.
Currently the dev team is running their unit and Integration tests using Junit and generates ...
1
vote
1
answer
1k
views
Exclude parameter does not work in dotnet test command with test coverage
I got project structure :
-my-application.sln
--src
----Api
----ApplicationServices
----Domain
----Infrastructure
--tests
----ApplicationServices.UnitTests
----Domain.UnitTests
----Infrastructure....
0
votes
1
answer
92
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 ...
3
votes
3
answers
1k
views
Jacoco Not Showing Coverage for Robolectric Tests in Android Studio
I'm facing an issue where the Jacoco code coverage results aren't showing up for unit tests that use Robolectric. The tests execute and pass successfully, but the Jacoco coverage seems to ignore files ...
0
votes
1
answer
670
views
Why I getting wrong code coverage in Jest (Angular)
I have created small project to check coverage results and have unexpected results.
It's definitely a configuration error on my part, but I just can't figure out what I have to tweak in order to fix ...
1
vote
1
answer
622
views
Github Actions add quality gate for test results
Net core and github actions. I have pipeline running in Github actions and I have integrated Sonarqube. My requirement is if the code coverage is less than 70 or any specified number then we should ...
0
votes
1
answer
210
views
Test coverage or code coverage: which methodology would describe the reports generated from the "rails stats" and "yarn test --coverage" commands?
Backstory: Trying to differentiate between test coverage and code coverage. I have a decoupled application that uses React for the frontend and Rails for the backend. I have a acceptance criteria to ...
0
votes
1
answer
172
views
Is lcov file which has 2 other lcov files simply concatenated a valid lcov file?
I have 2 lcov report files I want to concatenate to send to Sonar instance. One if from unit tests and second one is from e2e tests ( Selenium ).
So I intend to do
cat unit.lcov >> e2e.lcov
Is ...
0
votes
0
answers
565
views
JUnit test case to cover multiple stream filter conditions - SonarQube code coverage
Working on SonarQube code coverage & stuck with below conditional filter from stream. I need to write Junit such as both conditions will get covered and should cover this line as part of sonar. ...
3
votes
0
answers
287
views
Get code coverage in truffle test smart contracts
I am working on a blockchain project and have several smart contracts to be tested. For that, I use the Truffle test suite and write JavaScript tests.
I want to know, is there any way to get the code ...
1
vote
0
answers
566
views
How to get code coverage data from Rust integration tests
I am currently contributing to a Rust open source project. The project uses the standard Rust unit tests for some of its testing. However, it does most of its testing by using Bats integration tests. ...
1
vote
1
answer
1k
views
GitLab CI merge request overview does not show test coverage changes
In my project I've added to .gitlab-ci.yml file regex coverage: /All files[^|]*\|[^|]*\s+([\d\.]+)/ section to catch test coverage value from coverage reports files and it works. The only issue that ...
0
votes
3
answers
846
views
Missing Branch coverage in enum class in kotlin
I have enum class
enum class Type(val type: String) {
ONE("one"),
TWO("two"),
THREE("three");
companion object {
private val mapByType = Type....
0
votes
1
answer
2k
views
How can I write Junit test cases for @AllArgsConstructor in lombok
How can write the test cases for @AllArgsConstructor in lombok. Can any help me out solving the problem.
@AllArgsConstructor
@JsonIgnoreProperties(ignoreUnknown = true)
public class ABC{
private ...
1
vote
0
answers
209
views
coverage panel not showing information (in android studio)
I'm trying to run a test with coverage (using the command Run 'GameViewModelTest' with Coverage), but when I do that and then open the Coverage panel (after the Build is complete), no information ...
1
vote
1
answer
1k
views
Why is `coverallsapp/github-action@v2` saying "Nothing to report" when I have a coverage directory generated by c8?
I am running tests and collecting coverage with Vitest configured to use the c8 coverage library. This seems to be working because when the tests finish, I get a coverage report in the terminal and a ...
1
vote
1
answer
429
views
GoCov Getting Test Coverage
I have a test in my application but my test coverage is saying that I have 0% coverage.
Below is the make command that I am using:
# TODO: FIX this it works if I go into the src directory and manually ...
0
votes
1
answer
3k
views
Typescript optional chaining testing branch count
I'm having some trouble understanding branch coverage when it comes to optional chaining with typescript.
Here is my code
type testingType = {
b?: { a?: number };
};
export function example(input:...
1
vote
0
answers
199
views
Jest has stopped generating ICOV-reports . Coverage shown is 0% for all files
We are facing some issues in our react web application.
Our jest coverage report has stopped generating icov-reports suddenly and all files show 0% coverage.
Our react version is : 16.11.0
Jest ...
1
vote
0
answers
1k
views
Jacoco Test Coverage Verification not getting executed
I am trying to add test coverage verification in my kotlin gradle project. I added a super high minimum value (0.99) to fail my build but this task is not getting executed.
tasks....
2
votes
1
answer
299
views
Is it possible to collect coverage on code loaded with vm.runInContext with Jest?
I'm working on a legacy JS project which is not using any require/import. When deploying, the files are just concatenated and the result is sent to a server.
In order to write tests with jest, I ...
0
votes
1
answer
417
views
Use jq to print only the percentages of coverage from a json-summary file to markdown in github actions
I want to pretty print my json-coverage jest results to github actions. I have a ci.yml file with the following:
- name: Run Unit Tests
run: |
yarn test:next:unit --runInBand --...
1
vote
1
answer
1k
views
bazel running out of memory and crashing when running coverage [duplicate]
When running Bazel coverage on service code, it is crashing on Jenkins pods and also local mac. I want to know does Bazel provide any run efficiency flags to be used in these cases where time does not ...
3
votes
0
answers
537
views
How to write unit test for BigQuery Java code
Can you help me write the Java unit test cases for increasing the coverage for the below Java code which retrieves the data from the BigQuery using the given query ?
BigQuery bigQueryInst =
...
1
vote
0
answers
158
views
Code Coverage for Backend code when running UI Automated tests
I ve a test automation suite in Cypress for testing a webapp. The webapp is developed using JS frameworks in the frontend and Java/C# in the backend. My requirement is to calculate code coverage for ...
2
votes
0
answers
199
views
Jacoco missing coverage when test is created
I have a project with spring-boot 2, JUnit 4, jacoco 0.8.6 and I use maven to run unit test, I have the following class:
@Component
public class AccountVOValidator implements FormValidator<...
1
vote
0
answers
224
views
test coverage for rescue blocks in rspec
I am trying to get coverage on the following sections of code (from begin to end)in my attached spec where
def process_request(data)
agents = agent_emails(data)
begin
ej = EmailerJob....
3
votes
1
answer
1k
views
pytest coverage with conditional imports and optional requirements
I got a hint to use optional requirements and conditional import to provide a function that can use pandas or not, depending whether it's available.
See here for reference:
https://stackoverflow.com/a/...
0
votes
1
answer
482
views
Jacoco coverage over ternary operations
I faced a frustrating problem with jacoco and ternary operations in Java.
Context:
I have a function which take a List<String>. The max filters this list can have is 10 and they can be set or ...
2
votes
0
answers
95
views
How can I get the lines that were covered by a particular test method?
I was trying to get all the lines that a test case covered. For instance,
org.apache.commons.lang.text.StrBuilderAppendInsertTest.testAppendFixedWidthPadLeft(org.apache.commons.lang.text....
1
vote
0
answers
37
views
Error testing coverage , should update recommendation state when data is gotten successfully
I'm a beginner in flutter and currently learning testing . here i found an error in my project when i run the program.please help me fix it
i got this error
C:\src\flutter\bin\cache\dart-sdk\bin\dart....