-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add test for dotnet test with UseAppHost=false in MTP #50109
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
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: Youssef1313 <[email protected]>
Co-authored-by: Youssef1313 <[email protected]>
...sets/TestProjects/TestProjectMTPWithUseAppHostFalse/TestProjectMTPWithUseAppHostFalse.csproj
Outdated
Show resolved
Hide resolved
...sets/TestProjects/TestProjectMTPWithUseAppHostFalse/TestProjectMTPWithUseAppHostFalse.csproj
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot Please create dotnet.config
in test/TestAssets/TestProjects/TestProjectMTPWithUseAppHostFalse` specifying Microsoft.Testing.Platform.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot Please revert the changes in TestApplication.cs
test/dotnet.Tests/CommandTests/Test/GivenDotnetTestBuildsAndRunsTests.cs
Outdated
Show resolved
Hide resolved
The GenerateProgramFile property is already set to false for all test projects in Directory.Build.props, making it redundant in individual test project files. Co-authored-by: Youssef1313 <[email protected]>
…onfig, revert TestApplication.cs, update test to use dedicated test asset Co-authored-by: Youssef1313 <[email protected]>
Created dotnet.config in test/TestAssets/TestProjects/TestProjectMTPWithUseAppHostFalse specifying Microsoft.Testing.Platform. Added in commit 628f1b7. Warning Firewall rules blocked me from connecting to one or more addressesI tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
test/dotnet.Tests/CommandTests/Test/GivenDotnetTestBuildsAndRunsTests.cs
Outdated
Show resolved
Hide resolved
…houldWork, and make it a positive test Co-authored-by: Youssef1313 <[email protected]>
There was a problem hiding this 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 test coverage to verify that Microsoft Testing Platform (MTP) projects work correctly when UseAppHost=false
is configured. This ensures that MTP projects can run using dotnet exec mydll.dll
instead of generating an executable host.
- Added a new test case
RunMTPProjectWithUseAppHostFalse_ShouldWork
to verify MTP functionality withUseAppHost=false
- Created a test asset project with minimal MTP configuration and
UseAppHost=false
setting - Implemented conditional package references to avoid network dependencies during testing
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
GivenDotnetTestBuildsAndRunsTests.cs | Added test method to verify MTP projects work with UseAppHost=false |
dotnet.config | Configuration file enabling Microsoft Testing Platform for the test asset |
TestProjectMTPWithUseAppHostFalse.csproj | Project file with UseAppHost=false and conditional MTP package reference |
Program.cs | Minimal MTP test implementation with dummy test adapter |
test/dotnet.Tests/CommandTests/Test/GivenDotnetTestBuildsAndRunsTests.cs
Outdated
Show resolved
Hide resolved
...sets/TestProjects/TestProjectMTPWithUseAppHostFalse/TestProjectMTPWithUseAppHostFalse.csproj
Outdated
Show resolved
Hide resolved
test/dotnet.Tests/CommandTests/Test/GivenDotnetTestBuildsAndRunsTests.cs
Outdated
Show resolved
Hide resolved
...sets/TestProjects/TestProjectMTPWithUseAppHostFalse/TestProjectMTPWithUseAppHostFalse.csproj
Outdated
Show resolved
Hide resolved
test/TestAssets/TestProjects/TestProjectMTPWithUseAppHostFalse/dotnet.config
Show resolved
Hide resolved
Co-authored-by: Youssef1313 <[email protected]>
Head branch was pushed to by a user without write access
…nsTests.cs Co-authored-by: Copilot <[email protected]>
This PR adds a test case to verify that Microsoft Testing Platform (MTP) projects work correctly when
UseAppHost=false
is configured.Background
When
UseAppHost=false
, .NET projects don't generate an executable host and instead rely ondotnet exec mydll.dll
for execution. This scenario needed test coverage to ensure MTP projects function properly in this configuration.Changes
RunMTPProjectWithUseAppHostFalse_ShouldWork
that verifies MTP projects execute successfully withUseAppHost=false
TestProjectMTPWithUseAppHostFalse
combining MTP configuration withUseAppHost=false
dotnet.config
file specifying Microsoft.Testing.Platform usageThe test ensures that the basic functionality of running MTP projects with
UseAppHost=false
works as expected, providing confidence that this configuration is properly supported.Fixes #49718.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.