3

If you use python and GitLab like I do, you can include a test coverage report in your CI/CD pipeline. You pip install coverage and then just run coverage in your pipeline. The following is an excerpt from an AWS lambda pipeline, but you should be able to find something similar for your environment: script: - pip install -r ./awslambda/requirements.txt ...


2

There aren't any off the shelf solution currently that allows you to specify a variable number of code coverage percentage. There is the tool Courtney which enforces 100% code coverage. This tool also allows you to comment on blocks of code which do not need to be covered.


1

I found a solution to my problem. There is a library diff-cover which does exactly what i need. Here is a link -> https://diff-cover.readthedocs.io/en/latest/README.html


1

The issue has been resolved. This is for nodejs Need to install necessary dependencies either using yarn or npm. Once done, run nyc --reporter=lcov yarn unit unit $ ./cc-test-reporter after-build -t lcov --exit-code $?


1

You can use sonarqube. It does not generate its own test coverage report, but re-uses the coverage file of your existing pipelines.


1

This is my opinion: Coverage says nothing about correctness, so if you are writing unit tests for coverage, you are doing it wrong. Unit tests shall originate in requirements, the resulting coverage is a measure for completeness of your test suite and your code quality. If the coverage is low, chances are that your unit tests don't cover all requirements. ...


1

The way I would approach this would be to have a second part of the junit test that reads the generated zip file and then verifies it is correct. You are right that if you are only ensuring you can generate the file, but the file is incorrect, the unit test is incomplete.


Only top voted, non community-wiki answers of a minimum length are eligible