question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

dotnet test eats quotes in TestRunParameters

See original GitHub issue

Note

Issues in this repo are for tracking bugs, feature requests and questions for the tasks in this repo

For a list:
https://github.com/Microsoft/azure-pipelines-tasks/tree/master/Tasks

If you have an issue or request for the Azure Pipelines service, use developer community instead:

https://developercommunity.visualstudio.com/spaces/21/index.html )

Required Information

Entering this information will route you directly to the right team and expedite traction.

Question, Bug, or Feature?
Type: Bug

Enter Task Name: DotNetCoreCLI@2

list here (V# not needed):
https://github.com/Microsoft/azure-pipelines-tasks/tree/master/Tasks

Environment

  • Server - Azure Pipelines or TFS on-premises? Azure pipelines

    • If using TFS on-premises, provide the version:

    • If using Azure Pipelines, provide the account name, team project name, build definition name/build number:

  • Agent - Hosted or Private:

    • If using Hosted agent, provide agent queue name:

    • If using private agent, provide the OS of the machine running the agent and the agent version:

Issue Description

- task: DotNetCoreCLI@2
  inputs:
    command: 'test'
    arguments: '-- TestRunParameters.Parameter(name=%22EdiStagingFunctionsKey%22,value=%22key2%22) TestRunParameters.Parameter(name=%22EdiAADKey%22,value=%22key1%22)'

This is the only way I am able to pass TestRunParameters to the run. This was reported here: https://github.com/microsoft/vstest/issues/2387 and the escaping was fixed in vstest and dotnet sdk, but some additional rules are applied on the AzDO task side. Because for example \ is replaced by / and quotes are eaten by the task. So it is not true that what works on the command line works in the task (mentioned here https://github.com/microsoft/azure-pipelines-tasks/issues/10712#issuecomment-552195220 ) and none of the approaches described there worked for me, except for providing the quotes as URL escapes %22.

Ideally the user would be able to copy paste from the command line, where \" is the way to escape the quotes properly.

Task logs

https://dev.azure.com/jajares/params/_build?definitionId=6&_a=summary

Troubleshooting

Checkout how to troubleshoot failures and collect debug logs: https://docs.microsoft.com/en-us/vsts/build-release/actions/troubleshooting

Error logs

[Insert error from the logs here for a quick overview]

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:5
  • Comments:21 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
saquibkhancommented, Jun 24, 2020

yes @nohwnd once this issue https://github.com/microsoft/azure-pipelines-task-lib/issues/648 is fixed the escape sequence will work

1reaction
ALM-at-RZLcommented, Mar 17, 2021

WORKAROUND Will work with “.NET Core”-Build-Task with Command “test” on on-premise server 2019.0.1. Later not tested. But maybe…

-- "TestRunParameters.Parameter(name=\\\"<name1>\\\", value=\\\"<value1>\\\")" "TestRunParameters.Parameter(name=\\\"<name2>\\\", value=\\\"<value2>\\\")"

Read more comments on GitHub >

github_iconTop Results From Across the Web

c# - dotnet test runsettings passing testrun parameters with ...
I need to pass multiple values like browser type, headless mode, device name at runtime via command line.
Read more >
Dennis Adolfi (@dadolfi) / Twitter
Teaching #dotnet Testing at a local university. Look at all those excited faces! Imagine.
Read more >
Override TestRunParameters in .NET Core - Magnus Montin
Below is an example of a test that will fail unless the value of the supplied password parameter is equal to “secret”.
Read more >
Untitled
London eye capsule dimensions, One proportion z test practice problems, ... Sklepy cynamonowe ulica krokodyli interpretacja, Pouting lips quotes, ...
Read more >
Untitled
Bae quotes and pics, Proletariado ska-p letra, Revilla business park map, ... Red banksia flowers, O571 foto, Closers mlb 2015, Pfhgkfnf uhjcc, I-eat...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found