Skip to content

Disable logging when loading projects in dotnet test #49473

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

Conversation

mariam-abdulla
Copy link
Member

This pull request simplifies the handling of MSBuild logging in the MSBuildUtility.cs file by removing the FacadeLogger and its associated logic. The changes streamline the creation of the ProjectCollection object and eliminate unnecessary shutdown operations for the logger.

Simplification of MSBuild logging:

  • Removed the FacadeLogger initialization and its shutdown logic in public static (IEnumerable<ParallelizableTestModuleGroupWithSequentialInnerModules method, simplifying the code and ensuring the ProjectCollection is created without a logger. (src/Cli/dotnet/Commands/Test/MSBuildUtility.cs, [1] [2]

@Copilot Copilot AI review requested due to automatic review settings June 18, 2025 09:40
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

Streamlines MSBuild project loading in dotnet test by removing custom logging and simplifying ProjectCollection creation.

  • Removes FacadeLogger initialization and shutdown logic.
  • Updates ProjectCollection instantiation to pass null for loggers.
Comments suppressed due to low confidence (1)

src/Cli/dotnet/Commands/Test/MSBuildUtility.cs:35

  • Consider adding or updating tests to cover the scenario where logging is disabled, ensuring project loading behaves correctly without the FacadeLogger.
        var collection = new ProjectCollection(globalProperties: CommonRunHelpers.GetGlobalPropertiesFromArgs([.. buildOptions.MSBuildArgs]), null, toolsetDefinitionLocations: ToolsetDefinitionLocations.Default);

@mariam-abdulla mariam-abdulla enabled auto-merge (squash) June 18, 2025 09:48
Copy link
Member

@Youssef1313 Youssef1313 left a comment

Choose a reason for hiding this comment

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

Approving as it doesn't work correctly on its current form.

@rainersigwald @YuliiaKovalova We definitely would love if there is a way/workaround to correctly produce a binlog for multiple evaluations/executions

@mariam-abdulla mariam-abdulla merged commit fa094cf into main Jun 20, 2025
30 checks passed
@mariam-abdulla mariam-abdulla deleted the dev/mabdullah/disable-logging-in-loading-projects-api branch June 20, 2025 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants