Skip to content

[Bug]: JUnit junit-output-path not working properly #4095

@ky0jr

Description

@ky0jr

Description

The junit-output-path command line argument is not working.
It looks like _outputPath is not checked to see if it has already been assigned.
Using env JUNIT_XML_OUTPUT_PATH is the workaround for now,

Image

Expected Behavior

The junit-output-path argument sets the expected JUnit output path properly.

Actual Behavior

The JUnit report is generated in the default path.

Steps to Reproduce

  1. Explicitly enable JUnit reporter with env TUNIT_ENABLE_JUNIT_REPORTER (pwsh $env:TUNIT_ENABLE_JUNIT_REPORTER=1)
  2. Run dotnet test --junit-output-path ".\results\junit.xml"
  3. The xml file is in MyApp.UnitTests/bin/Debug/net10.0/TestResults/MyApp.UnitTests-junit.xml

TUnit Version

1.5.60

.NET Version

.NET 10

Operating System

Windows

IDE / Test Runner

dotnet CLI (dotnet test / dotnet run)

Error Output / Stack Trace

Additional Context

No response

IDE-Specific Issue?

  • I've confirmed this issue occurs when running via dotnet test or dotnet run, not just in my IDE

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions