Skip to content

Add dotnet.config to specify MTP for dotnet test #10836

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Youssef1313
Copy link
Member

Description

Please include a summary of the changes and the related issue. Please also include relevant motivation and context. List any dependencies that are required for this change.

Fixes # (issue)

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • Yes
      • If yes, did you have an API Review for it?
        • Yes
        • No
      • Did you add <remarks /> and <code /> elements on your triple slash comments?
        • Yes
        • No
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
      • If yes, have you done a threat model and had a security review?
        • Yes
        • No
    • No
  • Does the change require an update in our Aspire docs?

@Copilot Copilot AI review requested due to automatic review settings August 5, 2025 06:35
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds a dotnet.config file to configure Microsoft.Testing.Platform (MTP) as the default test runner for dotnet test commands, eliminating the need for the -- separator in test command arguments.

  • Adds dotnet.config to specify MTP as the test runner
  • Updates test command syntax by removing -- separators from various configuration files
  • Updates documentation to reflect the new command syntax without -- separators

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
dotnet.config New configuration file specifying Microsoft.Testing.Platform as the test runner
tests/helix/send-to-helix-buildonhelixtests.targets Removes -- separator from test command arguments
.github/workflows/run-tests.yml Removes -- separator from GitHub workflow test commands
.github/copilot-instructions.md Updates documentation examples to remove -- separators from test commands

@github-actions github-actions bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Aug 5, 2025
@Youssef1313 Youssef1313 force-pushed the dev/ygerges/dotnet-config branch from 77fc265 to c8bf995 Compare August 5, 2025 07:02
@Youssef1313 Youssef1313 force-pushed the dev/ygerges/dotnet-config branch from c8bf995 to 071d5c5 Compare August 5, 2025 07:45
@Youssef1313
Copy link
Member Author

failed Aspire.Hosting.Testing.Tests.TestingBuilderTests.CanOverrideLaunchProfileViaArgs(launchProfileName: "http", directArgs: True) (9s 837ms)
  from /home/runner/work/aspire/aspire/artifacts/bin/Aspire.Hosting.Testing.Tests/Debug/net8.0/Aspire.Hosting.Testing.Tests (net8.0|x64)
  Assert.Equal() Failure: Strings differ
  Expected: "app-host-is-http"
  Actual:   "app-host-is-https"
                             ↑ (pos 16)
    at Aspire.Hosting.Testing.Tests.TestingBuilderTests.CanOverrideLaunchProfileViaArgs(String launchProfileName, Boolean directArgs) in /_/tests/Aspire.Hosting.Testing.Tests/TestingBuilderTests.cs:332
    at Aspire.Hosting.Testing.Tests.TestingBuilderTests.CanOverrideLaunchProfileViaArgs(String launchProfileName, Boolean directArgs) in /_/tests/Aspire.Hosting.Testing.Tests/TestingBuilderTests.cs:332

This slight change in behavior is because dotnet test considers launchSettings.json.

I see #7363 added tests/Aspire.Hosting.Testing.Tests/Properties/launchSettings.json but I'm not sure how it was supposed to work. @ReubenBond Can you please take a look?

@Youssef1313
Copy link
Member Author

Youssef1313 commented Aug 5, 2025

Adding --no-launch-profile for now to unblock this, preserving the old behavior before this PR. Let's see if this will be green now.

@Youssef1313
Copy link
Member Author

@radical Assuming it's green. Can you please review so that we can get it merged?

@Youssef1313
Copy link
Member Author

Ping @radical for review please.

@Youssef1313 Youssef1313 added area-engineering-systems infrastructure helix infra engineering repo stuff and removed needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels Aug 8, 2025
@radical
Copy link
Member

radical commented Aug 11, 2025

What does dotnet.config do exactly? Is that documented somewhere too?
Also, does it need to be added to the helix payload?

@Youssef1313
Copy link
Member Author

@radical It enables the new dotnet test experience for MTP which we implemented in .NET 10 SDK. It's documented in Testing with 'dotnet test' and 'dotnet test' CLI reference.

The old way of running MTP is that MTP is hooking into the VSTest infrastructure.

Also, does it need to be added to the helix payload?

Anywhere dotnet test is run, dotnet.config is needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-engineering-systems infrastructure helix infra engineering repo stuff
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants