Skip to content

ci: mutate net6.0 polyfill branches in a separate Stryker run - #852

Merged
samtrion merged 1 commit into
mainfrom
ci/stryker-net6-polyfill-mutation
Nov 4, 2026
Merged

samtrion merged 1 commit into
mainfrom
ci/stryker-net6-polyfill-mutation

Conversation

@samtrion

Copy link
Copy Markdown
Contributor

Problem

Stryker solution mode logs Picking net10.0 for project .../NetEvolve.Arguments.csproj, although the project targets net6.0 to net10.0 plus netstandard2.0 (and net472/48/481 on Windows). The legacy polyfill branches (#if !NET7_0_OR_GREATER, #if !NET8_0_OR_GREATER, ...) compile to nothing on net10.0, so e.g. ObjectDisposedExceptionPolyfills.cs and the legacy parts of ArgumentExceptionPolyfills.cs / ArgumentOutOfRangeExceptionPolyfills.cs report 0 mutants.

Root cause

Only the highest TFM per source project is mutated; the polyfills are empty there by design.

Change

  • New stryker-config.net6.json: target-framework: net6.0, mutates only **/*Polyfills.cs, only the NetEvolve.Arguments.Tests.Unit test project, no dashboard reporter (so the default run's dashboard report is not overwritten).
  • New polyfills job in mutation.yml calling the same shared workflow with that config. The existing net10.0 run is untouched.
  • Expected warning: Stryker logs that it cannot find a net6.0 target for the netstandard2.0-only Analyser project and falls back to its own pick.

Before / After

metric before after
mutants in polyfill files (net10.0 run) 0 for ObjectDisposedExceptionPolyfills.cs, ArgumentNullExceptionPolyfills.cs, legacy branches elsewhere pending
mutants in net6.0 polyfill run n/a pending

Risk / what this does not change

  • Feasibility is the open question: the Stryker docker image is dotnet/sdk:10.0 only, so the net6.0 test host may not launch. The numbers above come from a dispatched run on this branch.
  • net6.0 does not compile the !NET6_0_OR_GREATER code (ArgumentNullExceptionPolyfills.cs, Polyfills/*); that only exists on netstandard2.0/net4x and is not covered here.
  • Adds one extra scheduled job (small, polyfills only).

The default Stryker run picks net10.0, where the legacy polyfill branches
guarded by #if !NET7_0_OR_GREATER / !NET8_0_OR_GREATER compile to nothing,
so they report 0 mutants. Add a second config and workflow job that targets
net6.0 and mutates only the *Polyfills.cs files. The net10.0 run is unchanged.
Comment thread .github/workflows/mutation.yml Resolved
@codecov

codecov Bot commented Oct 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.75%. Comparing base (b49a9f3) to head (9cb16af).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #852   +/-   ##
=======================================
  Coverage   90.75%   90.75%           
=======================================
  Files          39       39           
  Lines        2185     2185           
  Branches      381      381           
=======================================
  Hits         1983     1983           
  Misses        121      121           
  Partials       81       81           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@samtrion
samtrion merged commit 1a8468c into main Nov 4, 2026
15 checks passed
@samtrion
samtrion deleted the ci/stryker-net6-polyfill-mutation branch November 4, 2026 00:27
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.

2 participants