Skip to content

ci(windows): measure MSVC coverage with covdbg - #219

Closed
liasoft-lia wants to merge 1 commit into
LizardByte:masterfrom
liasoft-lia:covdbg
Closed

liasoft-lia wants to merge 1 commit into
LizardByte:masterfrom
liasoft-lia:covdbg

Conversation

@liasoft-lia

Copy link
Copy Markdown

Description

Hi! This PR switches the MSVC coverage leg from OpenCppCoverage to covdbg. Up front, so there's no surprise: covdbg is made by us at Liasoft, and this PR comes from our team's account. covdbg is a drop-in replacement for OpenCppCoverage, whose repository was archived in September. It reads the test binary and its PDB, so the build stays free of coverage instrumentation, and it's free for public repositories like this one. Its engine is closed source. We prepared it with AI assistance, and a person on our team reviewed every change before opening it.

What gets simpler for you:

  • covdbg writes repository-relative paths, so the "Normalize MSVC coverage paths" step is gone.
  • No OpenCppCoverage search: covdbg comes from our setup-covdbg action, pinned by commit like your other actions, instead of Chocolatey. It installs the latest covdbg release, so you get updates without touching the workflow; put a version number there if you'd rather pin one.
  • The step still fails when a test fails (--propagate-exit-code), and the Codecov upload with the Windows-MSVC flag is unchanged.
  • .covdbg.yaml keeps the same selection: examples/, src/ and tools/, without the broker test hook's private copy.
  • ci.yml and ci-build.yml add id-token: write next to the library build's contents: read. Despite its name, id-token: write gives no write access to the repository: it only lets the job ask GitHub for an OIDC token, which covdbg uses to recognise a public repository, so there's no secret and no sign-up for you.
  • Coverage is measured on pushes to master and on PRs from branches in this repository. GitHub doesn't hand pull requests from forks the OIDC token covdbg uses to recognise the repository, so fork PRs (this one too) run the MSVC tests as before without coverage, and ci-results.yml uploads only the reports that exist.
  • docs/development.md and a comment in tests/CMakeLists.txt now name covdbg for MSVC coverage.

codecov on our fork covdbg - Windows coverage for C++

The Codecov badge shows our fork's branch covdbg-codecov-proof at 0852186: this PR's commit plus one fork-only change that lets a fork upload to Codecov. In that run every job passed, and the Windows-MSVC upload lists the same 29 files as the report, under their repository paths.

Beyond CI there's an HTML report, coverage in the editor via the VS Code extension or the CLion plugin, and an MCP server so a coding agent can see what the tests still miss. All optional. covdbg runs on Windows today, for 32-bit, 64-bit and ARM64 programs. Linux and macOS support is on our roadmap and already in beta testing; until then gcovr stays for the other legs.

If it's not a fit, feel free to close it; we won't follow up. We'd really appreciate a short note on why, though, and what we could do better.

Screenshot

Issues Fixed or Closed

Roadmap Issues

Testing

Locally, on 45c9b4d (Debug, Visual Studio 2026, no driver installed), both tools over test_libvirtualhid.exe:

Lines covered / valid Files
OpenCppCoverage 0.9.9.0 4541 / 6357 (71.4%) 28
covdbg 1.5.1, this PR's .covdbg.yaml 4542 / 6357 (71.4%) 28

Same executable lines in the same files. The one line apart, windows_backend.cpp:1493, is the Switch Pro report thread's stop branch: it depends on thread timing, and it came out both ways across our runs. Under both tools 171 tests passed and the same 11 WindowsConsumerTest cases failed, because the driver isn't installed on that machine; in CI the driver is installed first. On our fork, with the driver installed, the MSVC job passes under covdbg: 191 tests passed and 3 skipped, among them 10 of the 11 WindowsConsumerTest cases; the 11th, XInputDoesNotExposeSubmittedXboxBattery, skips itself because XInput doesn't enumerate the virtual gamepad on GitHub's hosted runner. The report has 4729 of 6366 lines covered (74.3%), with repository-relative paths: the run, reports-Windows-MSVC artifact.

Type of Change

  • feat: New feature (non-breaking change which adds functionality)
  • fix: Bug fix (non-breaking change which fixes an issue)
  • docs: Documentation only changes
  • style: Changes that do not affect the meaning of the code (white-space, formatting, missing semicolons, etc.)
  • refactor: Code change that neither fixes a bug nor adds a feature
  • perf: Code change that improves performance
  • test: Adding missing tests or correcting existing tests
  • build: Changes that affect the build system or external dependencies
  • ci: Changes to CI configuration files and scripts
  • chore: Other changes that don't modify src or test files
  • revert: Reverts a previous commit
  • BREAKING CHANGE: Introduces a breaking change (can be combined with any type above)

Checklist

  • Code follows the style guidelines of this project
  • Code has been self-reviewed
  • Code has been commented, particularly in hard-to-understand areas
  • Code docstring/documentation-blocks for new or existing methods/components have been added or updated
  • Tests have been added or updated for new or modified functionality, including regression tests for bug fixes

AI Usage

See our AI usage policy.

  • AI tools were used while preparing this PR

Claude prepared the workflow change, ran the coverage comparison and drafted this description; a person on our team reviewed all of it before opening the PR.

AI attribution: Claude (agent: Claude Code; model: Claude Opus 5.5, claude-opus-5-5; thinking level: default).

covdbg replaces OpenCppCoverage in the MSVC leg, set up with
liasoft/setup-covdbg instead of Chocolatey. It writes repository-relative
paths, so the path normalization step is gone, and .covdbg.yaml keeps the
same selection (examples/, src/ and tools/ without the broker test copy).
Pull requests from forks, which get no OIDC token, run the tests without
coverage, and CI-Results uploads only the reports that exist.
docs/development.md and a comment in tests/CMakeLists.txt name covdbg.
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@sonarqubecloud

sonarqubecloud Bot commented Nov 4, 2026

Copy link
Copy Markdown

@liasoft-lia

Copy link
Copy Markdown
Author

Hi! The CLA check is waiting on us. We're contributing as a company (Liasoft GmbH), and your contributing guide says entities can't sign through CLA-assistant and should sign the entity CLA instead. How would you like to receive it: is a signed PDF by email fine, and if so, to which address? Happy to use whatever process you prefer.

@ReenigneArcher

Copy link
Copy Markdown
Member

@liasoft-lia Thank you for the PR. I think I will go with #220 instead though. Nothing against covdbg, I just don't want to introduce another service, especially for a one off repo of ours (we normally don't use MSVC).

In any event, I really appreciate being notified that OpenCppCoverage was archived.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants