fix(nx-ci): coverage=true still runs test on every affected project#22
Merged
AndriiTsok merged 1 commit intomainfrom Apr 18, 2026
Merged
Conversation
Previously when `coverage: true`, the workflow REPLACED the `test` target with `test:coverage`. That meant only projects with a `test:coverage` target got tested at all — everything else was silently skipped. In the MCPG workspace that's catastrophic: 27 of 28 Rust crates have `test` but no `test:coverage`, so CI was effectively only running the main app's tests. Plugins, libraries, and the other app were not being exercised at all when coverage was enabled. Fix: when coverage is on, run BOTH `-t test,test:coverage`. Nx gracefully skips projects that don't define the target, so only projects with a dedicated coverage runner (e.g. cargo-llvm-cov) run the instrumented pass. Everything else still gets a plain test run. Projects that define both (like apps/mcpg) will run their tests twice — once plain, once instrumented. That's fine: tests are fast vs compile time, and the duplication is only on projects that opted into both. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This was referenced Apr 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug
When
coverage: true, the workflow REPLACED-t testwith-t test:coveragein the Run tests step. That silently skipped every project without a dedicatedtest:coveragetarget.Impact on MCPG consumer: 27 of 28 Rust crates were not being tested at all in CI — only
apps/mcpg(which definedtest:coverage) ran anything. Plugins, libs, and the secondary app never executed their test suites.Fix
Run both targets comma-separated:
Nx gracefully skips projects that don't define a target. Projects with both (e.g.
apps/mcpg) run tests twice — once plain, once instrumented — which is fast relative to compile time.Verification
@monodon/rustdoes NOT auto-generatetestorbuildtargets; it only provides executors + dep graph +nx-release-publish. So the manualnx:run-commandstesttargets in consumer project.json files are the canonical test path — we just weren't running them when coverage was on.🤖 Generated with Claude Code