- ALM used GitHub
- CI system used GithubActions
- Scanner command used when applicable: Github action SonarSource/sonarcloud-github-action@master
- Languages of the repository: TS
We work with the following setup:
- we have an Nx monorepo
- on our CI (that runs on both PRs and main branch) we only run the test affected by the changes made. That result of course in partial coverage figures gathered when running our tests. While this does not look to be an issue when sonarCloud analyses coverage on PRs new code, this approach does not look to work when on the main branch (coverage measured on latest change merged is used as final coverage of the main branch - resulting in jumping figures that do not reflect reality).
Does someone has advices on how to have an efficient setup in our case that allows to have correct coverage figures on main?
- I’ve seen that there is a monorepo support option - but having 1 sonarCloud project for each monorepo project fragments a bit too much the coverage global figures and I’m not sure how it handles nx apps and libs shared by multiple apps
- Running all tests in order to have complete coverage figures on master does not look optimal too
Many thanks in advance for you suggestions