I’m working in an Nx monorepo with multiple Nx Angular projects. One of my projects, named button, has two coverage reports: one generated by Jest and the other by Cypress. Both generate lcov.info files, which are reported to SonarQube using the following command:
When running these tests locally, the Jest coverage for button.component.ts shows as 86%, while the Cypress coverage is 93.02%. However, in SonarQube, the coverage for button.component.ts appears as 84.3%.
I was expecting the coverage to be at least 86%, so I would like to understand why there’s this discrepancy.
I’ve noticed a few other similar queries in the forum like this
Does anyone know what could be causing this? Enclosing the reports. button-coverages.zip (55.3 KB)
I’m specifically interested in the coverage metrics for button.component.ts. This file is not excluded by either coverage engine locally, and the metrics for it are included in the attached zip file.
However, when analyzed in SonarQube, it seems like the coverage reports for this single file aren’t being aggregated as expected. It almost appears that my Cypress coverage report is being ignored for this specific file.
The analysis / scanner log is what’s output from the analysis command. Hopefully, the log you provide - redacted as necessary - will include that command as well.