Skip to content

ci: report test coverage for every Rust crate and the TypeScript SDK - #333

Merged
PiquelChips merged 2 commits into
mainfrom
ci/coverage
Nov 4, 2026
Merged

PiquelChips merged 2 commits into
mainfrom
ci/coverage

Conversation

@PiquelChips

@PiquelChips PiquelChips commented Nov 4, 2026 •

Copy link
Copy Markdown
Member

Nothing measured how much of the code our tests exercise. Now CI reports it on every run, for Rust and for the TypeScript SDK. It only reports: no thresholds, no external service.

  • Rust: the rust job runs its unit and database tests through cargo-llvm-cov with a new just coverage recipe, in place of just test --workspace --run-ignored all, so the tests still run once. The job log gets a line and function summary per crate, and lcov.info is uploaded as the rust-coverage artifact. just db prepare-check still runs right after, against the database those tests migrated. Doc tests stay a separate step. cargo-llvm-cov comes from taiki-e/install-action, like nextest and just, and adds the llvm-tools-preview component itself, so rust-toolchain.toml stays as it is.
  • Locally: just coverage runs in a scratch cluster, as just db test does, and cargo llvm-cov report --html renders the result. just install-tools now installs cargo-llvm-cov.
  • TypeScript: packages/auth's node --test run gets --experimental-test-coverage, which is still the flag's name in Node 24 (CI's version). Test files are excluded from the report, so just web test prints line, branch and function coverage of src/ only.

Current coverage

From this PR's CI run (all 418 tests, database tests included).

Crate Lines Functions
apps/auth-service 81.22% of 16189 77.50% of 2133
apps/web 78.44% of 320 62.96% of 54
crates/auth-sdk 86.01% of 2573 85.01% of 407
crates/common 91.32% of 1716 91.24% of 274
crates/crypto 99.07% of 643 100.00% of 94
crates/database 94.20% of 3377 96.39% of 581
crates/telemetry 68.85% of 488 74.67% of 75
crates/ui 83.92% of 5616 64.87% of 780
Rust workspace 84.23% of 30922 79.56% of 4398
Package Lines Branches Functions
@piquel/auth 96.92% 87.51% 97.34%

CI time

The rust job took 4m34s on this PR, against 3m40s–4m10s on main's last four runs, so about +30–55s:

Step main this PR
just test --workspace --run-ignored all → just coverage 1m45s 2m56s
just doc-test 39s 31s

That run built the instrumented tree from scratch, since main's cache has no target/llvm-cov-target yet. Once main saves a cache with it, the build should shrink, but rust-cache now stores two target trees, so restores get somewhat bigger. just doc-test now builds the workspace's debug libraries itself, which the old test step used to leave behind. The web job's test step went from 3s to 4s.

Proof: just coverage ran locally against a scratch cluster and in this PR's CI against its PostgreSQL. Both runs passed all 418 tests and printed the table above. just db prepare-check passed after it in CI. The per-crate awk was also checked under mawk, the default awk on Ubuntu runners.

Reviewed with review-loop: 1 round with 2× GPT 6.1 Sol and Claude Opus 5.5. Verdict: approved

Note

Written by Claude Opus 5.5 in Claude Code and reviewed by GPT 6.1 Sol and Claude Opus 5.5 (via T3 Code)

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 12 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c7c375ba-92b2-430d-874e-7cf83540ad9e
Commits

Reviewing files that changed from the base of the PR and between 33a3ced and 875e631.

Files selected for processing: 5
  • .github/workflows/ci.yml
  • README.md
  • just/web.just
  • justfile
  • packages/auth/package.json
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@PiquelChips PiquelChips self-assigned this Nov 4, 2026
@PiquelChips PiquelChips added enhancement New feature or request ci-cd CI-CD labels Nov 4, 2026
@PiquelChips PiquelChips added this to the 0.1 milestone Nov 4, 2026
@github-project-automation github-project-automation Bot moved this to Needs Triage in sourceorigin.dev Nov 4, 2026
@PiquelChips PiquelChips moved this from Needs Triage to In Progress in sourceorigin.dev Nov 4, 2026
The rust job runs its unit and database tests through cargo-llvm-cov
with `just coverage`, printing line and function coverage per crate and
uploading lcov.info. The TypeScript SDK's tests print Node's coverage.
Nothing fails on coverage yet.
@PiquelChips
PiquelChips enabled auto-merge (squash) November 4, 2026 14:00
@PiquelChips
PiquelChips merged commit 0fb8397 into main Nov 4, 2026
9 checks passed
@PiquelChips
PiquelChips deleted the ci/coverage branch November 4, 2026 14:09
@github-project-automation github-project-automation Bot moved this from In Progress to Done in sourceorigin.dev Nov 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-cd CI-CD enhancement New feature or request

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant