Open CzBuCHi opened 7 months ago
I had the same issue running with no options. I'm using 3.11.0 for now.
This looks like a bug with Roslyn compiler judging by the exception and by the fact that V3.12 was released to include the latest version of said libraries.
Looks like an issue with running source generators for razor and/or minimal api
I'm having the same issue where this error popped up running Stryker 3.13.1 with target .net 7.0.404. Stryker 3.11 works, although some tests are failing in Stryker while they work through the CLI.
Here I have the same error
[14:17:12 ERR] An error occurred during the mutation test run
System.AggregateException: One or more errors occurred. (Method not found: 'System.Collections.Generic.IEnumerator1<Microsoft.CodeAnalysis.NodeStateEntry
1<System.ValueTuple2<System.__Canon,System.__Canon>>> Microsoft.CodeAnalysis.NodeStateTable
1.GetEnumerator()'.)
---> System.MissingMethodException: Method not found: 'System.Collections.Generic.IEnumerator1<Microsoft.CodeAnalysis.NodeStateEntry
1<System.ValueTuple2<System.__Canon,System.__Canon>>> Microsoft.CodeAnalysis.NodeStateTable
1.GetEnumerator()'.
at Microsoft.CodeAnalysis.ExternalAccess.RazorCompiler.HostOutputNode1.AppendOutputs(IncrementalExecutionContext context, CancellationToken cancellationToken) at Microsoft.CodeAnalysis.GeneratorDriver.UpdateOutputs(ImmutableArray
1 outputNodes, IncrementalGeneratorOutputKind outputKind, Builder generatorRunStateBuilder, CancellationToken cancellationToken, Builder driverStateBuilder)
at Microsoft.CodeAnalysis.GeneratorDriver.RunGeneratorsCore(Compilation compilation, DiagnosticBag diagnosticsBag, CancellationToken cancellationToken)
at Microsoft.CodeAnalysis.GeneratorDriver.RunGeneratorsAndUpdateCompilation(Compilation compilation, Compilation& outputCompilation, ImmutableArray1& diagnostics, CancellationToken cancellationToken) at Stryker.Core.Compiling.CsharpCompilingProcess.RunSourceGenerators(IAnalyzerResult analyzerResult, Compilation compilation) in /_/src/Stryker.Core/Stryker.Core/Compiling/CsharpCompilingProcess.cs:line 121 at Stryker.Core.Compiling.CsharpCompilingProcess.GetCSharpCompilation(IEnumerable
1 syntaxTrees) in //src/Stryker.Core/Stryker.Core/Compiling/CsharpCompilingProcess.cs:line 160
at Stryker.Core.Compiling.CsharpCompilingProcess.GetSemanticModels(IEnumerable`1 syntaxTrees) in //src/Stryker.Core/Stryker.Core/Compiling/CsharpCompilingProcess.cs:line 103
at Stryker.Core.MutationTest.CsharpMutationProcess.Mutate(MutationTestInput input) in //src/Stryker.Core/Stryker.Core/MutationTest/CsharpMutationProcess.cs:line 59
at Stryker.Core.MutationTest.MutationTestProcess.Mutate() in //src/Stryker.Core/Stryker.Core/MutationTest/MutationTestProcess.cs:line 88
at Stryker.Core.Initialisation.ProjectMutator.MutateProject(StrykerOptions options, MutationTestInput input, IReporter reporters) in /_/src/Stryker.Core/Stryker.Core/Initialisation/ProjectMutator.cs:line 38
at Stryker.Core.Initialisation.ProjectOrchestrator.<>cDisplayClass7_0.2.<ForWorker>b__1(RangeWorker& currentWorker, Int64 timeout, Boolean& replicationDelegateYieldedBeforeCompletion) --- End of stack trace from previous location --- at System.Threading.Tasks.Parallel.<>c__DisplayClass19_0
2.1 action, ParallelOptions options, Boolean stopOnFirstFailure) at System.Threading.Tasks.Parallel.ForWorker[TLocal,TInt](TInt fromInclusive, TInt toExclusive, ParallelOptions parallelOptions, Action
1 body, Action2 bodyWithState, Func
4 bodyWithLocal, Func1 localInit, Action
1 localFinally)
--- End of stack trace from previous location ---
at System.Threading.Tasks.Parallel.ForWorker[TLocal,TInt](TInt fromInclusive, TInt toExclusive, ParallelOptions parallelOptions, Action1 body, Action
2 bodyWithState, Func4 bodyWithLocal, Func
1 localInit, Action1 localFinally) at System.Threading.Tasks.Parallel.ForEachWorker[TSource,TLocal](IEnumerable
1 source, ParallelOptions parallelOptions, Action1 body, Action
2 bodyWithState, Action3 bodyWithStateAndIndex, Func
4 bodyWithStateAndLocal, Func5 bodyWithEverything, Func
1 localInit, Action`1 localFinally)
Running the striker over a .NET 8 blazor with webassembly project
thanks for the report. Your comment led me to realize that the exception occurs while generating the semantic model for the source code. To this day, this information is hardly used by Stryker, so a quick fix could be to simply ignore the exception and move forward without the semantic model
@dupdob at the time when this issue was opened we did not generate the semantic model. Are you referring only to the last comment?
It appears in all stack traces here
I looked through the history and appears I was incorrect, we did in fact add semantic model before this issue was created. Sorry!
no worries. Focusing on the issue: I just realized that we generate the semantic model before any actual compilation attempt. So there is a good chance this will happen even if we skip the semantic model generation step. That being said, my PR from a few weeks ago may fix that. @AndyCC25, which Stryker's version are you using ?
I'm using the version 4.0.3
thanks, so it contains an improvement regarding generators related settings. Which I hoped would fix all existing issues. Clearly, it does not solve this one.
@dupdob any news on this one, there is a plan to fix this issue?
hi @AndyCC25, short answer is no. As in: we do not have a clear plan on how to fix this, but we would like to fix it. until we have a project and/or scenario to reproduce it, the best we can do is shoot in the dark (like the previous fix). Without one, we cannot analyze what causes this: it may be that Stryker generates compilation errors that simply crashes Roslyn (while the C# compiler properly reports the syntax error), it may be that we some compilation symbols or environment variables are missing, it may be a version conflict between Razor SDK and Stryker or some other prerequisite we are not aware of. Is there any chance you can share a small project reproducing the issue?
@dupdob I tried from a scratch project and didn't reproduce the issue, I'm was using blazor with web assembly mode and now in my new project there is no problems, I would probably go and check what is different in my previous project where the issue was happening
Describe the bug when running striker via bash using
dotnet stryker -O "../../StrykerOutput/$test_name" -p "$test_name.csproj" -r html -r json -r progress
command (CWD is test project directory) im getting exception bellowLogs
Expected behavior A clear and concise description of what you expected to happen.
Desktop (please complete the following information):
Additional notes reverting back to 3.11.0 fixed my issue