Skip to content
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

Create logger directory if it doesn't exist in dotnet test #47411

Merged

Conversation

mariam-abdulla
Copy link
Member

@mariam-abdulla mariam-abdulla commented Mar 10, 2025

Relates to #45927

Fixes microsoft/testfx#5205

@Copilot Copilot bot review requested due to automatic review settings March 10, 2025 15:28
@mariam-abdulla mariam-abdulla requested a review from a team as a code owner March 10, 2025 15:28
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-dotnet test untriaged Request triage from a team member labels Mar 10, 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.

PR Overview

This PR ensures that the logger directory is created automatically before writing test logs.

  • Checks if the directory extracted from _traceFilePath exists and creates it if missing.
  • Enhances the robustness of the dotnet test logging functionality.

Reviewed Changes

File Description
src/Cli/dotnet/commands/dotnet-test/Logger.cs Added logic to create the directory for the logger if it does not exist

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

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.

LGTM with two minor comments

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.

Consider also adding an integration test for this

@mariam-abdulla mariam-abdulla enabled auto-merge (squash) March 11, 2025 10:03
mariam-abdulla and others added 2 commits March 11, 2025 11:14
@mariam-abdulla mariam-abdulla merged commit bf42a4c into main Mar 11, 2025
39 checks passed
@mariam-abdulla mariam-abdulla deleted the dev/mabdullah/fix-bug-logger-env-var-in-dotnet-test branch March 11, 2025 13:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-dotnet test untriaged Request triage from a team member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New dotnet test experience should create the directory of the trace file if not present
3 participants