Sonarcloud coverage hell (need help)

I’m in code coverage hell right now and am hoping someone in the community might be able to help. The CETL project’s sonarcloud build hasn’t been reporting code coverage data even though we are generating it – both as HTML reports and cobertura xml – and it is not empty. I’ve been trying shit for the last few hours to no avail. At this point I have to assume that sonarscanner just can’t handle header-only C++. This would mean we need a different solution other than sonarcloud. I tried jetbrain’s new solution but it didn’t work at all so…fuck that noise. Anyone have other ideas?

I haven’t looked at the code but I struggled with header-only too, and there was a solution workaround that helped:

One working example here:

Another example from a large header-only library:

sonar-scanner \
--define sonar.host.url="https://sonarcloud.io" \
--define sonar.cfamily.compile-commands="$BUILD_DIR/compile_commands.json" \
--define sonar.projectName=dyshlo \
--define sonar.organization=zubax \
--define sonar.projectKey=Zubax_dyshlo \
--define sonar.sources=include,sitl,verification \
--define sonar.issue.ignore.allfile=a1,a2 \
--define sonar.issue.ignore.allfile.a1.fileRegexp='^TEST_CASE\([a-zA-Z0-9_]+\)$' \
--define sonar.issue.ignore.allfile.a2.fileRegexp='^namespace dyshlo::verification(::.+)?$' \
--define sonar.issue.ignore.block=1 \
--define sonar.issue.ignore.block.1.beginBlockRegexp='//.*NOSONARBEGIN' \
--define sonar.issue.ignore.block.1.endBlockRegexp='//.*NOSONAREND' \
--define sonar.coverage.exclusions="verification/**/*" \
--define sonar.cpd.exclusions="verification/**/*" \
--define sonar.cfamily.llvm-cov.reportPath="$BUILD_DIR/coverage.txt" \
--define sonar.cfamily.threads="$(nproc)" \
--define sonar.python.version=3.12,3.13

Tried this. No luck. Something may have changed and they might not support this at all anymore?

Perhaps coveralls.io?