Repository navigation
Coverage in CI and Sonar, plus quality badges - #3
Merged
Merged
Conversation
Add the v8 coverage provider and an `npm run test:coverage` script. It covers src/ only and writes coverage/lcov.info for Sonar. The run fails when coverage drops below 90% statements, 85% branches, 90% functions or 90% lines, a little under today's 92/87/91/94.
CI runs the tests with coverage, so a drop below the thresholds fails the check. The Sonar workflow runs the same step before the scan and passes the lcov report on. Before this, every file was excluded from Sonar's coverage figures. Now only src/ is measured, without type declarations, build scripts and config files. A test failure in the Sonar job doesn't stop the scan, since CI already reports it.
CodeQL links to the default code scanning setup. The quality gate and coverage badges come from SonarQube Cloud.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



What
npm run test:coveragemeasuressrc/with the v8 provider and writescoverage/lcov.info.sonar-project.propertiesreads the lcov report. Before this, every file was excluded from Sonar's coverage figures.Notes