No coverage diff in pull request for a TypeScript project; overall coverage is correctly reported

Here’s a sample comment by a bot on one of the PRs that was created after merging the initial coverage reporting and making it work: Update tests, add more socket and ping tests, re-export a bit more types, add a coverage badge by slvrtrn · Pull Request #256 · ClickHouse/clickhouse-js · GitHub

See that it still shows “- No data about Coverage”. Same in the next PR, where there were more obvious changes to the code base, and not just index.ts or tests.

However, the overall coverage is correctly reported on the main branch and is correctly shown as 94%+ in the Overall code tab.

Is it something that I misconfigured, perhaps?

Here are the related bits:

Extra tweaks in SonarCloud:

  • The new code is set to “previous version”; still no diff even though there were two new versions already (git tags/releases).
  • TSConfig path: tsconfig.all.json (which is in the repo root)

Analysis scope:

  • include **/src/**
  • exclude **/client-web/** (this scope is supposed to collect the Node.js package coverage, which resides in packages/client-node/src/** and uses packages/client-common/src/** and should be included by the previous setting).
  • test file exclusions: **/__test__/**

Is there anything obvious I am missing here?

Hey there!

Is your expectation that:

  • There are new lines in the PR that should be indicated as covered (or not) by your coverage report
  • That the PR comment shows the Estimated after Merge figure
  • Both?

Hi Colin, thanks for the reply.
The desired outcome is:

  • Current main branch coverage: 94.4%. PR diff: +/- X%, estimated main coverage after merge Y%.

Instead of “No data about coverage”.