-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix SonarQube test coverage issue #1557
Merged
Merged
Conversation
This file contains 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
For some reason, SonarQube (formerly SonarCloud) no longer correctly recognises test coverage. This PR is to investigate and fix the issue.
StuAA78
added
bug
Something isn't working
housekeeping
Refactoring, tidying up or other work which supports the project
labels
Dec 11, 2024
StuAA78
force-pushed
the
fix-sonarqube-test-coverage-issue
branch
from
December 11, 2024 17:07
f687dfe
to
f8f0388
Compare
Cruikshanks
approved these changes
Dec 12, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was referenced Dec 13, 2024
StuAA78
added a commit
to DEFRA/hapi-pg-rest-api
that referenced
this pull request
Dec 13, 2024
Our CI pipeline uses SonarCloud for static code analysis using the `sonarsource/sonarcloud-github-action` action. This has recently been deprecated in favour of `sonarsource/sonarqube-scan-action` following the rebranding of SonarCloud to SonarQube Cloud. This PR therefore makes the required change to `ci.yml`. We also resolve a code coverage issue by removing a previously-required fix; see DEFRA/water-abstraction-system#1557 for info.
StuAA78
added a commit
to DEFRA/water-abstraction-helpers
that referenced
this pull request
Dec 13, 2024
Our CI pipeline uses SonarCloud for static code analysis using the `sonarsource/sonarcloud-github-action` action. This has recently been deprecated in favour of `sonarsource/sonarqube-scan-action` following the rebranding of SonarCloud to SonarQube Cloud. This PR therefore makes the required change to `ci.yml`. We also resolve a code coverage issue by removing a previously-required fix; see DEFRA/water-abstraction-system#1557 for info.
StuAA78
added a commit
to DEFRA/water-abstraction-permit-repository
that referenced
this pull request
Dec 13, 2024
Our CI pipeline uses SonarCloud for static code analysis using the `sonarsource/sonarcloud-github-action` action. This has recently been deprecated in favour of `sonarsource/sonarqube-scan-action` following the rebranding of SonarCloud to SonarQube Cloud. This PR therefore makes the required change to `ci.yml`. We also resolve a code coverage issue by removing a previously-required fix; see DEFRA/water-abstraction-system#1557 for info.
StuAA78
added a commit
to DEFRA/water-abstraction-returns
that referenced
this pull request
Dec 13, 2024
Our CI pipeline uses SonarCloud for static code analysis using the `sonarsource/sonarcloud-github-action` action. This has recently been deprecated in favour of `sonarsource/sonarqube-scan-action` following the rebranding of SonarCloud to SonarQube Cloud. This PR therefore makes the required change to `ci.yml`. We also resolve a code coverage issue by removing a previously-required fix; see DEFRA/water-abstraction-system#1557 for info.
StuAA78
added a commit
to DEFRA/water-abstraction-tactical-crm
that referenced
this pull request
Dec 13, 2024
Our CI pipeline uses SonarCloud for static code analysis using the `sonarsource/sonarcloud-github-action` action. This has recently been deprecated in favour of `sonarsource/sonarqube-scan-action` following the rebranding of SonarCloud to SonarQube Cloud. This PR therefore makes the required change to `ci.yml`. We also resolve a code coverage issue by removing a previously-required fix; see DEFRA/water-abstraction-system#1557 for info.
StuAA78
added a commit
to DEFRA/water-abstraction-tactical-idm
that referenced
this pull request
Dec 13, 2024
Our CI pipeline uses SonarCloud for static code analysis using the `sonarsource/sonarcloud-github-action` action. This has recently been deprecated in favour of `sonarsource/sonarqube-scan-action` following the rebranding of SonarCloud to SonarQube Cloud. This PR therefore makes the required change to `ci.yml`. We also resolve a code coverage issue by removing a previously-required fix; see DEFRA/water-abstraction-system#1557 for info.
StuAA78
added a commit
to DEFRA/water-abstraction-import
that referenced
this pull request
Dec 13, 2024
Our CI pipeline uses SonarCloud for static code analysis using the `sonarsource/sonarcloud-github-action` action. This has recently been deprecated in favour of `sonarsource/sonarqube-scan-action` following the rebranding of SonarCloud to SonarQube Cloud. This PR therefore makes the required change to `ci.yml`. We also resolve a code coverage issue by removing a previously-required fix; see DEFRA/water-abstraction-system#1557 for info.
StuAA78
added a commit
to DEFRA/water-abstraction-service
that referenced
this pull request
Dec 13, 2024
Our CI pipeline uses SonarCloud for static code analysis using the `sonarsource/sonarcloud-github-action` action. This has recently been deprecated in favour of `sonarsource/sonarqube-scan-action` following the rebranding of SonarCloud to SonarQube Cloud. This PR therefore makes the required change to `ci.yml`. While amending this, we found an unused sonarcloud config file `src/sonar-project.properties`, which we delete. We also resolve a code coverage issue by removing a previously-required fix; see DEFRA/water-abstraction-system#1557 for info.
StuAA78
added a commit
to DEFRA/water-abstraction-ui
that referenced
this pull request
Dec 16, 2024
Our CI pipeline uses SonarCloud for static code analysis using the `sonarsource/sonarcloud-github-action` action. This has recently been deprecated in favour of `sonarsource/sonarqube-scan-action` following the rebranding of SonarCloud to SonarQube Cloud. This PR therefore makes the required change to `ci.yml`. We also resolve a code coverage issue by removing a previously-required fix; see DEFRA/water-abstraction-system#1557 for info.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
bug
Something isn't working
housekeeping
Refactoring, tidying up or other work which supports the project
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.
SonarQube (formerly SonarCloud) recently stopped correctly recognising test coverage. This PR fixes the issue.
Summary
On investigating, we realised that this was due to a fix we'd put in place to work around a SonarQube issue that had now been resolved, and our fix was now causing problems. We therefore remove the fix to ensure SonarQube recognises code coverage again.
Detail
Previously, SonarQube expected the code it analyses to be under the path
/github/workspace
. However, thelcov.info
code coverage report had the code under a different path/home/runner/work/water-abstraction-system/water-abstraction-system
. We therefore usedsed
to replace the original paths inlcov.info
with ones under/github/workspace
, ensuring that SonarQube correctly picked up code coverage.Somewhere between 02/12/2024 and 05/12/204, SonarQube started expecting the code to be under the
/home/runner/work/water-abstraction-system/water-abstraction-system
path. This can be seen by comparing the logs of a previous run to a recent run:Run dated 02/12/2024
Run dated 05/12/2024
Because our fix changed the file paths to be under
/github/workspace
, SonarQube no longer recognised the files under/home/runner/work/water-abstraction-system/water-abstraction-system
as having code coverage, hence the issue. Removing the fix therefore resolves this.