Skip to content

[dotnet test for MTP] Throw exception if the project doesn't produce executable #48065

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

Merged
merged 6 commits into from
Apr 10, 2025

Conversation

Youssef1313
Copy link
Member

I don't think this should happen, or is a case we should support. So I think better to explicitly throw exception for now, and iterate later if there are user reports indicating valid use cases. But so far I can't see any valid use case.

@Copilot Copilot AI review requested due to automatic review settings April 1, 2025 11:32
@ghost ghost added Area-Infrastructure untriaged Request triage from a team member labels Apr 1, 2025
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 changes the behavior of dotnet test for Microsoft.Testing.Platform projects by explicitly throwing an exception when a test project doesn’t produce an executable rather than attempting a fallback execution method.

  • Replaces the fallback to dotnet run with an exception throw in TestApplication.cs.
  • Removes the BuildArgsWithDotnetRun method from TestApplication.cs and related constants from CliConstants.cs.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/Cli/dotnet/Commands/Test/TestApplication.cs Replaced fallback dotnet run execution with a clear exception for non-executable test projects and removed the redundant BuildArgsWithDotnetRun method.
src/Cli/dotnet/Commands/Test/CliConstants.cs Removed constants that were used in the fallback execution logic, aligning with the new exception-based behavior.

@Youssef1313
Copy link
Member Author

Build is green but is old. Kicking a new build.

@Youssef1313
Copy link
Member Author

/azp run

Copy link

Azure Pipelines successfully started running 4 pipeline(s).

@Youssef1313 Youssef1313 merged commit 11150c0 into main Apr 10, 2025
80 of 83 checks passed
@Youssef1313 Youssef1313 deleted the dev/ygerges/dotnetrun branch April 10, 2025 10:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Infrastructure untriaged Request triage from a team member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants