dotnet test log results issue with a filename that includes a space - Can't escape the space
See original GitHub issueI know spaces in file paths are a terrible idea, but I need to deal with this due to the CI system I am using which clones repos into a path that includes a directory with a space in its name I also want all of the test results for multiple projects in a single output directory
I have used a simplistic scenario to illustrate
What I would like to know is if i can escape a space in the path ?
Steps to reproduce
Using powershell on windows
cd /tmp
mkdir test-issue
cd ./test-issue
ls
dotnet new xunit
dotnet test
dotnet test --logger 'trx;logfilename=res.trx'
# Now lets try to use a log file name with a space - Failure !
dotnet test --logger 'trx;logfilename=test res.trx'
> Microsoft (R) Test Execution Command Line Tool Version 15.3.0-preview-20170628-02
> Copyright (c) Microsoft Corporation. All rights reserved.
> The test source file "C:\tmp\test-issue\res.trx" provided was not found.
> The test source file "C:\tmp\test-issue\res.trx" provided was not found.
# Tried the following escaping all failed
dotnet test --logger 'trx;logfilename="test res.trx"'
dotnet test --logger "trx;logfilename='test res.trx'"
Expected behavior
Would like to be able to escape the logfilename path
Actual behavior
Can’t escape the logfilename path
Environment data
.NET Command Line Tools (2.0.0)
Product Information: Version: 2.0.0 Commit SHA-1 hash: cdcd1928c9
Runtime Environment: OS Name: Windows OS Version: 10.0.15063 OS Platform: Windows RID: win10-x64 Base Path: C:\utilities\dotnet-core-sdks\sdk\2.0.0\
Microsoft .NET Core Shared Framework Host
Version : 2.0.0 Build : e8b8861ac7faf042c87a5c2f9f2d04c98b69f28d
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:7 (6 by maintainers)
Top GitHub Comments
Hi @pmcgrath. Thanks for reporting this issue!
With the latest build out of the
master
branch, I’m unable to reproduce the problem.With PowerShell (as it supports both
'
and"
for arguments):With cmd.exe (supports only
"
for arguments):I am able to reproduce the issue with 2.0.0, however.
I’m looking into tracking down what might have changed to fix this issue. From the error you’re seeing, I suspect argument wasn’t being properly quoted in 2.0.0, resulting in “res.trx” being interpreted as a separate argument to vstest.
Thanks @peterhuene for following through on this issue.