Skip to content

Honor configured MTP exit policies - #56304

Merged
Evangelink merged 1 commit into
dotnet:mainfrom
Evangelink:dev/amauryleve/mtp-policy-reconstruction-fix
Sep 15, 2026
Merged

Evangelink merged 1 commit into
dotnet:mainfrom
Evangelink:dev/amauryleve/mtp-policy-reconstruction-fix

Conversation

@Evangelink

Copy link
Copy Markdown
Member

Summary

Follow up on #56219 and #56296 so the SDK aggregate verdict uses the same effective MTP policy as the test application.

  • read zero-tests-policy and ignore-exit-code from explicit and default .testconfig.json files
  • preserve environment > CLI > JSON precedence for ignored exit codes
  • match Windows-insensitive and Unix-sensitive environment-variable lookup
  • apply launch-profile and module environment overrides in the same order as ProcessStartInfo
  • add end-to-end coverage for explicit/default configuration and Windows launch-profile casing

Validation

  • build.cmd: passed with 0 warnings and 0 errors
  • focused dotnet.Tests: 222 passed, 0 failed, 0 skipped
.\.dotnet\dotnet.exe scripts\RunTests.cs -- --project test\dotnet.Tests\dotnet.Tests.csproj --filter "FullyQualifiedName~GivenDotnetTestBuildsAndRunsTests|FullyQualifiedName~TerminalTestReporterTests|FullyQualifiedName~TestApplicationActionQueueTests|FullyQualifiedName~TestCommandParserTests"

Reconstruct zero-test and ignored-exit policies from explicit and default test configuration files, and match process environment casing and override order on Windows.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings September 15, 2026 10:29
@Evangelink
Evangelink requested a review from a team as a code owner September 15, 2026 10:29
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
2 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Add coverage for Unix-sensitive casing and module environment overrides.

Get a fresh assessment by requesting another Copilot review.

Review tier: Lite
Findings: 1 Medium severity

Open (1)
What changed in this PR

Updates dotnet test to honor effective MTP policies when computing aggregate test results.

Changes:

  • Reads explicit/default .testconfig.json policies.
  • Preserves environment, CLI, and JSON precedence.
  • Adds parser and end-to-end coverage.
File Summary
test/​dotnet.Tests/​CommandTests/​Test/​TestCommandParserTests.cs Tests ignored-exit-code precedence.
test/​dotnet.Tests/​CommandTests/​Test/​GivenDotnetTestBuildsAndRunsTests.cs Adds configuration and launch-profile integration coverage.
src/​Cli/​dotnet/​Commands/​Test/​MTP/​MicrosoftTestingPlatformTestCommand.cs Reconstructs effective MTP policies.

@Evangelink
Evangelink merged commit 276264e into dotnet:main Sep 15, 2026
24 checks passed
@Evangelink
Evangelink deleted the dev/amauryleve/mtp-policy-reconstruction-fix branch September 15, 2026 14:23
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 12.0-preview1 milestone Sep 16, 2026

This branch had an error being deployed

1 failed deployment
copilot-pat-pool — 30c76146 Deployed Sep 15, 2026 by Evangelink via pre_activation #4972
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants