Closed Dirk-Peters-BF closed 1 month ago
Thanks for reporting. I am working on a fix. Actually, the fix is simple, but I want to activate logging for unit tests to ensure there are no similar issues
As mentioned in the ticket, I am actually working on a fix myself but I am including other, similar logging calls. Not necessarily as severe but nevertheless not quite right. My Problem for the described problem is to reproduce outside of the original sources.
Ok There is a unit test for this situation. Alas, it does not crash as logging is not enabled, so string formatting is simply skipped. So no exception
Envoyé de mon iPhoneLe 2 mai 2024 à 18:06, Dirk-Peters-BF @.***> a écrit : As mentioned in the ticket, I am actually working on a fix myself but I am including other, similar logging calls. Not necessarily as severe but nevertheless not quite right. My Problem for the described problem is to reproduce outside of the original sources.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were assigned.Message ID: @.***>
The opened pull request contains the fix + some logging call harmonizing Since I touched a lot of files for this I'd understand if the pull request is rejected.
Describe the bug Stryker run is aborted due to crash when a specific logging call in
VsTestRunner.InitialTest
Line 60 is used, when a new unexpected test case is detected in the intial test run.Logs System.FormatException: Input string was not in a correct format. Failure to parse near offset 132. Expected an ASCII digit. 00:02:36 at System.Text.CompositeFormat.Parse(String format) 00:02:36 at Microsoft.Extensions.Logging.LogValuesFormatter..ctor(String format) 00:02:36 at Microsoft.Extensions.Logging.FormattedLogValues.<>c.<.ctor>b90(String f) 00:02:36 at Microsoft.Extensions.Logging.FormattedLogValues..ctor(String format, Object[] values) 00:02:36 at Microsoft.Extensions.Logging.LoggerExtensions.Log(ILogger logger, LogLevel logLevel, EventId eventId, Exception exception, String message, Object[] args) 00:02:36 at Microsoft.Extensions.Logging.LoggerExtensions.Log(ILogger logger, LogLevel logLevel, String message, Object[] args) 00:02:36 at Microsoft.Extensions.Logging.LoggerExtensions.LogWarning(ILogger logger, String message, Object[] args) 00:02:36 at Stryker.Core.TestRunners.VsTest.VsTestRunner.InitialTest(IProjectAndTests project) in //src/Stryker.Core/Stryker.Core/TestRunners/VsTest/VsTestRunner.cs:line 60 00:02:36 at Stryker.Core.TestRunners.VsTest.VsTestRunnerPool.<>cDisplayClass12_0.b_0(VsTestRunner runner) in //src/Stryker.Core/Stryker.Core/TestRunners/VsTest/VsTestRunnerPool.cs:line 62
00:02:36 at Stryker.Core.TestRunners.VsTest.VsTestRunnerPool.RunThis[T](Func
2 task) in /_/src/Stryker.Core/Stryker.Core/TestRunners/VsTest/VsTestRunnerPool.cs:line 103 00:02:36 at Stryker.Core.TestRunners.VsTest.VsTestRunnerPool.InitialTest(IProjectAndTests project) in /_/src/Stryker.Core/Stryker.Core/TestRunners/VsTest/VsTestRunnerPool.cs:line 62 00:02:36 at Stryker.Core.Initialisation.InitialTestProcess.InitialTest(StrykerOptions options, IProjectAndTests project, ITestRunner testRunner) in /_/src/Stryker.Core/Stryker.Core/Initialisation/InitialTestProcess.cs:line 35 00:02:36 at Stryker.Core.Initialisation.InitialisationProcess.InitialTest(StrykerOptions options, SourceProjectInfo projectInfo, ITestRunner testRunner, Boolean throwIfFails) in /_/src/Stryker.Core/Stryker.Core/Initialisation/InitialisationProcess.cs:line 128 00:02:36 at Stryker.Core.Initialisation.InitialisationProcess.GetMutationTestInputs(StrykerOptions options, IReadOnlyCollection
1 projects, ITestRunner runner) in //src/Stryker.Core/Stryker.Core/Initialisation/InitialisationProcess.cs:line 106 00:02:36 at Stryker.Core.Initialisation.ProjectOrchestrator.MutateProjects(StrykerOptions options, IReporter reporters, ITestRunner runner) in //src/Stryker.Core/Stryker.Core/Initialisation/ProjectOrchestrator.cs:line 66 00:02:36 at Stryker.Core.StrykerRunner.RunMutationTest(IStrykerInputs inputs, ILoggerFactory loggerFactory, IProjectOrchestrator projectOrchestrator) in /_/src/Stryker.Core/Stryker.Core/StrykerRunner.cs:line 63Expected behavior Stryker does not crash.
Desktop (please complete the following information):
Additional context Reason for abort is wrong usage of Microsoft Logging. String interpolation is used in conjunction with parameters. I can provide a fix myself, just need a ticket/justification.