diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index bb3c9bced7..11e200e957 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -8,13 +8,6 @@ "dotnet-coverage" ], "rollForward": false - }, - "dotnet-stryker": { - "version": "4.16.0", - "commands": [ - "dotnet-stryker" - ], - "rollForward": false } } } diff --git a/.config/stryker/NuGet.config b/.config/stryker/NuGet.config new file mode 100644 index 0000000000..64251b5b9c --- /dev/null +++ b/.config/stryker/NuGet.config @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/.config/stryker/dotnet-tools.json b/.config/stryker/dotnet-tools.json new file mode 100644 index 0000000000..6da5949fda --- /dev/null +++ b/.config/stryker/dotnet-tools.json @@ -0,0 +1,13 @@ +{ + "version": 1, + "isRoot": true, + "tools": { + "dotnet-stryker": { + "version": "5.0.0", + "commands": [ + "dotnet-stryker" + ], + "rollForward": false + } + } +} diff --git a/.github/workflows/mutation-test-improver.lock.yml b/.github/workflows/mutation-test-improver.lock.yml index eaa6007cab..a369b443ad 100644 --- a/.github/workflows/mutation-test-improver.lock.yml +++ b/.github/workflows/mutation-test-improver.lock.yml @@ -1,4 +1,4 @@ -# gh-aw-metadata: {"schema_version":"v4","frontmatter_hash":"32929f6a8a156bee957e068efd4dc5750ff1a4d3626e2a39e157f0e784bcbfc5","body_hash":"6c99ecafe31af8d15bfdfff93ce62b2844c59154fe96dbceeb65936a4119a0e8","compiler_version":"v0.86.2","strict":true,"agent_id":"copilot","detection_agent_id":"copilot","detection_agent_model":"detection","engine_versions":{"copilot":"1.0.79"}} +# gh-aw-metadata: {"schema_version":"v4","frontmatter_hash":"1d0c96cd81876d9bdb4869feb9b4bfb6b95423b3ba25a88daa6d3448e6bd51fe","body_hash":"9ac4b8542bbf7010cffac48dca1a6bee7052ae5d974454c8452b5bf2f17bcab8","compiler_version":"v0.86.2","strict":true,"agent_id":"copilot","detection_agent_id":"copilot","detection_agent_model":"detection","engine_versions":{"copilot":"1.0.79"}} # gh-aw-manifest: {"version":1,"secrets":["GH_AW_CI_TRIGGER_TOKEN","GH_AW_GITHUB_MCP_SERVER_TOKEN","GH_AW_GITHUB_TOKEN","GITHUB_TOKEN"],"actions":[{"repo":"actions/cache/restore","sha":"55cc8345863c7cc4c66a329aec7e433d2d1c52a9","version":"v6.1.0"},{"repo":"actions/cache/save","sha":"55cc8345863c7cc4c66a329aec7e433d2d1c52a9","version":"v6.1.0"},{"repo":"actions/checkout","sha":"3d3c42e5aac5ba805825da76410c181273ba90b1","version":"v7.0.1"},{"repo":"actions/download-artifact","sha":"3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c","version":"v8.0.1"},{"repo":"actions/github-script","sha":"3a2844b7e9c422d3c10d287c895573f7108da1b3","version":"v9.0.0"},{"repo":"actions/setup-node","sha":"820762786026740c76f36085b0efc47a31fe5020","version":"v7.0.0"},{"repo":"actions/upload-artifact","sha":"043fb46d1a93c77aae656e7c1c64a875d1fc6a0a","version":"v7.0.1"},{"repo":"github/gh-aw-actions/setup","sha":"6aab9e5b5c91c615506061f09bedd81a23babe3c","version":"v0.86.2"}],"containers":[{"image":"ghcr.io/github/gh-aw-firewall/agent:0.27.44","digest":"sha256:0d727725c737b58c7bdf51f640cffb928385ec46517e0917c7f1a02f1bada8b4","pinned_image":"ghcr.io/github/gh-aw-firewall/agent:0.27.44@sha256:0d727725c737b58c7bdf51f640cffb928385ec46517e0917c7f1a02f1bada8b4"},{"image":"ghcr.io/github/gh-aw-firewall/api-proxy:0.27.44","digest":"sha256:b50fbadba138f6e9aba94aca09711335c489bb3b15861220cb66f6092e042dc7","pinned_image":"ghcr.io/github/gh-aw-firewall/api-proxy:0.27.44@sha256:b50fbadba138f6e9aba94aca09711335c489bb3b15861220cb66f6092e042dc7"},{"image":"ghcr.io/github/gh-aw-firewall/squid:0.27.44","digest":"sha256:83e48bbe12c634be8c228a576832fe45f66c529ac3659db92bddbcf2eeb6d627","pinned_image":"ghcr.io/github/gh-aw-firewall/squid:0.27.44@sha256:83e48bbe12c634be8c228a576832fe45f66c529ac3659db92bddbcf2eeb6d627"},{"image":"ghcr.io/github/gh-aw-mcpg:v0.4.9","digest":"sha256:e5a1569aeaf41820fa7bdee3e94468cae448133cdbf00119ad24f5b74db1ab9f","pinned_image":"ghcr.io/github/gh-aw-mcpg:v0.4.9@sha256:e5a1569aeaf41820fa7bdee3e94468cae448133cdbf00119ad24f5b74db1ab9f"},{"image":"ghcr.io/github/gh-aw-node","digest":"sha256:0d9f1fb5fd6610c0ac1f5194a38e45a8a1e81f8a390d5142d8e4e6f26a4b3196","pinned_image":"ghcr.io/github/gh-aw-node@sha256:0d9f1fb5fd6610c0ac1f5194a38e45a8a1e81f8a390d5142d8e4e6f26a4b3196"},{"image":"ghcr.io/github/github-mcp-server:v1.9.0","digest":"sha256:881b53d6f75f69bdbc1b5b10fc2f1361717c19054143b3a8529fb5c32061a50e","pinned_image":"ghcr.io/github/github-mcp-server:v1.9.0@sha256:881b53d6f75f69bdbc1b5b10fc2f1361717c19054143b3a8529fb5c32061a50e"}]} # This file was automatically generated by gh-aw (v0.86.2). DO NOT EDIT. To debug this workflow, load the skill at https://github.com/github/gh-aw/blob/main/debug.md # @@ -531,9 +531,9 @@ jobs: mkdir -p "${RUNNER_TEMP}/gh-aw/safeoutputs" mkdir -p /tmp/gh-aw/safeoutputs mkdir -p /tmp/gh-aw/mcp-logs/safeoutputs - cat > "${RUNNER_TEMP}/gh-aw/safeoutputs/config.json" << 'GH_AW_SAFE_OUTPUTS_CONFIG_f08249b05e7071e9_EOF' - {"create_issue":{"allowed_fields":["Type"],"labels":["type/automation","type/test-gap"],"max":1,"title_prefix":"[mutation-test-improver] "},"create_pull_request":{"allowed_files":["test/UnitTests/Microsoft.Testing.Platform.ServerMode.Client.Sources.UnitTests/*.cs","test/UnitTests/Microsoft.Testing.Platform.ServerMode.Client.Sources.UnitTests/**/*.cs"],"draft":true,"labels":["type/automation","type/test-gap"],"max":2,"max_patch_files":100,"max_patch_size":4096,"protect_top_level_dot_folders":true,"protected_files":["package.json","bun.lockb","bunfig.toml","deno.json","deno.jsonc","deno.lock","global.json","NuGet.Config","Directory.Packages.props","mix.exs","mix.lock","go.mod","go.sum","stack.yaml","stack.yaml.lock","pom.xml","build.gradle","build.gradle.kts","settings.gradle","settings.gradle.kts","gradle.properties","package-lock.json","yarn.lock","pnpm-lock.yaml","npm-shrinkwrap.json","requirements.txt","Pipfile","Pipfile.lock","pyproject.toml","setup.py","setup.cfg","Gemfile","Gemfile.lock","uv.lock","CODEOWNERS","DESIGN.md","README.md","CONTRIBUTING.md","CHANGELOG.md","SECURITY.md","CODE_OF_CONDUCT.md","AGENTS.md"],"protected_files_policy":"fallback-to-issue","title_prefix":"[mutation-test-improver] "},"create_report_incomplete_issue":{},"missing_data":{},"missing_tool":{},"noop":{"max":1,"report-as-issue":"false"},"push_to_pull_request_branch":{"allowed_files":["test/UnitTests/Microsoft.Testing.Platform.ServerMode.Client.Sources.UnitTests/*.cs","test/UnitTests/Microsoft.Testing.Platform.ServerMode.Client.Sources.UnitTests/**/*.cs"],"if_no_changes":"warn","max":2,"max_patch_size":4096,"protect_top_level_dot_folders":true,"protected_files":["package.json","bun.lockb","bunfig.toml","deno.json","deno.jsonc","deno.lock","global.json","NuGet.Config","Directory.Packages.props","mix.exs","mix.lock","go.mod","go.sum","stack.yaml","stack.yaml.lock","pom.xml","build.gradle","build.gradle.kts","settings.gradle","settings.gradle.kts","gradle.properties","package-lock.json","yarn.lock","pnpm-lock.yaml","npm-shrinkwrap.json","requirements.txt","Pipfile","Pipfile.lock","pyproject.toml","setup.py","setup.cfg","Gemfile","Gemfile.lock","uv.lock","CODEOWNERS","DESIGN.md","README.md","CONTRIBUTING.md","CHANGELOG.md","SECURITY.md","CODE_OF_CONDUCT.md","AGENTS.md"],"target":"*","title_prefix":"[mutation-test-improver] "},"report_incomplete":{},"update_issue":{"allow_body":true,"max":1,"required_labels":["type/automation","type/test-gap"],"required_title_prefix":"[mutation-test-improver] Monthly Report ","target":"*"}} - GH_AW_SAFE_OUTPUTS_CONFIG_f08249b05e7071e9_EOF + cat > "${RUNNER_TEMP}/gh-aw/safeoutputs/config.json" << 'GH_AW_SAFE_OUTPUTS_CONFIG_b80dd19913098589_EOF' + {"create_issue":{"allowed_fields":["Type"],"labels":["type/automation","type/test-gap"],"max":1,"title_prefix":"[mutation-test-improver] "},"create_pull_request":{"allowed_files":["test/UnitTests/**/*.cs"],"draft":true,"labels":["type/automation","type/test-gap"],"max":2,"max_patch_files":100,"max_patch_size":4096,"protect_top_level_dot_folders":true,"protected_files":["package.json","bun.lockb","bunfig.toml","deno.json","deno.jsonc","deno.lock","global.json","NuGet.Config","Directory.Packages.props","mix.exs","mix.lock","go.mod","go.sum","stack.yaml","stack.yaml.lock","pom.xml","build.gradle","build.gradle.kts","settings.gradle","settings.gradle.kts","gradle.properties","package-lock.json","yarn.lock","pnpm-lock.yaml","npm-shrinkwrap.json","requirements.txt","Pipfile","Pipfile.lock","pyproject.toml","setup.py","setup.cfg","Gemfile","Gemfile.lock","uv.lock","CODEOWNERS","DESIGN.md","README.md","CONTRIBUTING.md","CHANGELOG.md","SECURITY.md","CODE_OF_CONDUCT.md","AGENTS.md"],"protected_files_policy":"fallback-to-issue","title_prefix":"[mutation-test-improver] "},"create_report_incomplete_issue":{},"missing_data":{},"missing_tool":{},"noop":{"max":1,"report-as-issue":"false"},"push_to_pull_request_branch":{"allowed_files":["test/UnitTests/**/*.cs"],"if_no_changes":"warn","max":2,"max_patch_size":4096,"protect_top_level_dot_folders":true,"protected_files":["package.json","bun.lockb","bunfig.toml","deno.json","deno.jsonc","deno.lock","global.json","NuGet.Config","Directory.Packages.props","mix.exs","mix.lock","go.mod","go.sum","stack.yaml","stack.yaml.lock","pom.xml","build.gradle","build.gradle.kts","settings.gradle","settings.gradle.kts","gradle.properties","package-lock.json","yarn.lock","pnpm-lock.yaml","npm-shrinkwrap.json","requirements.txt","Pipfile","Pipfile.lock","pyproject.toml","setup.py","setup.cfg","Gemfile","Gemfile.lock","uv.lock","CODEOWNERS","DESIGN.md","README.md","CONTRIBUTING.md","CHANGELOG.md","SECURITY.md","CODE_OF_CONDUCT.md","AGENTS.md"],"target":"*","title_prefix":"[mutation-test-improver] "},"report_incomplete":{},"update_issue":{"allow_body":true,"max":1,"required_labels":["type/automation","type/test-gap"],"required_title_prefix":"[mutation-test-improver] Monthly Report ","target":"*"}} + GH_AW_SAFE_OUTPUTS_CONFIG_b80dd19913098589_EOF - name: Generate Safe Outputs Tools env: GH_AW_TOOLS_META_JSON: | @@ -1812,7 +1812,7 @@ jobs: GH_AW_ALLOWED_DOMAINS: "*.blob.core.windows.net,*.vsblob.vsassets.io,api.business.githubcopilot.com,api.enterprise.githubcopilot.com,api.github.com,api.githubcopilot.com,api.individual.githubcopilot.com,api.nuget.org,api.snapcraft.io,archive.ubuntu.com,azure.archive.ubuntu.com,azuresearch-usnc.nuget.org,azuresearch-ussc.nuget.org,builds.dotnet.microsoft.com,ci.dot.net,crl.geotrust.com,crl.globalsign.com,crl.identrust.com,crl.sectigo.com,crl.thawte.com,crl.usertrust.com,crl.verisign.com,crl3.digicert.com,crl4.digicert.com,crls.ssl.com,dc.services.visualstudio.com,dist.nuget.org,dot.net,dotnet.microsoft.com,dotnetcli.blob.core.windows.net,github.com,host.docker.internal,json-schema.org,json.schemastore.org,keyserver.ubuntu.com,nuget.org,nuget.pkg.github.com,nugetregistryv2prod.blob.core.windows.net,ocsp.digicert.com,ocsp.geotrust.com,ocsp.globalsign.com,ocsp.identrust.com,ocsp.sectigo.com,ocsp.ssl.com,ocsp.thawte.com,ocsp.usertrust.com,ocsp.verisign.com,oneocsp.microsoft.com,packagecloud.io,packages.cloud.google.com,packages.microsoft.com,pkgs.dev.azure.com,ppa.launchpad.net,raw.githubusercontent.com,registry.npmjs.org,s.symcb.com,s.symcd.com,security.ubuntu.com,telemetry.enterprise.githubcopilot.com,ts-crl.ws.symantec.com,ts-ocsp.ws.symantec.com,www.googleapis.com,www.microsoft.com" GITHUB_SERVER_URL: ${{ github.server_url }} GITHUB_API_URL: ${{ github.api_url }} - GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: "{\"create_issue\":{\"allowed_fields\":[\"Type\"],\"labels\":[\"type/automation\",\"type/test-gap\"],\"max\":1,\"title_prefix\":\"[mutation-test-improver] \"},\"create_pull_request\":{\"allowed_files\":[\"test/UnitTests/Microsoft.Testing.Platform.ServerMode.Client.Sources.UnitTests/*.cs\",\"test/UnitTests/Microsoft.Testing.Platform.ServerMode.Client.Sources.UnitTests/**/*.cs\"],\"draft\":true,\"labels\":[\"type/automation\",\"type/test-gap\"],\"max\":2,\"max_patch_files\":100,\"max_patch_size\":4096,\"protect_top_level_dot_folders\":true,\"protected_files\":[\"package.json\",\"bun.lockb\",\"bunfig.toml\",\"deno.json\",\"deno.jsonc\",\"deno.lock\",\"global.json\",\"NuGet.Config\",\"Directory.Packages.props\",\"mix.exs\",\"mix.lock\",\"go.mod\",\"go.sum\",\"stack.yaml\",\"stack.yaml.lock\",\"pom.xml\",\"build.gradle\",\"build.gradle.kts\",\"settings.gradle\",\"settings.gradle.kts\",\"gradle.properties\",\"package-lock.json\",\"yarn.lock\",\"pnpm-lock.yaml\",\"npm-shrinkwrap.json\",\"requirements.txt\",\"Pipfile\",\"Pipfile.lock\",\"pyproject.toml\",\"setup.py\",\"setup.cfg\",\"Gemfile\",\"Gemfile.lock\",\"uv.lock\",\"CODEOWNERS\",\"DESIGN.md\",\"README.md\",\"CONTRIBUTING.md\",\"CHANGELOG.md\",\"SECURITY.md\",\"CODE_OF_CONDUCT.md\",\"AGENTS.md\"],\"protected_files_policy\":\"fallback-to-issue\",\"title_prefix\":\"[mutation-test-improver] \"},\"create_report_incomplete_issue\":{},\"missing_data\":{},\"missing_tool\":{},\"noop\":{\"max\":1,\"report-as-issue\":\"false\"},\"push_to_pull_request_branch\":{\"allowed_files\":[\"test/UnitTests/Microsoft.Testing.Platform.ServerMode.Client.Sources.UnitTests/*.cs\",\"test/UnitTests/Microsoft.Testing.Platform.ServerMode.Client.Sources.UnitTests/**/*.cs\"],\"if_no_changes\":\"warn\",\"max\":2,\"max_patch_size\":4096,\"protect_top_level_dot_folders\":true,\"protected_files\":[\"package.json\",\"bun.lockb\",\"bunfig.toml\",\"deno.json\",\"deno.jsonc\",\"deno.lock\",\"global.json\",\"NuGet.Config\",\"Directory.Packages.props\",\"mix.exs\",\"mix.lock\",\"go.mod\",\"go.sum\",\"stack.yaml\",\"stack.yaml.lock\",\"pom.xml\",\"build.gradle\",\"build.gradle.kts\",\"settings.gradle\",\"settings.gradle.kts\",\"gradle.properties\",\"package-lock.json\",\"yarn.lock\",\"pnpm-lock.yaml\",\"npm-shrinkwrap.json\",\"requirements.txt\",\"Pipfile\",\"Pipfile.lock\",\"pyproject.toml\",\"setup.py\",\"setup.cfg\",\"Gemfile\",\"Gemfile.lock\",\"uv.lock\",\"CODEOWNERS\",\"DESIGN.md\",\"README.md\",\"CONTRIBUTING.md\",\"CHANGELOG.md\",\"SECURITY.md\",\"CODE_OF_CONDUCT.md\",\"AGENTS.md\"],\"target\":\"*\",\"title_prefix\":\"[mutation-test-improver] \"},\"report_incomplete\":{},\"update_issue\":{\"allow_body\":true,\"max\":1,\"required_labels\":[\"type/automation\",\"type/test-gap\"],\"required_title_prefix\":\"[mutation-test-improver] Monthly Report \",\"target\":\"*\"}}" + GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: "{\"create_issue\":{\"allowed_fields\":[\"Type\"],\"labels\":[\"type/automation\",\"type/test-gap\"],\"max\":1,\"title_prefix\":\"[mutation-test-improver] \"},\"create_pull_request\":{\"allowed_files\":[\"test/UnitTests/**/*.cs\"],\"draft\":true,\"labels\":[\"type/automation\",\"type/test-gap\"],\"max\":2,\"max_patch_files\":100,\"max_patch_size\":4096,\"protect_top_level_dot_folders\":true,\"protected_files\":[\"package.json\",\"bun.lockb\",\"bunfig.toml\",\"deno.json\",\"deno.jsonc\",\"deno.lock\",\"global.json\",\"NuGet.Config\",\"Directory.Packages.props\",\"mix.exs\",\"mix.lock\",\"go.mod\",\"go.sum\",\"stack.yaml\",\"stack.yaml.lock\",\"pom.xml\",\"build.gradle\",\"build.gradle.kts\",\"settings.gradle\",\"settings.gradle.kts\",\"gradle.properties\",\"package-lock.json\",\"yarn.lock\",\"pnpm-lock.yaml\",\"npm-shrinkwrap.json\",\"requirements.txt\",\"Pipfile\",\"Pipfile.lock\",\"pyproject.toml\",\"setup.py\",\"setup.cfg\",\"Gemfile\",\"Gemfile.lock\",\"uv.lock\",\"CODEOWNERS\",\"DESIGN.md\",\"README.md\",\"CONTRIBUTING.md\",\"CHANGELOG.md\",\"SECURITY.md\",\"CODE_OF_CONDUCT.md\",\"AGENTS.md\"],\"protected_files_policy\":\"fallback-to-issue\",\"title_prefix\":\"[mutation-test-improver] \"},\"create_report_incomplete_issue\":{},\"missing_data\":{},\"missing_tool\":{},\"noop\":{\"max\":1,\"report-as-issue\":\"false\"},\"push_to_pull_request_branch\":{\"allowed_files\":[\"test/UnitTests/**/*.cs\"],\"if_no_changes\":\"warn\",\"max\":2,\"max_patch_size\":4096,\"protect_top_level_dot_folders\":true,\"protected_files\":[\"package.json\",\"bun.lockb\",\"bunfig.toml\",\"deno.json\",\"deno.jsonc\",\"deno.lock\",\"global.json\",\"NuGet.Config\",\"Directory.Packages.props\",\"mix.exs\",\"mix.lock\",\"go.mod\",\"go.sum\",\"stack.yaml\",\"stack.yaml.lock\",\"pom.xml\",\"build.gradle\",\"build.gradle.kts\",\"settings.gradle\",\"settings.gradle.kts\",\"gradle.properties\",\"package-lock.json\",\"yarn.lock\",\"pnpm-lock.yaml\",\"npm-shrinkwrap.json\",\"requirements.txt\",\"Pipfile\",\"Pipfile.lock\",\"pyproject.toml\",\"setup.py\",\"setup.cfg\",\"Gemfile\",\"Gemfile.lock\",\"uv.lock\",\"CODEOWNERS\",\"DESIGN.md\",\"README.md\",\"CONTRIBUTING.md\",\"CHANGELOG.md\",\"SECURITY.md\",\"CODE_OF_CONDUCT.md\",\"AGENTS.md\"],\"target\":\"*\",\"title_prefix\":\"[mutation-test-improver] \"},\"report_incomplete\":{},\"update_issue\":{\"allow_body\":true,\"max\":1,\"required_labels\":[\"type/automation\",\"type/test-gap\"],\"required_title_prefix\":\"[mutation-test-improver] Monthly Report \",\"target\":\"*\"}}" GH_AW_CI_TRIGGER_TOKEN: ${{ secrets.GH_AW_CI_TRIGGER_TOKEN }} with: github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/mutation-test-improver.md b/.github/workflows/mutation-test-improver.md index 83ff808c41..5d91814ce4 100644 --- a/.github/workflows/mutation-test-improver.md +++ b/.github/workflows/mutation-test-improver.md @@ -84,15 +84,13 @@ safe-outputs: labels: [type/automation, type/test-gap] max: 2 allowed-files: - - test/UnitTests/Microsoft.Testing.Platform.ServerMode.Client.Sources.UnitTests/*.cs - - test/UnitTests/Microsoft.Testing.Platform.ServerMode.Client.Sources.UnitTests/**/*.cs + - test/UnitTests/**/*.cs protected-files: fallback-to-issue push-to-pull-request-branch: target: "*" required-title-prefix: "[mutation-test-improver] " allowed-files: - - test/UnitTests/Microsoft.Testing.Platform.ServerMode.Client.Sources.UnitTests/*.cs - - test/UnitTests/Microsoft.Testing.Platform.ServerMode.Client.Sources.UnitTests/**/*.cs + - test/UnitTests/**/*.cs max: 2 tools: @@ -114,7 +112,7 @@ Always be: ## Scope -Mutation testing currently only covers `Client/**/*.cs` in `src/Platform/Microsoft.Testing.Platform.ServerMode.Client.Sources`, driven by `test/UnitTests/Microsoft.Testing.Platform.ServerMode.Client.Sources.UnitTests/stryker-config.json` and run daily by [`.github/workflows/mutation-testing.yml`](../workflows/mutation-testing.yml). **Do not** widen `mutate:` scope, add new mutated projects, or change thresholds — those are maintainer decisions. If you believe the scope should grow, say so in the "Suggested Actions" section of the monthly report rather than doing it yourself. +Mutation testing covers the production projects exercised by the unit-test projects in `MutationTesting.slnx`, driven by the root `stryker-config.json` and run daily by [`.github/workflows/mutation-testing.yml`](../workflows/mutation-testing.yml). **Do not** widen the solution, mutate scope, or thresholds — those are maintainer decisions. If you believe the scope should grow, say so in the "Suggested Actions" section of the monthly report rather than doing it yourself. ## Persistent state @@ -163,9 +161,9 @@ For **at most 2** of the remaining highest-value `Survived` or `NoCoverage` muta 3. Read the mutated file and surrounding context to understand the intended behavior and what the specific mutation (e.g. a boundary flip, boolean negation, removed block) would break. 4. If you cannot confidently explain the intended behavior, skip this mutant — do not guess. 5. If the mutant looks behaviorally equivalent (the mutated code cannot be distinguished from the original by any observable behavior), record it in the monthly report as a known equivalent mutant with your reasoning, and skip it. -6. Otherwise, find (or create) the corresponding test file under `test/UnitTests/Microsoft.Testing.Platform.ServerMode.Client.Sources.UnitTests` and add a focused test asserting the exact behavior the mutant would violate. Match the project's existing test framework and assertion style (check its `BannedSymbols.txt` if present, otherwise mirror neighboring tests). +6. Otherwise, find (or create) the corresponding test file under the unit-test project associated with the mutated production project and add a focused test asserting the exact behavior the mutant would violate. Match that project's existing test framework and assertion style (check its `BannedSymbols.txt` if present, otherwise mirror neighboring tests). 7. Build and run the unit test project with `$GITHUB_WORKSPACE/.dotnet/dotnet` to confirm the new test compiles and passes against the original (unmutated) code. -8. **Verify the fix**: re-run `$GITHUB_WORKSPACE/.dotnet/dotnet tool restore` then, from `test/UnitTests/Microsoft.Testing.Platform.ServerMode.Client.Sources.UnitTests` with `MutationTesting=true`, run `$GITHUB_WORKSPACE/.dotnet/dotnet stryker --output ../../../artifacts/mutation-testing-verify --skip-version-check`. Confirm the targeted mutant's status flipped to `Killed` in the new report. +8. **Verify the fix**: restore Stryker with `$GITHUB_WORKSPACE/.dotnet/dotnet tool restore --tool-manifest .config/stryker/dotnet-tools.json --configfile .config/stryker/NuGet.config`, identify the mutated production project's `.csproj` file name and the mutated source path relative to that project, then from `$GITHUB_WORKSPACE/.config/stryker` run `MutationTesting=true $GITHUB_WORKSPACE/.dotnet/dotnet stryker --config-file "$GITHUB_WORKSPACE/stryker-config.json" --solution "$GITHUB_WORKSPACE/MutationTesting.slnx" --project "" --mutate "" --output "$GITHUB_WORKSPACE/artifacts/mutation-testing-verify" --skip-version-check`. Confirm the targeted mutant's status flipped to `Killed` in the new report. - Count each Stryker invocation against the workflow's total verification budget. If the budget is exhausted, stop attempting fixes and continue to Step 5. - If it did not flip, don't force it — try at most one more angle only when verification budget remains; otherwise abandon this mutant, record the attempt outcome in the monthly report, restore the test worktree to remove the abandoned edits, and move to the next candidate. 9. For each mutant you successfully kill, emit a safe-output request for a small draft PR from a fresh branch (`mutation-test-improver/`) with: diff --git a/.github/workflows/mutation-testing.yml b/.github/workflows/mutation-testing.yml index f6935d3ad7..ed71102bfe 100644 --- a/.github/workflows/mutation-testing.yml +++ b/.github/workflows/mutation-testing.yml @@ -2,9 +2,7 @@ name: Mutation testing on: schedule: - # Runs daily (rather than weekly) so the mutation-test-improver workflow has fresh - # data every day to act on. Stryker only mutates the small, focused Client sources - # scope, so the added runner cost of daily execution is small in absolute terms. + # Runs daily so the mutation-test-improver workflow has fresh data to act on. - cron: '0 5 * * *' workflow_dispatch: @@ -19,7 +17,7 @@ jobs: stryker: name: Run Stryker.NET runs-on: ubuntu-latest - timeout-minutes: 90 + timeout-minutes: 360 steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 @@ -27,17 +25,17 @@ jobs: - name: Build repository run: ./build.sh --binaryLog - - name: Restore local tools - run: ./.dotnet/dotnet tool restore + - name: Restore Stryker.NET + run: ./.dotnet/dotnet tool restore --tool-manifest .config/stryker/dotnet-tools.json --configfile .config/stryker/NuGet.config - name: Run mutation tests - working-directory: test/UnitTests/Microsoft.Testing.Platform.ServerMode.Client.Sources.UnitTests + working-directory: .config/stryker env: MutationTesting: true run: | set -o pipefail mkdir -p "$GITHUB_WORKSPACE/artifacts/mutation-testing" - "$GITHUB_WORKSPACE/.dotnet/dotnet" stryker --output "$GITHUB_WORKSPACE/artifacts/mutation-testing" --skip-version-check | tee "$GITHUB_WORKSPACE/artifacts/mutation-testing/stryker-console.log" + "$GITHUB_WORKSPACE/.dotnet/dotnet" stryker --config-file "$GITHUB_WORKSPACE/stryker-config.json" --solution "$GITHUB_WORKSPACE/MutationTesting.slnx" --output "$GITHUB_WORKSPACE/artifacts/mutation-testing" --skip-version-check | tee "$GITHUB_WORKSPACE/artifacts/mutation-testing/stryker-console.log" - name: Summarize mutation testing results if: ${{ always() }} diff --git a/Directory.Build.props b/Directory.Build.props index 57d6588367..f02b3f855c 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -24,6 +24,7 @@ + true Microsoft - Open + + Open + $(OpenPublicKey) diff --git a/MutationTesting.slnx b/MutationTesting.slnx new file mode 100644 index 0000000000..285a4ae474 --- /dev/null +++ b/MutationTesting.slnx @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/dev-guide.md b/docs/dev-guide.md index ae9d3f3db6..65a9a3c44d 100644 --- a/docs/dev-guide.md +++ b/docs/dev-guide.md @@ -164,26 +164,26 @@ Note that `-test` allows to run the unit tests and `-integrationTest` allows to ### Mutation testing -The repository uses [Stryker.NET](https://stryker-mutator.io/docs/stryker-net/introduction/) to mutation-test the server-mode client sources. Restore the pinned local tool and run it from the configured unit-test project: +The repository uses [Stryker.NET](https://stryker-mutator.io/docs/stryker-net/introduction/) to mutation-test the production projects covered by the unit-test projects in `MutationTesting.slnx`. Restore the pinned local tool and run it from the repository root: On Windows PowerShell: ```powershell -dotnet tool restore -Set-Location test/UnitTests/Microsoft.Testing.Platform.ServerMode.Client.Sources.UnitTests +dotnet tool restore --tool-manifest .config/stryker/dotnet-tools.json --configfile .config/stryker/NuGet.config $env:MutationTesting = "true" -dotnet stryker --output ../../../artifacts/mutation-testing +Push-Location .config/stryker +dotnet stryker --config-file ../../stryker-config.json --solution ../../MutationTesting.slnx --output ../../artifacts/mutation-testing +Pop-Location ``` On Linux and macOS: ```shell -dotnet tool restore -cd test/UnitTests/Microsoft.Testing.Platform.ServerMode.Client.Sources.UnitTests -MutationTesting=true dotnet stryker --output ../../../artifacts/mutation-testing +dotnet tool restore --tool-manifest .config/stryker/dotnet-tools.json --configfile .config/stryker/NuGet.config +(cd .config/stryker && MutationTesting=true dotnet stryker --config-file ../../stryker-config.json --solution ../../MutationTesting.slnx --output ../../artifacts/mutation-testing) ``` -The opt-in property selects Arcade's open strong-name key for the mutated assembly because Stryker's in-memory compiler cannot complete Microsoft delay signing. +The opt-in property runs unit-test projects on `net8.0` and selects Arcade's open strong-name key for mutated assemblies and their friend assemblies because Stryker's in-memory compiler cannot complete Microsoft delay signing. The HTML and JSON reports are written to `artifacts/mutation-testing`. The [mutation testing workflow](../.github/workflows/mutation-testing.yml) also runs daily (so the mutation-test-improver workflow always has fresh data) and can be started manually; it publishes the mutation score and a killed/survived/timeout breakdown to the run's job summary, and uploads the full HTML/JSON report as the `mutation-testing-report` artifact. diff --git a/eng/pipelines/steps/test-windows-configuration-tests.yml b/eng/pipelines/steps/test-windows-configuration-tests.yml index 6eaf9ac5ac..f909c066b2 100644 --- a/eng/pipelines/steps/test-windows-configuration-tests.yml +++ b/eng/pipelines/steps/test-windows-configuration-tests.yml @@ -27,7 +27,7 @@ steps: - ${{ if eq(parameters.enableAffectedTests, false) }}: - script: | echo ##vso[task.setvariable variable=PublishCoverageReport]true - dotnet test -c $(_BuildConfig) --no-build -bl:$(BUILD.SOURCESDIRECTORY)\artifacts\TestResults\$(_BuildConfig)\TestStep.binlog -p:UsingDotNetTest=true -p:TestingPlatformCaptureOutput=false --show-test-results failed + dotnet test --solution TestFx.slnx -c $(_BuildConfig) --no-build -bl:$(BUILD.SOURCESDIRECTORY)\artifacts\TestResults\$(_BuildConfig)\TestStep.binlog -p:UsingDotNetTest=true -p:TestingPlatformCaptureOutput=false --show-test-results failed name: Test displayName: Test condition: and(succeeded(), eq(variables._BuildConfig, 'Release'), ne(variables._XmlDocsOnly, 'true')) @@ -52,7 +52,7 @@ steps: - script: | echo ##vso[task.setvariable variable=PublishCoverageReport]true - dotnet test -c $(_BuildConfig) --no-build -bl:$(BUILD.SOURCESDIRECTORY)\artifacts\TestResults\$(_BuildConfig)\TestStep.binlog -p:UsingDotNetTest=true -p:TestingPlatformCaptureOutput=false --show-test-results failed --collect-test-map + dotnet test --solution TestFx.slnx -c $(_BuildConfig) --no-build -bl:$(BUILD.SOURCESDIRECTORY)\artifacts\TestResults\$(_BuildConfig)\TestStep.binlog -p:UsingDotNetTest=true -p:TestingPlatformCaptureOutput=false --show-test-results failed --collect-test-map name: Test displayName: Test and collect affected-test map condition: and(succeeded(), eq(variables._BuildConfig, 'Release'), ne(variables._XmlDocsOnly, 'true')) @@ -72,7 +72,7 @@ steps: condition: and(succeeded(), eq(variables._BuildConfig, 'Release'), ne(variables._XmlDocsOnly, 'true'), eq(variables['Build.Reason'], 'PullRequest')) - pwsh: | - dotnet test -c $(_BuildConfig) --no-build -bl:$(BUILD.SOURCESDIRECTORY)\artifacts\TestResults\$(_BuildConfig)\TestStep.binlog -p:UsingDotNetTest=true -p:TestingPlatformCaptureOutput=false --show-test-results failed --affected-tests + dotnet test --solution TestFx.slnx -c $(_BuildConfig) --no-build -bl:$(BUILD.SOURCESDIRECTORY)\artifacts\TestResults\$(_BuildConfig)\TestStep.binlog -p:UsingDotNetTest=true -p:TestingPlatformCaptureOutput=false --show-test-results failed --affected-tests $exitCode = $LASTEXITCODE if ($exitCode -eq 0) { Write-Host "##vso[task.setvariable variable=AffectedTestsSucceeded]true" @@ -104,7 +104,7 @@ steps: Remove-Item -Force } - dotnet test -c $(_BuildConfig) --no-build -bl:$(BUILD.SOURCESDIRECTORY)\artifacts\TestResults\$(_BuildConfig)\TestStep.binlog -p:UsingDotNetTest=true -p:TestingPlatformCaptureOutput=false --show-test-results failed + dotnet test --solution TestFx.slnx -c $(_BuildConfig) --no-build -bl:$(BUILD.SOURCESDIRECTORY)\artifacts\TestResults\$(_BuildConfig)\TestStep.binlog -p:UsingDotNetTest=true -p:TestingPlatformCaptureOutput=false --show-test-results failed exit $LASTEXITCODE name: Test displayName: Test (affected-test fallback) diff --git a/test/UnitTests/Microsoft.Testing.Platform.ServerMode.Client.Sources.UnitTests/stryker-config.json b/stryker-config.json similarity index 69% rename from test/UnitTests/Microsoft.Testing.Platform.ServerMode.Client.Sources.UnitTests/stryker-config.json rename to stryker-config.json index 342ac4a9c4..3d5237363f 100644 --- a/test/UnitTests/Microsoft.Testing.Platform.ServerMode.Client.Sources.UnitTests/stryker-config.json +++ b/stryker-config.json @@ -1,11 +1,13 @@ { "stryker-config": { - "project": "Microsoft.Testing.Platform.ServerMode.Client.Sources.csproj", - "target-framework": "net8.0", + "solution": "MutationTesting.slnx", "test-runner": "mtp", "mutation-level": "Standard", "mutate": [ - "Client/**/*.cs" + "!**/obj/**", + "!**/*.g.cs", + "!**/*.generated.cs", + "!**/*.Generated.cs" ], "reporters": [ "html", diff --git a/test/Directory.Build.targets b/test/Directory.Build.targets index 99039b744c..04d5ee9e9b 100644 --- a/test/Directory.Build.targets +++ b/test/Directory.Build.targets @@ -4,6 +4,7 @@ + net8.0 false false $(PlatformTarget)