stryker-mutator / stryker-net

Mutation testing for .NET core and .NET framework!
https://stryker-mutator.io
Apache License 2.0
1.76k stars 175 forks source link

Mutation of source generators did not trigger recompilation #2252

Closed kant2002 closed 1 year ago

kant2002 commented 1 year ago

Describe the bug I run Stryker over Refit, and choose referenced project which represent source generator which is used inside test project, seems to be mutations reported as NoCoverage, even if mutations of line https://github.com/reactiveui/refit/blob/569108a65079d364647f06437f977df8145fc578/InterfaceStubGenerator.Shared/InterfaceStubGenerator.cs#L359 clearly lead to compilation error.

Steps

  1. git clone https://github.com/reactiveui/refit
  2. cd refit/Refit.Tests
  3. dotnet stryker -p InterfaceStubGenerator.Roslyn40.csproj

Expected behavior Probably any mutations in the referenced project which contains source generator, and as such mutations would be discarded as invalid, marking like as covered.

dupdob commented 1 year ago

Indeed, Stryker does not support this type of workflow. Besides the required effort, this would lead to very slow mutation tests (think hours). See issue #1995 to have details and track this issue. Close as duplicate