You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
HtmlReport rejects path-valued --report-html-filename arguments even though the HTML engine already writes through Path.Combine(outputDirectory, fileName). This makes HTML inconsistent with TRX and blocks report-path customization for the HTML reporter.
For comparison, src/Platform/Microsoft.Testing.Extensions.TrxReport/TrxCommandLine.cs:45-48 explicitly allows relative or absolute paths for --report-trx-filename.
Why this is a real issue
A command like --report-html --report-html-filename subdir\report.html fails validation today, while the analogous TRX scenario is supported. The HTML engine would already place a relative path under the results directory (and Path.Combine would also honor rooted paths), so the current restriction is a CLI-only inconsistency that blocks a concrete customization scenario.
Suggested resolution
Align --report-html-filename with TRX semantics:
allow relative and absolute paths,
sanitize/validate only the leaf file name,
create missing intermediate directories before writing.
Resolved by #8523, which aligned --report-html-filename with the TRX semantics: relative and absolute paths are now accepted, only the leaf file name is validated (must end in .html), and missing intermediate directories are created before writing. Verified on main: HtmlReportGeneratorCommandLine.ValidateOptionArgumentsAsync now uses Path.GetFileName + EscapesResultsDirectory (same shape as TrxReportGeneratorCommandLine), and HtmlReportEngine.GenerateReportCoreAsync calls _fileSystem.CreateDirectory for the resolved directory. Microsoft.Testing.Extensions.UnitTests (which contains HtmlReportGeneratorCommandLineTests and HtmlReportEngineTests) passes on net462/net472/net8.0/net9.0.
Activity
Evangelink commentedon May 25, 2026
Resolved by #8523, which aligned
--report-html-filenamewith the TRX semantics: relative and absolute paths are now accepted, only the leaf file name is validated (must end in.html), and missing intermediate directories are created before writing. Verified onmain:HtmlReportGeneratorCommandLine.ValidateOptionArgumentsAsyncnow usesPath.GetFileName+EscapesResultsDirectory(same shape asTrxReportGeneratorCommandLine), andHtmlReportEngine.GenerateReportCoreAsynccalls_fileSystem.CreateDirectoryfor the resolved directory.Microsoft.Testing.Extensions.UnitTests(which containsHtmlReportGeneratorCommandLineTestsandHtmlReportEngineTests) passes on net462/net472/net8.0/net9.0.