Skip to content

SonarCloud coverage setup, fixed numerous SonarCloud issues#840

Merged
uweseimet merged 2 commits intodevelopfrom
feature_sonarcloud_coverage
Sep 10, 2022
Merged

SonarCloud coverage setup, fixed numerous SonarCloud issues#840
uweseimet merged 2 commits intodevelopfrom
feature_sonarcloud_coverage

Conversation

@uweseimet
Copy link
Copy Markdown
Contributor

This PR fixes the GitHub action that collects SonarCloud coverage data. In addition, it merges the unit test and code coverage action into one, because both are related and the testing/coverage action setup is simplified The action was cleaned up in order not to do stuff not needed, e.g to install a cross compiler.
@akuker I think the cleanup is reasonable, but please tell me if I missed something. The build action remains unchanged, but maybe it can also be cleaned up in order to run faster.

This PR also fixes numerous SonarCloud issues which were not reported by the Eclipse SonarLint plugin.

Coverage results are available on https://sonarcloud.io/summary/new_code?id=akuker_RASCSI&branch=feature_sonarcloud_coverage.

@uweseimet uweseimet linked an issue Sep 8, 2022 that may be closed by this pull request
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Sep 8, 2022

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell B 34 Code Smells

24.3% 24.3% Coverage
4.7% 4.7% Duplication

@uweseimet uweseimet marked this pull request as ready for review September 8, 2022 09:23
@rdmark
Copy link
Copy Markdown
Member

rdmark commented Sep 8, 2022 via email

@uweseimet
Copy link
Copy Markdown
Contributor Author

@rdmark Are these errors really back? These errors were caused by unused code. I removed this code and the errors were gone. Do you still get them?

@rdmark
Copy link
Copy Markdown
Member

rdmark commented Sep 8, 2022 via email

@uweseimet
Copy link
Copy Markdown
Contributor Author

@rdmark This was an issue caused by the CD-ROM change. I already complained about that change having been merged without my review ;-).
I fixed this problem in feature_sonarcloud_coverage.

@akuker
Copy link
Copy Markdown
Member

akuker commented Sep 9, 2022

@rdmark This was an issue caused by the CD-ROM change. I already complained about that change having been merged without my review ;-). I fixed this problem in feature_sonarcloud_coverage.

Sorry about that! I'll try to do better!

@akuker
Copy link
Copy Markdown
Member

akuker commented Sep 10, 2022

@uweseimet - this weekend I'm going to spend some time on gpiobus.h/cpp. So, could you ignore those from your Sonarcloud cleanup efforts for now? Thanks!

@akuker
Copy link
Copy Markdown
Member

akuker commented Sep 10, 2022

@uweseimet - FYI: In SonarCloud, I turned off the code duplication metrics for the src/raspberrypi/test directory. It was making the duplicate code metrics artificially high. Let me know if you disagree with this action, and I"ll change it back.

@uweseimet
Copy link
Copy Markdown
Contributor Author

uweseimet commented Sep 10, 2022

@akuker Cleaning up gpiobus.h/cpp sounds good. Together with cfilesystem.h/cpp these classes cause a major part of the remaining SonarCloud issues, based on the the issue status of the https://sonarcloud.io/summary/new_code?id=akuker_RASCSI&branch=feature_memory_management_update branch.
Regarding code duplication for the tests i'm fine. I already had a look at the duplications in testing.h and did not find a way to address them. It is probably better to just exclude testing.h.

@uweseimet uweseimet merged commit f0c36fb into develop Sep 10, 2022
@uweseimet uweseimet deleted the feature_sonarcloud_coverage branch September 10, 2022 06:00
@uweseimet
Copy link
Copy Markdown
Contributor Author

uweseimet commented Sep 10, 2022

@akuker The current workflow compiles and tests the same code twice if there is a PR for a branch. It is compiled for the PR and additionally for the branch. I suggest to change the workflow to not deal with PRs, because usually there is always a branch with the code changes the PR refers to. I will add the required change to #842.

Edit: I reverted that change because the PRs do not show the quality results anymore with it. But the fact that the same workflows are run twice is not nice.

@akuker
Copy link
Copy Markdown
Member

akuker commented Sep 10, 2022

If we run them twice, that makes up for all the PRs we did without running the workflows ;]

TBH, I don't really have a problem with it running twice. that can be something we fix somewhere down the road, but it would be pretty far down on my priority list.

@uweseimet
Copy link
Copy Markdown
Contributor Author

@Akuer You get the same email (qualitty gate) filed twice once you have create a (draft or final) PR.
It would be goold to adjust the quality gate settings anyway, because with the current settings there is no chance at all to pass. IMO the gate should be adjusted (stricter conditions) step by step, and should essentially ensure that the code quality does not get worse.
Failing gates because of goals that cannot (yet) be met result in those emails to be discarded as spam, which is quite counter productive.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add/Fix SonarCloud code coverage support, fix more issues

3 participants