Repository navigation
test: restore mutation testing after the .NET 11 GA update - #41
Merged
Merged
Conversation
The nightly Stryker run has failed since the GA update removed LangVersion preview, for two reasons: - Stryker's bundled Roslyn treats unions as a preview feature (CS8652), so the union conversions in src/ broke every mutated build. Library code now builds maybes with an internal Maybe<T>.Of(value) and default (None); CI builds the library as C# 14 to keep it that way. - xUnit's discovery loads every public type of the test assembly; the public JSON model Profile (Maybe fields) loaded DotMaybe before Stryker could resolve the mutated build, crashing every test host. Profile is internal. Also bumps dotnet-stryker to 5.1.0, as in dotResult. Locally: 100 %. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012weRUz3QcTAaQw32ZmQkoK
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.
What
The nightly Stryker run has failed since #35 (.NET 11 GA) removed
<LangVersion>preview</LangVersion>. There were two independent causes; both are fixed here and Stryker gives 100 % locally again (233 killed, 0 survived).src/(CS8652). Stryker's bundled Roslyn still treats unions as a preview feature; withoutLangVersion previewit compiles the library with its own default and every union conversion (return value;,: none) fails to compile. Setting"language-version": "Preview"instryker-config.jsondoes not help: the mutants compile, but its preview unions are not compatible with the GA-built tests at run time. Fix: library code builds maybes with an internalMaybe<T>.Of(value)(delegates toIUnionMembers.Create) anddefault(None): 40 mechanical changes in 9 files, no behavior or public API change. A new last step of the Linux CI job builds the library as C# 14, which reports exactly the code Stryker cannot compile (same check as ci: check the library builds without union conversions dotResult#86).GetExportedTypes()on the test assembly; the public JSON modelProfilehasMaybe<…>fields, so loading it loads DotMaybe before Stryker's runner can resolve the mutated build. Every test host crashed withFileNotFoundException: DotMaybe, Version=2.0.0.0, and Stryker reported "unable to calculate a mutation score". Fix:Profileisinternal.Also bumps
dotnet-stryker5.0.0 → 5.1.0, the version dotResult uses (not the fix on its own: verified that 5.1.0 alone still crashed).test:rather thanfix:/refactor:: nothing changes for users, so no release.Checklist
dotnet test --solution dotMaybe.slnxis green locally (357 properties + 62 contracts, Release)🤖 Generated with Claude Code
https://claude.ai/code/session_012weRUz3QcTAaQw32ZmQkoK