-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add integration tests for dotnet test #46045
base: main
Are you sure you want to change the base?
Add integration tests for dotnet test #46045
Conversation
…egration-tests-for-dotnet-test-run-functionality
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.
Approving as-is as it's getting to hard to reiew properly without having the associated feature at hand. Let's make sure this is merged asap and let's ensure tests are added with feature work.
Co-authored-by: Amaury Levé <[email protected]>
…-functionality' of https://github.com/dotnet/sdk into dev/mabdullah/add-integration-tests-for-dotnet-test-run-functionality
} | ||
else | ||
{ | ||
bool allowBinLog = IsBinaryLoggerEnabled(_args, out string binLogFileName); | ||
isBuiltOrRestored = BuildOrRestoreProject(solutionOrProjectFilePath, projectCollection, [CliConstants.RestoreCommand], allowBinLog, binLogFileName); |
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.
We still need to find a way to write a single binlog file when restoring and building for the test project case.
Because it's not working as the solution case (passing both restore and build command when building).
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.
it should work for single project, just like with sln. And for multiple projects you should be able to filter and build a metaproject with just those projects or something.
@JanKrivanek what is the easiest and most efficient way for us to build and restore a subset of projects from a solution?
e.g. all projects that contain *UnitTests.csproj in the name.
…et-test-run-functionality
…et-test-run-functionality
This pull request includes several changes to the
dotnet-test
command to improve error handling and output reporting. The most important changes involve replacingVSTestTrace.SafeWriteTrace
with_output.WriteMessage
for better integration with theTerminalTestReporter
, modifying method signatures to include the new reporter, and refactoring utility methods for improved readability and maintainability.Error Handling and Output Reporting:
src/Cli/dotnet/commands/dotnet-test/MSBuildHandler.cs
: ReplacedVSTestTrace.SafeWriteTrace
with_output.WriteMessage
in various methods to improve error message reporting. [1] [2] [3] [4]src/Cli/dotnet/commands/dotnet-test/MSBuildHandler.cs
: AddedTerminalTestReporter
as a parameter to theMSBuildHandler
constructor and assigned it to a private field_output
.Method Signature Modifications:
src/Cli/dotnet/commands/dotnet-test/SolutionAndProjectUtility.cs
: Changed the return type ofTryGetProjectOrSolutionFilePath
to a tuple for better error messaging. [1] [2]src/Cli/dotnet/commands/dotnet-test/MSBuildHandler.cs
: ModifiedIsBinaryLoggerEnabled
to beinternal
instead ofprivate
.Code Refactoring:
src/Cli/dotnet/commands/dotnet-test/TestingPlatformCommand.cs
: Refactored theRun
method to improve readability and maintainability by extracting logic into helper methods likeSetupCancelKeyPressHandler
,InitializeHelpActionQueue
, andInitializeTestExecutionActionQueue
. [1] [2]src/Cli/dotnet/commands/dotnet-test/MSBuildHandler.cs
: Added comments to clarify the purpose of certain code blocks and skipped non-test projects during initialization. [1] [2]Cleanup:
src/Cli/dotnet/commands/dotnet-test/TestApplication.cs
: Removed unused eventRun
and constantsTestingPlatformVsTestBridgeRunSettingsFileEnvVar
andDLLExtension
. [1] [2] [3] [4]src/Cli/dotnet/commands/dotnet-test/TestingPlatformCommand.cs
: Removed unnecessaryConsole.CancelKeyPress
handler logic and unused fields. [1] [2]