Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EnableWindowsTargeting must be set for some projects to build successfully on linux #2938

Closed
mu88 opened this issue May 21, 2024 · 11 comments
Closed
Labels
🐛 Bug Something isn't working

Comments

@mu88
Copy link

mu88 commented May 21, 2024

Describe the bug

We're running Stryker every night on Jenkins for several of our projects. After a couple of successful runs, Stryker crashes with System.IO.FileNotFoundException: MsBuild.exe could not be located.

Logs

Uncollapse me for logs
Running on organization-utility-mutationtesting-master-960-m0lcj-rjz9-vkqdj in /home/jenkins/agent/workspace/s_Utility_MutationTesting_master
  [Pipeline] {
  [Pipeline] stage
  [Pipeline] { (Declarative: Checkout SCM)
  [Pipeline] checkout
  The recommended git tool is: NONE
  using credential dd2405d7-ae48-42cb-a573-c3569b29cbf1
  Cloning the remote Git repository
  Cloning with configured refspecs honoured and without tags
  Cloning repository https://git.company.com/scm/organization/tools.git
   > git init /home/jenkins/agent/workspace/s_Utility_MutationTesting_master # timeout=10
  Fetching upstream changes from https://git.company.com/scm/organization/tools.git
   > git --version # timeout=10
   > git --version # 'git version 2.39.2'
  using GIT_ASKPASS to set credentials git user
   > git fetch --no-tags --force --progress -- https://git.company.com/scm/organization/tools.git +refs/heads/master:refs/remotes/origin/master # timeout=10
  Avoid second fetch
  Checking out Revision ee4c28776db9c1c9cb993fbe3aef6ff0141cf6c5 (master)
   > git config remote.origin.url https://git.company.com/scm/organization/tools.git # timeout=10
   > git config --add remote.origin.fetch +refs/heads/master:refs/remotes/origin/master # timeout=10
   > git config core.sparsecheckout # timeout=10
   > git checkout -f ee4c28776db9c1c9cb993fbe3aef6ff0141cf6c5 # timeout=10
  Commit message: "config: PZS-10446 add mdrb to mutation testing"
   > git rev-list --no-walk ee4c28776db9c1c9cb993fbe3aef6ff0141cf6c5 # timeout=10
  [Pipeline] }
  [Pipeline] // stage
  [Pipeline] withEnv
  [Pipeline] {
  [Pipeline] container
  [Pipeline] {
  [Pipeline] sh
  + /sbin/ip route
  + awk /default/ { print  $3}
  /home/jenkins/agent/workspace/s_Utility_MutationTesting_master@tmp/durable-c87035f7/script.sh.copy: 1: /sbin/ip: not found
  [Pipeline] withEnv
  [Pipeline] {
  [Pipeline] ansiColor
  [Pipeline] {
  
  [Pipeline] timestamps
  [Pipeline] {
  [Pipeline] timeout
08:32:19  Timeout set to expire in 6 hr 0 min
  [Pipeline] {
  [Pipeline] stage
  [Pipeline] { (Prepare workspace)
  [Pipeline] script
  [Pipeline] // script
  [Pipeline] }
  [Pipeline] // stage
  [Pipeline] stage
  [Pipeline] { (Configure NuGet sources)
  [Pipeline] script
  [Pipeline] {
  [Pipeline] sh
08:32:20  + dotnet nuget remove source nuget.org
08:32:21  Package source with Name: nuget.org removed successfully.
08:32:21  + dotnet nuget add source https://artifactory.tools.company.com/artifactory/api/nuget/nuget-virtual
08:32:21  Package source with Name: Package source 1 added successfully.
  [Pipeline] }
  [Pipeline] // script
  [Pipeline] }
  [Pipeline] // stage
  [Pipeline] stage
  [Pipeline] { (Run mutation testing)
  [Pipeline] script
  [Pipeline] {
  [Pipeline] echo
08:32:21  run project-a
  [Pipeline] withCredentials
08:32:21  Masking supported pattern matches of $GIT_PASS
  [Pipeline] {
  [Pipeline] sh
08:32:22  + git clone https://****:****@git.company.com/scm/organization/project-a.git
08:32:22  Cloning into 'project-a'...
  [Pipeline] dir
08:32:24  Running in /home/jenkins/agent/workspace/s_Utility_MutationTesting_master/project-a
  [Pipeline] {
  [Pipeline] fileExists
  [Pipeline] sh
08:32:25  + export NUGET_CERT_REVOCATION_MODE=offline
08:32:25  + dotnet tool install --tool-path ./tools --add-source https://artifactory.tools.company.com/artifactory/api/nuget/nuget-virtual dotnet-stryker
08:32:27  You can invoke the tool using the following command: dotnet-stryker
08:32:27  Tool 'dotnet-stryker' (version '4.0.5') was successfully installed.
  [Pipeline] sh
08:32:28  + ./tools/dotnet-stryker --reporter Html --reporter cleartext --reporter json --mutation-level Complete --output StrykerOutput_ProjectA --config-file stryker-config.json
08:32:28  
08:32:28  �[38;5;11m   _____ _              _               _   _ ______ _______  �[0m
08:32:28  �[38;5;11m  / ____| |            | |             | \ | |  ____|__   __| �[0m
08:32:28  �[38;5;11m | (___ | |_ _ __ _   _| | _____ _ __  |  \| | |__     | |    �[0m
08:32:28  �[38;5;11m  \___ \| __| '__| | | | |/ / _ \ '__| | . ` |  __|    | |    �[0m
08:32:28  �[38;5;11m  ____) | |_| |  | |_| |   <  __/ |    | |\  | |____   | |    �[0m
08:32:28  �[38;5;11m |_____/ \__|_|   \__, |_|\_\___|_| (_)|_| \_|______|  |_|    �[0m
08:32:28  �[38;5;11m                   __/ |                                      �[0m
08:32:28  �[38;5;11m                  |___/                                       �[0m
08:32:28  
08:32:28  
08:32:29  Version: �[38;5;2m4.0.5�[0m
08:32:29  
08:32:29  [06:32:29 INF] Analysis starting.
08:32:29  [06:32:29 INF] Identifying projects to mutate in /home/jenkins/agent/workspace/s_Utility_MutationTesting_master/project-a/Company.ProjectA.sln. This can take a while.
08:32:47  [06:32:47 INF] Found 7 source projects
08:32:47  [06:32:47 INF] Found 2 test projects
08:32:47  [06:32:47 INF] Found project /home/jenkins/agent/workspace/s_Utility_MutationTesting_master/project-a/src/Company.ProjectA.Features/Company.ProjectA.Features.csproj to mutate.
08:32:48  [06:32:48 INF] Analysis complete.
08:32:48  [06:32:48 INF] Building solution Company.ProjectA.sln
08:33:28  [06:33:23 INF] Number of tests found: 3056 for project /home/jenkins/agent/workspace/s_Utility_MutationTesting_master/project-a/src/Company.ProjectA.Features/Company.ProjectA.Features.csproj. Initial test run started.
08:33:36  [06:33:35 WRN] Runner 3: Initial test run encounter an unexpected test case (Company.ProjectA.Tests.Component.Unit.Features.CustomerOrdersCollection.Mapping.LicenseOnlyMappingFixture.Map_ShouldMapBasic_WhenAdditionalMissing(inactiveFrom: 2024-05-23T06:33:23.8657272+00:00)), mutation tests may be inaccurate. Disable coverage analysis if you have doubts.
08:33:36  [06:33:35 WRN] Runner 3: Initial test run encounter an unexpected test case (Company.ProjectA.Tests.Component.Unit.Features.CustomerOrdersCollection.Mapping.LicenseOnlyMappingFixture.Map_ShouldMapBasicAndLog_WhenMultipleSubsystems(inactiveFrom: 2024-05-23T06:33:23.8657272+00:00)), mutation tests may be inaccurate. Disable coverage analysis if you have doubts.
08:33:36  [06:33:35 WRN] Runner 3: Initial test run encounter an unexpected test case (Company.ProjectA.Tests.Component.Unit.Features.CustomerOrdersCollection.Mapping.LicenseOnlyMappingFixture.Map_ShouldMapBasic(inactiveFrom: 2024-05-23T06:33:23.8657272+00:00)), mutation tests may be inaccurate. Disable coverage analysis if you have doubts.
08:33:36  [06:33:35 WRN] Runner 3: Initial test run encounter an unexpected test case (Company.ProjectA.Tests.Component.Unit.Features.CustomerOrdersCollection.Mapping.LicenseOnlyMappingFixture.Map_ShouldMapBasicAndLog_WhenMultipleValidSubsystems(inactiveFrom: 2024-05-23T06:33:23.8657272+00:00)), mutation tests may be inaccurate. Disable coverage analysis if you have doubts.
08:33:36  [06:33:35 WRN] Runner 3: Initial test run encounter an unexpected test case (Company.ProjectA.Tests.Component.Unit.Features.CustomerOrdersCollection.Mapping.LicenseOnlyMappingFixture.Map_ShouldMapBasic_WhenReturnShipmentAndProductCodesMissing(inactiveFrom: 2024-05-23T06:33:23.8657272+00:00)), mutation tests may be inaccurate. Disable coverage analysis if you have doubts.
08:33:36  [06:33:35 WRN] A test is failing. Stryker will continue but outcome will be impacted.
08:33:55  [06:33:55 WRN] Stryker.NET encountered a compile error in /home/jenkins/agent/workspace/s_Utility_MutationTesting_master/project-a/src/Company.ProjectA.Features/MasterDataCollection/Mapping/ArticleMapping.cs (at 18:51) with message: Argument 1: cannot convert from 'double?' to 'double' (Source code: price.Calculation?.GrossAmount ?? (Strykern9enOkW6WjlvbuD.MutantControl.IsActive(2481)?price.Price1 :(Strykern9enOkW6WjlvbuD.MutantControl.IsActive(2480)?0:price.Price1 ?? 0)))
08:33:55  [06:33:55 INF] Safe Mode! Stryker will flag mutations in Map as compile error.
08:34:05  [06:34:05 INF] 5497 mutants created
08:34:05  [06:34:05 INF] Capture mutant coverage using 'CoverageBasedTest' mode.
08:34:18  [06:34:18 WRN] VsTestRunner: Coverage analysis run encountered a unexpected test case (Company.ProjectA.Tests.Component.Unit.Features.CustomerOrdersCollection.Mapping.LicenseOnlyMappingFixture.Map_ShouldMapBasic(inactiveFrom: 2024-05-23T06:34:06.7628928+00:00)), mutation tests may be inaccurate. Disable coverage analysis if you have doubts.
08:34:18  [06:34:18 WRN] VsTestRunner: Coverage analysis run encountered a unexpected test case (Company.ProjectA.Tests.Component.Unit.Features.CustomerOrdersCollection.Mapping.LicenseOnlyMappingFixture.Map_ShouldMapBasic_WhenAdditionalMissing(inactiveFrom: 2024-05-23T06:34:06.7628928+00:00)), mutation tests may be inaccurate. Disable coverage analysis if you have doubts.
08:34:18  [06:34:18 WRN] VsTestRunner: Coverage analysis run encountered a unexpected test case (Company.ProjectA.Tests.Component.Unit.Features.CustomerOrdersCollection.Mapping.LicenseOnlyMappingFixture.Map_ShouldMapBasic_WhenReturnShipmentAndProductCodesMissing(inactiveFrom: 2024-05-23T06:34:06.7628928+00:00)), mutation tests may be inaccurate. Disable coverage analysis if you have doubts.
08:34:18  [06:34:18 WRN] VsTestRunner: Coverage analysis run encountered a unexpected test case (Company.ProjectA.Tests.Component.Unit.Features.CustomerOrdersCollection.Mapping.LicenseOnlyMappingFixture.Map_ShouldMapBasicAndLog_WhenMultipleSubsystems(inactiveFrom: 2024-05-23T06:34:06.7628928+00:00)), mutation tests may be inaccurate. Disable coverage analysis if you have doubts.
08:34:18  [06:34:18 WRN] VsTestRunner: Coverage analysis run encountered a unexpected test case (Company.ProjectA.Tests.Component.Unit.Features.CustomerOrdersCollection.Mapping.LicenseOnlyMappingFixture.Map_ShouldMapBasicAndLog_WhenMultipleValidSubsystems(inactiveFrom: 2024-05-23T06:34:06.7628928+00:00)), mutation tests may be inaccurate. Disable coverage analysis if you have doubts.
08:34:19  �[38;5;14mHint: by passing "--open-report or -o" the report will open automatically and �[0m
08:34:19  �[38;5;14mupdate the report in real-time.�[0m
08:34:19  [06:34:19 INF] 3     mutants got status CompileError. Reason: Could not be injected in code.
08:34:19  [06:34:19 INF] 311   mutants got status CompileError. Reason: Mutant caused compile errors
08:34:19  [06:34:19 INF] 294   mutants got status NoCoverage.   Reason: Not covered by any test.
08:34:19  [06:34:19 INF] 1087  mutants got status Ignored.      Reason: Removed by block already covered filter
08:34:19  [06:34:19 INF] 6     mutants got status Ignored.      Reason: Removed by exclude from code coverage filter
08:34:19  [06:34:19 INF] 1701  total mutants are skipped for the above mentioned reasons
08:34:19  [06:34:19 INF] 3796  total mutants will be tested
08:46:28  
08:46:28  
08:46:28  All mutants have been tested, and your mutation score has been calculated
08:46:28  ╭─────────────────────────────────────────────────────┬──┬───┬────┬─────┬───┬──╮
08:46:28  │ File                                                │  │ # │ #  │  #  │ # │  │
08:46:28  │                                                     │  │ … │ t… │ su… │ … │  │
08:46:28  │                                                     │  │   │    │     │ … │  │
08:46:28  ├─────────────────────────────────────────────────────┼──┼───┼────┼─────┼───┼──┤
08:46:28  │ Many files                                          │  │ 2 │ 67 │ 226 │ 2 │  │
08:46:28  ╰─────────────────────────────────────────────────────┴──┴───┴────┴─────┴───┴──╯
08:46:28  
08:46:28  �[38;5;2mYour json report has been generated at:�[0m
08:46:28  �]8;id=1080510029;file:///home/jenkins/agent/workspace/s_Utility_MutationTesting_master/project-a/StrykerOutput_ProjectA/reports/mutation-report.json�\�[38;5;2m/home/jenkins/agent/workspace/s_Utility_MutationTesting_master/sending-data-deci�[0m�]8;;�\
08:46:28  �]8;id=97088849;file:///home/jenkins/agent/workspace/s_Utility_MutationTesting_master/project-a/StrykerOutput_ProjectA/reports/mutation-report.json�\�[38;5;2msion-manager/StrykerOutput_ProjectA/reports/mutation-report.js�[0m�]8;;�\
08:46:28  �]8;id=182128753;file:///home/jenkins/agent/workspace/s_Utility_MutationTesting_master/project-a/StrykerOutput_ProjectA/reports/mutation-report.json�\�[38;5;2mon�[0m�]8;;�\
08:46:28  
08:46:28  �[38;5;2mYour html report has been generated at:�[0m
08:46:28  �]8;id=36611438;file:///home/jenkins/agent/workspace/s_Utility_MutationTesting_master/project-a/StrykerOutput_ProjectA/reports/mutation-report.html�\�[38;5;2m/home/jenkins/agent/workspace/s_Utility_MutationTesting_master/sending-data-deci�[0m�]8;;�\
08:46:28  �]8;id=717310725;file:///home/jenkins/agent/workspace/s_Utility_MutationTesting_master/project-a/StrykerOutput_ProjectA/reports/mutation-report.html�\�[38;5;2msion-manager/StrykerOutput_ProjectA/reports/mutation-report.ht�[0m�]8;;�\
08:46:28  �]8;id=646140069;file:///home/jenkins/agent/workspace/s_Utility_MutationTesting_master/project-a/StrykerOutput_ProjectA/reports/mutation-report.html�\�[38;5;2mml�[0m�]8;;�\
08:46:28  �[38;5;2mYou can open it in your browser of choice.�[0m
08:46:28  [06:46:18 INF] Time Elapsed 00:13:49.0069610
08:46:28  [06:46:18 INF] The final mutation score is 78.95 %
  [Pipeline] archiveArtifacts
08:46:28  Archiving artifacts
  [Pipeline] }
  [Pipeline] // dir
  [Pipeline] }
  [Pipeline] // withCredentials
  [Pipeline] echo
08:46:42  run project-b
  [Pipeline] withCredentials
08:46:42  Masking supported pattern matches of $GIT_PASS
  [Pipeline] {
  [Pipeline] sh
08:46:43  + git clone https://****:****@git.company.com/scm/organization/project-b.git
08:46:43  Cloning into 'project-b'...
  [Pipeline] dir
08:46:46  Running in /home/jenkins/agent/workspace/s_Utility_MutationTesting_master/project-b
  [Pipeline] {
  [Pipeline] fileExists
  [Pipeline] sh
08:46:47  + export NUGET_CERT_REVOCATION_MODE=offline
08:46:47  + dotnet tool install --tool-path ./tools --add-source https://artifactory.tools.company.com/artifactory/api/nuget/nuget-virtual dotnet-stryker
08:46:50  You can invoke the tool using the following command: dotnet-stryker
08:46:50  Tool 'dotnet-stryker' (version '4.0.5') was successfully installed.
  [Pipeline] sh
08:46:51  + ./tools/dotnet-stryker --reporter Html --reporter cleartext --reporter json --mutation-level Complete --output StrykerOutput_ProjectB --config-file stryker-config.json
08:46:51  
08:46:51  �[38;5;11m   _____ _              _               _   _ ______ _______  �[0m
08:46:51  �[38;5;11m  / ____| |            | |             | \ | |  ____|__   __| �[0m
08:46:51  �[38;5;11m | (___ | |_ _ __ _   _| | _____ _ __  |  \| | |__     | |    �[0m
08:46:51  �[38;5;11m  \___ \| __| '__| | | | |/ / _ \ '__| | . ` |  __|    | |    �[0m
08:46:51  �[38;5;11m  ____) | |_| |  | |_| |   <  __/ |    | |\  | |____   | |    �[0m
08:46:51  �[38;5;11m |_____/ \__|_|   \__, |_|\_\___|_| (_)|_| \_|______|  |_|    �[0m
08:46:51  �[38;5;11m                   __/ |                                      �[0m
08:46:51  �[38;5;11m                  |___/                                       �[0m
08:46:51  
08:46:51  
08:46:51  Version: �[38;5;2m4.0.5�[0m
08:46:51  
08:46:51  [06:46:51 INF] Analysis starting.
08:46:51  [06:46:51 INF] Identifying projects to mutate in /home/jenkins/agent/workspace/s_Utility_MutationTesting_master/project-b/Stryker.sln. This can take a while.
08:47:07  [06:47:05 INF] Found 3 source projects
08:47:07  [06:47:05 INF] Found 1 test projects
08:47:07  [06:47:05 INF] Found project /home/jenkins/agent/workspace/s_Utility_MutationTesting_master/project-b/tests/Company.ProjectB.Tests.Common/Company.ProjectB.Tests.Common.csproj to mutate.
08:47:07  [06:47:06 INF] Found project /home/jenkins/agent/workspace/s_Utility_MutationTesting_master/project-b/src/Company.ProjectB.Core/Company.ProjectB.Core.csproj to mutate.
08:47:07  [06:47:06 INF] Found project /home/jenkins/agent/workspace/s_Utility_MutationTesting_master/project-b/src/Company.ProjectB.Features/Company.ProjectB.Features.csproj to mutate.
08:47:07  [06:47:06 INF] Analysis complete.
08:47:07  [06:47:06 INF] Building solution Stryker.sln
08:47:26  [06:47:23 INF] Number of tests found: 975 for project /home/jenkins/agent/workspace/s_Utility_MutationTesting_master/project-b/tests/Company.ProjectB.Tests.Common/Company.ProjectB.Tests.Common.csproj. Initial test run started.
08:47:31  [06:47:30 INF] Number of tests found: 975 for project /home/jenkins/agent/workspace/s_Utility_MutationTesting_master/project-b/src/Company.ProjectB.Core/Company.ProjectB.Core.csproj. Initial test run started.
08:47:38  [06:47:37 INF] Number of tests found: 975 for project /home/jenkins/agent/workspace/s_Utility_MutationTesting_master/project-b/src/Company.ProjectB.Features/Company.ProjectB.Features.csproj. Initial test run started.
08:47:54  [06:47:52 INF] 2820 mutants created
08:47:54  [06:47:52 INF] Capture mutant coverage using 'CoverageBasedTest' mode.
08:48:16  �[38;5;14mHint: by passing "--open-report or -o" the report will open automatically and �[0m
08:48:16  �[38;5;14mupdate the report in real-time.�[0m
08:48:16  [06:48:14 INF] 8     mutants got status Ignored.      Reason: don't mutate the default as it's only a compiler necessity
08:48:16  [06:48:14 INF] 131   mutants got status CompileError. Reason: Mutant caused compile errors
08:48:16  [06:48:14 INF] 9     mutants got status NoCoverage.   Reason: Not covered by any test.
08:48:16  [06:48:14 INF] 346   mutants got status Ignored.      Reason: Removed by block already covered filter
08:48:16  [06:48:14 INF] 59    mutants got status Ignored.      Reason: Removed by exclude from code coverage filter
08:48:16  [06:48:14 INF] 160   mutants got status Ignored.      Reason: Removed by method filter
08:48:16  [06:48:14 INF] 956   mutants got status Ignored.      Reason: Removed by mutate filter
08:48:16  [06:48:14 INF] 3     mutants got status Ignored.      Reason: replacing LINQ methods "Sum" with "Max" does not make any difference here
08:48:16  [06:48:14 INF] 1     mutants got status Ignored.      Reason: tasks are already finished in the tests
08:48:16  [06:48:14 INF] 1673  total mutants are skipped for the above mentioned reasons
08:48:16  [06:48:14 INF] 1147  total mutants will be tested
08:51:24  
08:51:24  
08:51:24  All mutants have been tested, and your mutation score has been calculated
08:51:24  …
08:51:24  �[38;5;2mYour json report has been generated at:�[0m
08:51:24  �]8;id=1910446148;file:///home/jenkins/agent/workspace/s_Utility_MutationTesting_master/project-b/StrykerOutput_ProjectB/reports/mutation-report.json�\�[38;5;2m/home/jenkins/agent/workspace/s_Utility_MutationTesting_master/delivery-plan-cre�[0m�]8;;�\
08:51:24  �]8;id=1093470812;file:///home/jenkins/agent/workspace/s_Utility_MutationTesting_master/project-b/StrykerOutput_ProjectB/reports/mutation-report.json�\�[38;5;2mator/StrykerOutput_ProjectB/reports/mutation-report.json�[0m�]8;;�\
08:51:24  
08:51:24  �[38;5;2mYour html report has been generated at:�[0m
08:51:24  �]8;id=391828808;file:///home/jenkins/agent/workspace/s_Utility_MutationTesting_master/project-b/StrykerOutput_ProjectB/reports/mutation-report.html�\�[38;5;2m/home/jenkins/agent/workspace/s_Utility_MutationTesting_master/delivery-plan-cre�[0m�]8;;�\
08:51:24  �]8;id=1700196764;file:///home/jenkins/agent/workspace/s_Utility_MutationTesting_master/project-b/StrykerOutput_ProjectB/reports/mutation-report.html�\�[38;5;2mator/StrykerOutput_ProjectB/reports/mutation-report.html�[0m�]8;;�\
08:51:24  �[38;5;2mYou can open it in your browser of choice.�[0m
08:51:24  [06:51:12 INF] Time Elapsed 00:04:20.3612737
08:51:24  [06:51:12 INF] The final mutation score is 95.07 %
  [Pipeline] archiveArtifacts
08:51:24  Archiving artifacts
  [Pipeline] }
  [Pipeline] // dir
  [Pipeline] }
  [Pipeline] // withCredentials
  [Pipeline] echo
08:51:24  run project-c
  [Pipeline] withCredentials
08:51:24  Masking supported pattern matches of $GIT_PASS
  [Pipeline] {
  [Pipeline] sh
08:51:25  + git clone https://****:****@git.company.com/scm/organization/project-c.git
08:51:25  Cloning into 'project-c'...
  [Pipeline] dir
08:51:27  Running in /home/jenkins/agent/workspace/s_Utility_MutationTesting_master/project-c
  [Pipeline] {
  [Pipeline] fileExists
  [Pipeline] sh
08:51:28  + export NUGET_CERT_REVOCATION_MODE=offline
08:51:28  + dotnet tool install --tool-path ./tools --add-source https://artifactory.tools.company.com/artifactory/api/nuget/nuget-virtual dotnet-stryker
08:51:31  You can invoke the tool using the following command: dotnet-stryker
08:51:31  Tool 'dotnet-stryker' (version '4.0.5') was successfully installed.
  [Pipeline] sh
08:51:31  + ./tools/dotnet-stryker --reporter Html --reporter cleartext --reporter json --mutation-level Complete --output StrykerOutput_ProjectC --config-file stryker-config.json
08:51:31  
08:51:31  �[38;5;11m   _____ _              _               _   _ ______ _______  �[0m
08:51:31  �[38;5;11m  / ____| |            | |             | \ | |  ____|__   __| �[0m
08:51:31  �[38;5;11m | (___ | |_ _ __ _   _| | _____ _ __  |  \| | |__     | |    �[0m
08:51:31  �[38;5;11m  \___ \| __| '__| | | | |/ / _ \ '__| | . ` |  __|    | |    �[0m
08:51:31  �[38;5;11m  ____) | |_| |  | |_| |   <  __/ |    | |\  | |____   | |    �[0m
08:51:31  �[38;5;11m |_____/ \__|_|   \__, |_|\_\___|_| (_)|_| \_|______|  |_|    �[0m
08:51:31  �[38;5;11m                   __/ |                                      �[0m
08:51:31  �[38;5;11m                  |___/                                       �[0m
08:51:31  
08:51:31  
08:51:32  Version: �[38;5;2m4.0.5�[0m
08:51:32  
08:51:32  [06:51:32 INF] Analysis starting.
08:51:32  [06:51:32 INF] Identifying projects to mutate in /home/jenkins/agent/workspace/s_Utility_MutationTesting_master/project-c/Company.ProjectC.sln. This can take a while.
08:51:47  [06:51:46 INF] Found 5 source projects
08:51:47  [06:51:46 INF] Found 2 test projects
08:51:47  [06:51:46 INF] Found project /home/jenkins/agent/workspace/s_Utility_MutationTesting_master/project-c/src/Company.ProjectC.Features/Company.ProjectC.Features.csproj to mutate.
08:51:47  [06:51:47 INF] Analysis complete.
08:51:47  [06:51:47 INF] Building solution Company.ProjectC.sln
08:52:06  [06:52:06 WRN] Project '/home/jenkins/agent/workspace/s_Utility_MutationTesting_master/project-c/tests/Company.ProjectC.Tests.SystemIntegration/Company.ProjectC.Tests.SystemIntegration.csproj' did not report any test. This may be because the test adapter package, xunit.runner.visualstudio, failed to deploy. Check if any dependency is missing or there is a version conflict.
08:52:06  [06:52:06 INF] Number of tests found: 906 for project /home/jenkins/agent/workspace/s_Utility_MutationTesting_master/project-c/src/Company.ProjectC.Features/Company.ProjectC.Features.csproj. Initial test run started.
08:52:28  [06:52:26 WRN] 15 tests are failing. Stryker will continue but outcome will be impacted.
08:52:33  [06:52:32 WRN] Stryker.NET encountered a compile error in /home/jenkins/agent/workspace/s_Utility_MutationTesting_master/project-c/src/Company.ProjectC.Features/SortPlan/Queries/SortPlanActivations/SortingProductsBySortPlanActivationIdQuery.cs (at 25:10) with message: Constructor 'SortingProductsBySortPlanActivationIdQuery.SortingProductsBySortPlanActivationIdQuery(int, int?, int?, string?, string?, string?, IReadOnlyCollection<PropertySorting>?)' cannot call itself (Source code: : this(
08:52:33              sortPlanActivationId,
08:52:33  (StrykerD5d23vbEOdxUmRc.MutantControl.IsActive(1991)?            pageSize :(StrykerD5d23vbEOdxUmRc.MutantControl.IsActive(1990)?100:            pageSize ?? 100)),
08:52:33  (StrykerD5d23vbEOdxUmRc.MutantControl.IsActive(1994)?            pageSkip :(StrykerD5d23vbEOdxUmRc.MutantControl.IsActive(1993)?0:            pageSkip ?? 0)),
08:52:33  (StrykerD5d23vbEOdxUmRc.MutantControl.IsActive(1998)?!(            string.IsNullOrWhiteSpace(nameSearchText) ):(StrykerD5d23vbEOdxUmRc.MutantControl.IsActive(1997)?(nameSearchText.Trim()!=""):(StrykerD5d23vbEOdxUmRc.MutantControl.IsActive(1996)?(nameSearchText!=""):(StrykerD5d23vbEOdxUmRc.MutantControl.IsActive(1995)?(nameSearchText!=null):            string.IsNullOrWhiteSpace(nameSearchText) ))))? null : nameSearchText,
08:52:33  (StrykerD5d23vbEOdxUmRc.MutantControl.IsActive(2002)?!(            string.IsNullOrWhiteSpace(outletName) ):(StrykerD5d23vbEOdxUmRc.MutantControl.IsActive(2001)?(outletName.Trim()!=""):(StrykerD5d23vbEOdxUmRc.MutantControl.IsActive(2000)?(outletName!=""):(StrykerD5d23vbEOdxUmRc.MutantControl.IsActive(1999)?(outletName!=null):            string.IsNullOrWhiteSpace(outletName) ))))? null : outletName,
08:52:33              containerPositionName,
08:52:33              propertySortings))
08:52:33  [06:52:32 INF] Safe Mode! Stryker will flag mutations in SortingProductsBySortPlanActivationIdQuery as compile error.
08:52:34  [06:52:34 WRN] Stryker.NET encountered a compile error in /home/jenkins/agent/workspace/s_Utility_MutationTesting_master/project-c/src/Company.ProjectC.Features/SortPlan/Mappers/SortPlanActivationMapper.cs (at 85:13) with message: The type arguments for method 'Enumerable.MaxBy<TSource, TKey>(IEnumerable<TSource>, Func<TSource, TKey>)' cannot be inferred from the usage. Try specifying the type arguments explicitly. (Source code: MaxBy)
08:52:34  [06:52:34 INF] Safe Mode! Stryker will flag mutations in GetLastOperationalChange as compile error.
08:52:34  [06:52:34 WRN] Stryker.NET encountered a compile error in /home/jenkins/agent/workspace/s_Utility_MutationTesting_master/project-c/src/Company.ProjectC.Features/SortPlan/Queries/SortPlanActivations/OperationalChangesBySortPlanActivationIdQueryHandler.cs (at 49:13) with message: The type arguments for method 'Enumerable.OrderByDescending<TSource, TKey>(IEnumerable<TSource>, Func<TSource, TKey>)' cannot be inferred from the usage. Try specifying the type arguments explicitly. (Source code: OrderByDescending)
08:52:34  [06:52:34 INF] Safe Mode! Stryker will flag mutations in ExecuteAsync as compile error.
08:52:34  [06:52:34 WRN] Stryker.NET encountered a compile error in /home/jenkins/agent/workspace/s_Utility_MutationTesting_master/project-c/src/Company.ProjectC.Features/SortPlan/SortingProductAdjusters/AdjustedSortingProductsLoader.cs (at 129:13) with message: The type arguments for method 'Enumerable.OrderBy<TSource, TKey>(IEnumerable<TSource>, Func<TSource, TKey>)' cannot be inferred from the usage. Try specifying the type arguments explicitly. (Source code: OrderBy)
08:52:34  [06:52:34 INF] Safe Mode! Stryker will flag mutations in ApplySortingProductOperationalChangesAsync as compile error.
08:52:36  [06:52:36 INF] 2341 mutants created
08:52:36  [06:52:36 INF] Capture mutant coverage using 'CoverageBasedTest' mode.
08:53:03  �[38;5;14mHint: by passing "--open-report or -o" the report will open automatically and �[0m
08:53:03  �[38;5;14mupdate the report in real-time.�[0m
08:53:03  [06:53:00 INF] 137   mutants got status CompileError. Reason: Mutant caused compile errors
08:53:03  [06:53:00 INF] 34    mutants got status NoCoverage.   Reason: Not covered by any test.
08:53:03  [06:53:00 INF] 477   mutants got status Ignored.      Reason: Removed by block already covered filter
08:53:03  [06:53:00 INF] 648   total mutants are skipped for the above mentioned reasons
08:53:03  [06:53:00 INF] 1693  total mutants will be tested
09:07:13  
09:07:13  
09:07:13  All mutants have been tested, and your mutation score has been calculated
09:07:13  ╭─────────────────────────────────────────────────────┬──┬───┬────┬─────┬───┬──╮
09:07:13  │ File                                                │  │ # │ #  │  #  │ # │  │
09:07:13  │                                                     │  │ … │ t… │ su… │ … │  │
09:07:13  │                                                     │  │   │    │     │ … │  │
09:07:13  ├─────────────────────────────────────────────────────┼──┼───┼────┼─────┼───┼──┤
09:07:13  │ Many files                                          │  │ 1 │ 13 │ 988 │ 3 │  │
09:07:13  ╰─────────────────────────────────────────────────────┴──┴───┴────┴─────┴───┴──╯
09:07:13  
09:07:13  �[38;5;2mYour json report has been generated at:�[0m
09:07:13  �]8;id=1774561541;file:///home/jenkins/agent/workspace/s_Utility_MutationTesting_master/project-c/StrykerOutput_ProjectC/reports/mutation-report.json�\�[38;5;2m/home/jenkins/agent/workspace/s_Utility_MutationTesting_master/sorting-decision-�[0m�]8;;�\
09:07:13  �]8;id=1953260670;file:///home/jenkins/agent/workspace/s_Utility_MutationTesting_master/project-c/StrykerOutput_ProjectC/reports/mutation-report.json�\�[38;5;2msystem-configurator/StrykerOutput_ProjectC/reports/muta�[0m�]8;;�\
09:07:13  �]8;id=1124838830;file:///home/jenkins/agent/workspace/s_Utility_MutationTesting_master/project-c/StrykerOutput_ProjectC/reports/mutation-report.json�\�[38;5;2mtion-report.json�[0m�]8;;�\
09:07:13  
09:07:13  �[38;5;2mYour html report has been generated at:�[0m
09:07:13  �]8;id=523246822;file:///home/jenkins/agent/workspace/s_Utility_MutationTesting_master/project-c/StrykerOutput_ProjectC/reports/mutation-report.html�\�[38;5;2m/home/jenkins/agent/workspace/s_Utility_MutationTesting_master/sorting-decision-�[0m�]8;;�\
09:07:13  �]8;id=661357968;file:///home/jenkins/agent/workspace/s_Utility_MutationTesting_master/project-c/StrykerOutput_ProjectC/reports/mutation-report.html�\�[38;5;2msystem-configurator/StrykerOutput_ProjectC/reports/muta�[0m�]8;;�\
09:07:13  �]8;id=1540744586;file:///home/jenkins/agent/workspace/s_Utility_MutationTesting_master/project-c/StrykerOutput_ProjectC/reports/mutation-report.html�\�[38;5;2mtion-report.html�[0m�]8;;�\
09:07:13  �[38;5;2mYou can open it in your browser of choice.�[0m
09:07:13  [07:07:05 INF] Time Elapsed 00:15:33.8051610
09:07:13  [07:07:05 INF] The final mutation score is 78.34 %
  [Pipeline] archiveArtifacts
09:07:13  Archiving artifacts
  [Pipeline] }
  [Pipeline] // dir
  [Pipeline] }
  [Pipeline] // withCredentials
  [Pipeline] echo
09:07:15  run project-d
  [Pipeline] withCredentials
09:07:15  Masking supported pattern matches of $GIT_PASS
  [Pipeline] {
  [Pipeline] sh
09:07:16  + git clone https://****:****@git.company.com/scm/organization/project-d.git
09:07:16  Cloning into 'project-d'...
  [Pipeline] dir
09:07:23  Running in /home/jenkins/agent/workspace/s_Utility_MutationTesting_master/project-d
  [Pipeline] {
  [Pipeline] fileExists
  [Pipeline] sh
09:07:23  + export NUGET_CERT_REVOCATION_MODE=offline
09:07:23  + dotnet tool install --tool-path ./tools --add-source https://artifactory.tools.company.com/artifactory/api/nuget/nuget-virtual dotnet-stryker
09:07:28  You can invoke the tool using the following command: dotnet-stryker
09:07:28  Tool 'dotnet-stryker' (version '4.0.5') was successfully installed.
  [Pipeline] sh
09:07:28  + ./tools/dotnet-stryker --reporter Html --reporter cleartext --reporter json --mutation-level Complete --output StrykerOutput_ProjectD --config-file stryker-config.json
09:07:28  
09:07:28  �[38;5;11m   _____ _              _               _   _ ______ _______  �[0m
09:07:28  �[38;5;11m  / ____| |            | |             | \ | |  ____|__   __| �[0m
09:07:28  �[38;5;11m | (___ | |_ _ __ _   _| | _____ _ __  |  \| | |__     | |    �[0m
09:07:28  �[38;5;11m  \___ \| __| '__| | | | |/ / _ \ '__| | . ` |  __|    | |    �[0m
09:07:28  �[38;5;11m  ____) | |_| |  | |_| |   <  __/ |    | |\  | |____   | |    �[0m
09:07:28  �[38;5;11m |_____/ \__|_|   \__, |_|\_\___|_| (_)|_| \_|______|  |_|    �[0m
09:07:28  �[38;5;11m                   __/ |                                      �[0m
09:07:28  �[38;5;11m                  |___/                                       �[0m
09:07:28  
09:07:28  
09:07:29  Version: �[38;5;2m4.0.5�[0m
09:07:29  
09:07:29  [07:07:29 INF] Analysis starting.
09:07:29  [07:07:29 INF] Identifying projects to mutate in /home/jenkins/agent/workspace/s_Utility_MutationTesting_master/project-d/Company.ProjectD.sln. This can take a while.
09:07:41  [07:07:41 INF] Found 5 source projects
09:07:41  [07:07:41 INF] Found 2 test projects
09:07:41  [07:07:41 INF] Found project /home/jenkins/agent/workspace/s_Utility_MutationTesting_master/project-d/src/Company.ProjectD.Features/Company.ProjectD.Features.csproj to mutate.
09:07:41  [07:07:41 INF] Found project /home/jenkins/agent/workspace/s_Utility_MutationTesting_master/project-d/src/Company.ProjectD.Features.PDFLabels/Company.ProjectD.Features.PDFLabels.csproj to mutate.
09:07:41  [07:07:41 INF] Analysis complete.
09:07:41  [07:07:41 INF] Building solution Company.ProjectD.sln
09:07:43  [07:07:42 WRN] Dotnet build failed, trying with MsBuild.
09:07:43  [07:07:42 INF] Unable to find msbuild using vswhere, using fallback locations
09:07:43  [07:07:42 ERR] An error occurred during the mutation test run 
09:07:43  System.IO.FileNotFoundException: MsBuild.exe could not be located. If you have MsBuild.exe available but still see this error please create an issue.
09:07:43     at Stryker.Core.ToolHelpers.MsBuildHelper.GetMsBuildPath(IProcessExecutor processExecutor)
09:07:43     at Stryker.Core.Initialisation.InitialBuildProcess.BuildSolutionWithMsBuild(String& solutionPath, String& msbuildPath)
09:07:43     at Stryker.Core.Initialisation.InitialBuildProcess.InitialBuild(Boolean fullFramework, String projectPath, String solutionPath, String msbuildPath)
09:07:43     at Stryker.Core.Initialisation.InitialisationProcess.BuildProjects(StrykerOptions options, IEnumerable`1 projects)
09:07:43     at Stryker.Core.Initialisation.ProjectOrchestrator.MutateProjects(StrykerOptions options, IReporter reporters, ITestRunner runner)
09:07:43     at Stryker.Core.StrykerRunner.RunMutationTest(IStrykerInputs inputs, ILoggerFactory loggerFactory, IProjectOrchestrator projectOrchestrator)
09:07:43  [07:07:42 INF] Time Elapsed 00:00:13.8771411
09:07:43  Unhandled exception. System.IO.FileNotFoundException: MsBuild.exe could not be located. If you have MsBuild.exe available but still see this error please create an issue.
09:07:43     at Stryker.Core.ToolHelpers.MsBuildHelper.GetMsBuildPath(IProcessExecutor processExecutor)
09:07:43     at Stryker.Core.Initialisation.InitialBuildProcess.BuildSolutionWithMsBuild(String& solutionPath, String& msbuildPath)
09:07:43     at Stryker.Core.Initialisation.InitialBuildProcess.InitialBuild(Boolean fullFramework, String projectPath, String solutionPath, String msbuildPath)
09:07:43     at Stryker.Core.Initialisation.InitialisationProcess.BuildProjects(StrykerOptions options, IEnumerable`1 projects)
09:07:43     at Stryker.Core.Initialisation.ProjectOrchestrator.MutateProjects(StrykerOptions options, IReporter reporters, ITestRunner runner)
09:07:43     at Stryker.Core.StrykerRunner.RunMutationTest(IStrykerInputs inputs, ILoggerFactory loggerFactory, IProjectOrchestrator projectOrchestrator)
09:07:43     at Stryker.CLI.StrykerCli.RunStryker(IStrykerInputs inputs) in /_/src/Stryker.CLI/Stryker.CLI/StrykerCLI.cs:line 102
09:07:43     at Stryker.CLI.StrykerCli.<>c__DisplayClass11_0.<Run>b__0() in /_/src/Stryker.CLI/Stryker.CLI/StrykerCLI.cs:line 74
09:07:43     at McMaster.Extensions.CommandLineUtils.CommandLineApplication.<>c__DisplayClass143_0.<OnExecute>b__0(CancellationToken _)
09:07:43     at McMaster.Extensions.CommandLineUtils.CommandLineApplication.ExecuteAsync(String[] args, CancellationToken cancellationToken)
09:07:43     at McMaster.Extensions.CommandLineUtils.CommandLineApplication.Execute(String[] args)
09:07:43     at Stryker.CLI.StrykerCli.Run(String[] args) in /_/src/Stryker.CLI/Stryker.CLI/StrykerCLI.cs:line 80
09:07:43     at Stryker.CLI.Program.Main(String[] args) in /_/src/Stryker.CLI/Stryker.CLI/Program.cs:line 14
09:07:43  Aborted (core dumped)
  [Pipeline] echo
09:07:43  �[31m Dotnet Tool Runner: script returned exit code 134
09:07:43  [org.jenkinsci.plugins.workflow.steps.durable_task.DurableTaskStep$Execution.handleExit(DurableTaskStep.java:668), org.jenkinsci.plugins.workflow.steps.durable_task.DurableTaskStep$Execution.check(DurableTaskStep.java:614), org.jenkinsci.plugins.workflow.steps.durable_task.DurableTaskStep$Execution.run(DurableTaskStep.java:555), java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source), java.base/java.util.concurrent.FutureTask.run(Unknown Source), java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source), java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source), java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source), java.base/java.lang.Thread.run(Unknown Source)]�[0m
  [Pipeline] error
  [Pipeline] }
  [Pipeline] // dir
  [Pipeline] }
  [Pipeline] // withCredentials
  [Pipeline] }
  [Pipeline] // script
  [Pipeline] }
  [Pipeline] // stage
  [Pipeline] stage
  [Pipeline] { (Declarative: Post Actions)
  [Pipeline] script
  [Pipeline] {
  [Pipeline] cleanWs
09:07:43  [WS-CLEANUP] Deleting project workspace...
09:07:43  [WS-CLEANUP] Deferred wipeout is used...
09:07:43  [WS-CLEANUP] done
  [Pipeline] }
  [Pipeline] // script
  [Pipeline] }
  [Pipeline] // stage
  [Pipeline] }
  [Pipeline] // timeout
  [Pipeline] }
  [Pipeline] // timestamps
  [Pipeline] }
  
  [Pipeline] // ansiColor
  [Pipeline] }
  [Pipeline] // withEnv
  [Pipeline] }
  [Pipeline] // container
  [Pipeline] }
  [Pipeline] // withEnv
  [Pipeline] }
  [Pipeline] // node
  [Pipeline] }
  [Pipeline] // podTemplate
  [Pipeline] End of Pipeline
  ERROR: script returned exit code 134
  [org.jenkinsci.plugins.workflow.steps.durable_task.DurableTaskStep$Execution.handleExit(DurableTaskStep.java:668), org.jenkinsci.plugins.workflow.steps.durable_task.DurableTaskStep$Execution.check(DurableTaskStep.java:614), org.jenkinsci.plugins.workflow.steps.durable_task.DurableTaskStep$Execution.run(DurableTaskStep.java:555), java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source), java.base/java.util.concurrent.FutureTask.run(Unknown Source), java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source), java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source), java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source), java.base/java.lang.Thread.run(Unknown Source)]
  [Bitbucket] Notifying commit build result
  [Bitbucket] Build result notified
  Finished: FAILURE

Expected behavior

As it does not fail when running the projects individually, it must not fail in this case either.

Desktop (please complete the following information):

  • OS: Linux (CI system Jenkins)
  • Type of project: core (although it's no longer named core)
  • Framework Version: .NET 8
  • Stryker Version: 4.0.5

Additional context

Here's the relevant section from the Jenkinsfile:

#!groovy

def toPascalCase(String input) {
    def words = input.split('-')
    def result = words.collect { it.capitalize() }.join('')
    return result
}

pipeline {
    agent {
        kubernetes {
            // left out for brevity
        }
    }
    options {
        ansiColor('xterm')
        timestamps()
        timeout(time: 6, unit: 'HOURS')
        buildDiscarder(logRotator(numToKeepStr: '10'))
    }
    triggers {
        // Automatic execution temporarily disabled as it became rather flaky with the new version
        // cron('0 22 * * *') // Every day at 22:00
    }
    environment {
        ARTIFACTORY_NUGET_VIRTUAL = 'https://artifactory.tools.company.com/artifactory/api/nuget/nuget-virtual'
        BITBUCKET_PROJECT = "organization"
        WEBHOOK_URL = '<<some URL>>'
        NUGET_CERT_REVOCATION_MODE = 'offline'
        DOCKERHOST = sh(returnStdout: true, script: "/sbin/ip route|awk '/default/ { print  \$3}'").trim()
    }
    stages {
        stage('Prepare workspace') {
            steps {
                script {
                    sh """
                        git config --global user.email '****@company.com'
                        git config --global user.name '****'
                    """
                }
            }
        }
        stage('Configure NuGet sources') {
            steps {
                script {
                    sh """
                        dotnet nuget remove source nuget.org
                        dotnet nuget add source https://artifactory.tools.company.com/artifactory/api/nuget/nuget-virtual
                    """
                }
            }
        }
        stage('Run mutation testing') {
            steps {
                script {
                    repositoryNames = [
                        "project-a",
                        "project-b",
                        "project-c",
                        "project-d",
                        "project-e"
                    ]

                    for (repositoryName in repositoryNames) {
                        applicationName = toPascalCase(repositoryName)

                        echo "run " + repositoryName
                        withCredentials([[$class: 'UsernamePasswordMultiBinding', credentialsId: '****', usernameVariable: 'GIT_USER', passwordVariable: 'GIT_PASS']]) {
                            sh "git clone https://\${GIT_USER}:\${GIT_PASS}@git.company.com/scm/${BITBUCKET_PROJECT}/${repositoryName}.git"
                            dir("${repositoryName}") {
                                reportDirectory = "StrykerOutput_${applicationName}"
                                parameters = "--reporter Html --reporter cleartext --reporter json --mutation-level Complete --output ${reportDirectory}"

                                strykerConfig = "stryker-config.json"
                                strykerConfigFileExists = fileExists strykerConfig
                                if (strykerConfigFileExists) {
                                    parameters += " --config-file ${strykerConfig}"
                                }
                                else {
                                    // TODO: Support testing of features and core project
                                    parameters += " -tp ./tests/Company.${applicationName}.Tests.Component/Company.${applicationName}.Tests.Component.csproj -p Company.${applicationName}.Features"
                                }

                                dotnetToolInstall(toolName: 'dotnet-stryker')
                                dotnetToolRun(toolName: 'dotnet-stryker', parameters: parameters)

                                archiveArtifacts allowEmptyArchive: false, artifacts: "${reportDirectory}/reports/*"
                            }
                        }
                    }
                }
            }
        }
    }
    post {
        failure {
            script {
                office365ConnectorSend(status: 'Failure', webhookUrl: WEBHOOK_URL)
            }
        }
        cleanup {
            script {
                cleanWs()
            }
        }
    }
}
@mu88 mu88 added the 🐛 Bug Something isn't working label May 21, 2024
@dupdob
Copy link
Member

dupdob commented May 21, 2024

hi
do you have a (.Net) SDK installed on this machine ? Stryker needs a complete build environment to run.
For some reason, dotnet build solution.sln failed so Stryker tried to use MsBuild instead.
But it failed to find any instance of it, so it simply failed.
I am not use Stryker invokes MsBuild properly on Linux; this logic was intended for old Desktop framework/net classic (or whatever it is called these days).
The main question is why dotnet build failed. Sadly, Stryker does not currently provide details for this step

@mu88
Copy link
Author

mu88 commented May 21, 2024

Thx for your reply.

Yes, the .NET SDK is installed on this machine. If that wouldn't be the case, it should already fail on the very first run (i. e. project-a), shouldn't it?

@dupdob
Copy link
Member

dupdob commented May 21, 2024

I am not sure single project would fail: they could pass if they are light enough.
I just updated my PR to improve on logging for such a situation and use 'dotnet msbuild' on Linux (instead of MsBuild.Exe).
It will at least provide details on why dotnet build fails.
Could try running dotnet build on the solution and see what happens?

@mu88
Copy link
Author

mu88 commented May 21, 2024

That was a good guess, man 💪🏻 running dotnet build ProjectD.sln fails with the following error:

/usr/share/dotnet/sdk/8.0.300/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(90,5): error NETSDK1100: To build a project targeting Windows on this operating system, set the EnableWindowsTargeting property to true. [/home/jenkins/agent/workspace/s_Utility_MutationTesting_master/project-d/src/ProjectD.TestApp/Company.ProjectD.TestApp.csproj]

When changing this to dotnet build ProjectD.sln -p:EnableWindowsTargeting=true, the build succeeds. So the question is: can I somehow pass the MSBuild argument EnableWindowsTargeting to Stryker or do I have to set it in the corresponding Company.ProjectD.TestApp.csproj?

@dupdob
Copy link
Member

dupdob commented May 21, 2024

Thanks, but that's not a guess, it was logged.

09:07:41  [07:07:41 INF] Building solution Company.ProjectD.sln
09:07:43  [07:07:42 WRN] Dotnet build failed, trying with MsBuild.

As of today, there is no way to pass MsBuild properties across Stryker, but you can add the properties in windows targeting projects' csproj files:

<PropertyGroup>
  <EnableWindowsTargeting>true</EnableWindowsTargeting>
</PropertyGroup>

I think it should do the trick

@rouke-broersma
Copy link
Member

rouke-broersma commented May 21, 2024

You can probably set this with a condition Condition=" '$(OS)' != 'Windows_NT' " so it's only set on non-windows operating systems. See: https://stackoverflow.com/questions/43499222/how-to-get-the-current-operating-system-in-msbuild

@mu88
Copy link
Author

mu88 commented May 22, 2024

Thx, I will give it a try and report back

@mu88
Copy link
Author

mu88 commented May 23, 2024

I tried it yesterday multiple times with enabling EnableWindowsTargeting and confirmed that this works. So first of all thank you for your help 💪🏻

However, what I don't understand is the following: I'm using a Stryker config file like this:

{
  "stryker-config": {
    "test-case-filter": "Category=Unit",
    "project": "Company.ProjectD.Features",
    "test-projects": ["tests/Company.ProjectD.Tests.Component/Company.ProjectD.Tests.Component.csproj"]
  }
}

According to the docs, I'm not using Stryker's solution file context, but yet the solution is built by Stryker. When only running dotnet build tests/Company.ProjectD.Tests.Component/Company.ProjectD.Tests.Component.csproj, the necessary projects are built successfully on the Linux host without adding EnableWindowsTargeting. This somehow contradicts what the docs are implying 🤔

@rouke-broersma
Copy link
Member

When you run from a folder containing a solution file, you run in solution mode. Since you're specifying a relative path to your test project and are setting a project name, it does indeed look like you're running in solution mode. The pipeline also makes it seem like you're running in solution mode since you seem to set the working directory to the repository root: dir("${repositoryName}").

@rouke-broersma rouke-broersma changed the title "System.IO.FileNotFoundException: MsBuild.exe could not be located" after several runs EnableWindowsTargeting must be set for some projects to build successfully on linux May 23, 2024
@mu88
Copy link
Author

mu88 commented May 23, 2024

So I have to explicitly dir out of the Solution directory to force Stryker into the solution mode, got it. Thx for the clarification 👍🏻

@rouke-broersma
Copy link
Member

So I have to explicitly dir out of the Solution directory to force Stryker into the solution mode, got it. Thx for the clarification 👍🏻

The primary way stryker determines the execution mode is based on the information available (do we have a solution file, do we have a project file, do we have a test project file). This information can be provided using config but stryker also tries to auto-detect this based on the current working directory. If the current working directory contains a solution file, we automatically run in solution mode. If the current working directory contains a project file we try to determine whether or not this is a test project. If it is a test project, we run in test project mode. Otherwise we run in source project mode. If no solution file or project file is found in the working directory we base the mode to use solely on the configuration provided by the user.

@mu88 mu88 closed this as completed May 29, 2024
rouke-broersma pushed a commit that referenced this issue Jun 7, 2024
Purpose
Improve the project discovery and analysis phase and improve the design of associated classes. Fixes relevant issues along the way

Changes
Project discovery and Solution mode (main changes)
Alignement The general processing is now identical for both modes. The difference is in how individual projects are discovered:
in solution mode, Stryker works with every project of the solution
in project discovery mode, Stryker recursively discovers project, starting with the provide test project(s) and add any project dependencies
Note that other strategies are easy to implement, such as full recursive discovery: testing all projects are referenced (incl. transitively) by a set of test projects.
Project Analysis
Configuration: the user can now specify the desired (project/solution configuration (e.g Release) instead of Stryker peeking the default one.
Multi-target: Stryker respects exact inter project dependencies, including target framework version and target platform
Filtering: SourceProject option works for solution mode too
Platform: Stryker uses the target platform settings (if specified) when running tests.
Resiliency: Stryker retries project analysis when Buildalyzer failed to detect dependency. Stryker considers an analysis as failed if it did not report any source files or any dependencies, disregarding the BuildAlyzer status. MsBuild may report a build as failed if some secondary target fails, on the other hand, BuildAlyzer will report a success while it failed to capture any dependencies.
Logging: Stryker provides MsBuild log for both project and solution mode (with -dev—mode modifier) as well as analysis result details.
Content files: Stryker perform a post build scan of dependencies to identify content files from nugget packages such as ‘MimeTypes’. This is a workaround until BuildAlyzer is able to detect them
CLI
-configuration : new option that allows to specify which configuration to build (Debug, Release…). This should be a solution configuration in ‘solution’ mode.
Misc
compilation phase: compilation stops (and fails) immediately if Stryker is unable to identify any (new) mutation causing errors. Previously it recompiled the same code until the max attempts is reached
initial build: log first build attempt when it fails (Trace level), use dotnet msbuild instead of msbuild.exe on non windows platform
initial build: ensure quotes are applied for space containing path in every situation
Main changes in design
Merged ProjectFileReader class with InputFileSolver as responsibilities were blurry between them.
Added several tests for not yet covered cases
Github issues
fix #2930, fix #2748, fix #2693, fix #2587
related: #2886, #2393, #2077, #2938
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants