Skip to content

test(stryker): move stryker-config.json into the test project - #378

Merged
Chris-Wolfgang merged 2 commits into
mainfrom
test/stryker-config-in-test-project
Sep 27, 2026
Merged

Chris-Wolfgang merged 2 commits into
mainfrom
test/stryker-config-in-test-project

Conversation

@Chris-Wolfgang

Copy link
Copy Markdown
Owner

Summary

This fixes the Stryker crash tracked in #281. The earlier diagnosis on that issue (analyzer or test-project Roslyn versions) was wrong. The real cause:

stryker.yaml already runs (cd "$dir" && dotnet stryker) for any tests/**/stryker-config.json. Moving the config into tests/Wolfgang.TryPattern.Tests.Unit/ keeps Stryker out of solution mode, with no workflow change needed. The config now names the project under test (Wolfgang.TryPattern.csproj); the test project is the working directory. Thresholds are unchanged.

docs/MUTATION-TESTING.md has the new local-run command and the corrected crash explanation.

Verification

I ran plain dotnet stryker (5.0.0) from tests/Wolfgang.TryPattern.Tests.Unit, which is exactly what the workflow runs:

  • 147 mutants created; 101 killed, 7 survived, 1 without coverage; mutation score 92.66% against break: 60
  • about 1.5 minutes, and no IObjectWritable crash.

The workflow still pins 4.16.0, and I haven't run 4.16.0 locally. The follow-up protected PR pins 5.0.0 (the version verified here) and re-enables the pull_request trigger from #281's acceptance criteria.

Refs #281

🤖 Generated with Claude Code

Run from the repository root, Stryker finds TryPattern.sln, switches to
solution mode and analyses every project, including examples/VB.*.vbproj.
Its Buildalyzer ships an older Microsoft.CodeAnalysis.VisualBasic than the
.NET 10 SDK's Roslyn, so the VB parser's static ctor throws
TypeLoadException: Roslyn.Utilities.IObjectWritable
(stryker-mutator/stryker-net#3666). The crash was never about the
analyzers' Roslyn version.

stryker.yaml already runs `(cd <dir> && dotnet stryker)` for any
tests/**/stryker-config.json, so moving the config there keeps Stryker
out of solution mode. Verified locally with dotnet-stryker 5.0.0:
147 mutants, score 92.66% (break: 60).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Chris-Wolfgang
Chris-Wolfgang merged commit ea875ca into main Sep 27, 2026
24 checks passed
@Chris-Wolfgang
Chris-Wolfgang deleted the test/stryker-config-in-test-project branch September 27, 2026 00:16
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