custom command with quotes in argument on windows go-agent

167 views
Skip to first unread message

Marat

unread,
Mar 9, 2018, 6:41:13 PM3/9/18
to go-cd
I am running code coverage job on windows go agent and trying to pass dotcover custom command with following arguments:

analyse
/TargetExecutable="c:\Program Files (x86)\NUnit 2.6.4\bin\nunit-console.exe"
/TargetArguments="/nologo /noshadow /include=Test /xml=result.xml src\bin\Test.dll"
/Output=Test.html
/ReportType=HTML
/Filters=-:module=Test

Gives following error

[go] Task: dotcover analyse "/TargetExecutable=\"c:\Program Files (x86)\NUnit 2.6.4\bin\nunit-console.exe\"" "/TargetArguments=\"/nologo /noshadow /include=Test /xml=result.xml src\bin\Test.dll\"" /Output=report\Test.html /ReportType=HTML /AttributeFilters=*.ExcludeFromCodeCoverage /Filters=-:module=Test
took: 0.390s
JetBrains dotCover Console Runner 2017.3.3. Build 111.0.20180302.72821
Copyright (c) 2009-2018 JetBrains s.r.o. All rights reserved.
Failed to parse xml parameters
Configuration file is not found
Type 'dotCover help' for usage.

I have tried so many different options to escape those quotes, but still cannot make it work.

What can I try to pass it correctly? Any suggestions are appreciated.

Thank you.

similar cases:

Ketan Padegaonkar

unread,
Mar 12, 2018, 10:28:36 PM3/12/18
to go...@googlegroups.com
The stuff in `<arg>` may need XML escaping as appropriate, I'm just providing an example below. Consider putting in powershell code in a powershell script and invoking that script instead, since it's much more straight forward to do.

<exec command="dotcover">
  <arg>analyze</arg>
  <arg>/TargetExecutable="c:\Program Files (x86)\NUnit 2.6.4\bin\nunit-console.exe"</arg>
  <arg>...</arg>
</exec>

--
You received this message because you are subscribed to the Google Groups "go-cd" group.
To unsubscribe from this group and stop receiving emails from it, send an email to go-cd+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages