-
Notifications
You must be signed in to change notification settings - Fork 0
Document mutation-testing workflow contract tests #297
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| # Architectural decision record (ADR) 004: pin-only mutation-testing contract | ||
|
|
||
| ## Status | ||
|
|
||
| Accepted (2026-07-22): Keep Whitaker's mutation-testing adoption pin-only and | ||
| contract-test its declared configuration rather than claiming parity with the | ||
| continuous integration (CI) test baseline. | ||
|
|
||
| ## Date | ||
|
|
||
| 2026-07-22. | ||
|
|
||
| ## Context and problem statement | ||
|
|
||
| Whitaker delegates mutation testing to the shared | ||
| `leynos/shared-actions/.github/workflows/mutation-cargo.yml` workflow. The | ||
| caller supplies workspace paths, exclusion globs, and `--all-features`, but the | ||
| shared workflow cannot reproduce the per-invocation `RUSTFLAGS` used by the | ||
| repository's `test` and `typecheck` Makefile targets. | ||
|
|
||
| Those flags are required by the `whitaker`, `function_attrs_follow_docs`, | ||
| `module_max_lines`, and `no_expect_outside_tests` crates when the | ||
| `dylint-driver` feature enables `feature(rustc_private)`. Applying the flags | ||
| workspace-wide is not viable because, as documented in `.cargo/config.toml`, | ||
| they break `cargo install` for `whitaker-installer`. | ||
|
|
||
| The decision is whether the mutation workflow should claim a workspace baseline | ||
| equivalent to `make test`, or expose the closest safe mutation scope and test | ||
| only that declared configuration. | ||
|
|
||
| ## Decision drivers | ||
|
|
||
| - Keep the mutation workflow usable without breaking installer builds. | ||
| - Describe the mutation scope honestly rather than imply CI parity. | ||
| - Detect accidental caller drift while permitting automated commit-pin updates. | ||
| - Keep mutation testing informational and independent of pull-request gates. | ||
|
|
||
| ## Options considered | ||
|
|
||
| | Option | Shared-workflow feasibility | Mutation coverage | Operational risk | CI-baseline claim / verification | Rationale | | ||
| | ------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------- | | ||
| | A: require full CI-baseline parity | Unsafe and unimplementable: the current shared workflow cannot inject the required flags per crate. | Aims for full workspace coverage equivalent to `make test`. | Applying the flags workspace-wide breaks `cargo install` for `whitaker-installer`. | Would claim parity, but cannot verify it through the shared workflow. | Missing per-crate flags make this option unsafe and unimplementable. | | ||
| | B: exclude every crate that needs dynamic-linking flags | Runs reliably with the shared workflow by removing the affected crates. | Omits important production code, making the reported scope less useful. | Lower run risk, but accepts the risk of untested affected crates. | Makes no full-baseline claim; verification covers only the reduced scope. | Reliable execution deliberately omits important affected crates. | | ||
| | C: adopt a pin-only declared-configuration contract | Closest safe approximation supported by the shared workflow. | Retains useful informational coverage without claiming full workspace coverage. | Keeps mutation testing informational and independent of pull-request gates. | Verifies the caller's declared security and configuration shape, not a full workspace assertion. | A declared-shape contract is the closest safe approximation, not full workspace parity. | | ||
|
|
||
| _Table 1: Comparison of mutation-testing options._ | ||
|
|
||
| ## Decision outcome / proposed direction | ||
|
|
||
| Adopt Option C. | ||
|
|
||
| In the context of shared mutation testing, facing incompatible per-crate | ||
| compiler-flag requirements, Whitaker chooses a pin-only declared-configuration | ||
| contract over either claimed CI parity or excluding every affected crate, to | ||
| retain useful informational mutation coverage while accepting that the run | ||
| cannot reproduce `make test` crate-for-crate. | ||
|
|
||
| The caller remains pinned to a full commit SHA. Its contract test validates the | ||
| pin shape, permissions, concurrency, triggers, and declared inputs. It does not | ||
| hard-code the pin value or assert successful full-workspace mutation testing. | ||
|
|
||
| ## Known risks and limitations | ||
|
|
||
| - Mutation results do not certify the same crate scope as `make test`. | ||
| - Crates needing the dynamic-linking flags may fail or provide incomplete | ||
| mutation results under the shared workflow. | ||
| - The decision must be revisited if the shared workflow gains a safe per-crate | ||
| mechanism for supplying the required flags. |
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.