Skip to content

ci: ignore linq mutator in stryker config - #611

Closed
samtrion wants to merge 1 commit into
mainfrom
ci/stryker-ignore-linq-mutations
Closed

samtrion wants to merge 1 commit into
mainfrom
ci/stryker-ignore-linq-mutations

Conversation

@samtrion

@samtrion samtrion commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Problem

The latest mutation run created 229 mutants, 52 with status CompileError (23 %). 34 of those come from the Linq mutator (StringBuilder.Append to Prepend: 32, Count() to Sum(): 2).

Root cause

The Linq mutator rewrites StringBuilder.Append and ICollection.Count into LINQ methods that do not compile on those types.

Change

Add "ignore-mutations": ["linq"] inside the stryker-config object of stryker-config.json.

Before / After

Measured run on this branch: https://github.com/dailydevops/fluentvalue/actions/runs/40804529110

metric before after
created mutants 229 229
CompileError 52 52
NoCoverage 5 5
Ignored 41 41
score 77.21 % 77.21 %

Result: the change has no effect, PR set to draft

In dotnet-stryker 5.0.0 the ignore-mutations filter runs after the mutated assembly is compiled, and CsharpMutationProcess.FilterMutants explicitly skips mutants that are already CompileError ("CompileError is a final status and can not be changed during filtering"). All 34 Linq mutants therefore still fail to compile and are still reported as CompileError; no mutant was removed by the "mutation type filter" in the run (the report still lists the 32 Append-to-Prepend and 2 Count-to-Sum Linq mutants as CompileError). The same applies to ignore-methods. There is no Stryker configuration in this version that prevents these compile attempts, so the proposed goal (CompileError 52 to about 18) cannot be reached by configuration.

Risk / what this does not change

Harmless but useless: it would only disable the Linq mutator repo-wide (valid Linq mutants could not appear in future code). Recommend closing this PR.

The Linq mutator produced only compile errors (34 of 52 in the latest run:
Append to Prepend on StringBuilder, Count to Sum on collections). Disabling
it removes those failed compile attempts without losing any valid mutant.
@samtrion
samtrion requested a review from a team as a code owner October 29, 2026 02:07
@samtrion
samtrion requested a review from Spacemonkay October 29, 2026 02:07
@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 98.54%. Comparing base (b5aad10) to head (98a68b8).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #611   +/-   ##
=======================================
  Coverage   98.54%   98.54%           
=======================================
  Files          22       22           
  Lines         274      274           
  Branches       43       43           
=======================================
  Hits          270      270           
  Misses          1        1           
  Partials        3        3           

☔ 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 marked this pull request as draft October 29, 2026 02:14
@samtrion samtrion closed this Oct 29, 2026
@samtrion
samtrion deleted the ci/stryker-ignore-linq-mutations branch October 29, 2026 15:51
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.

1 participant