Open woeterman94 opened 1 year ago
Passing in --results-directory actually sets the parameter twice because it is already set by default and causes an error:
##[debug] h:\_work_agent_2\4\TestResults
"C:\Program Files\dotnet\dotnet.exe" test h:\_work_agent_2\4\s\App\myproject.Common.Tests\myproject.Common.Tests.csproj --logger trx --results-directory h:\_work_agent_2\_temp --configuration release --no-restore --collect "Code coverage" --logger trx --results-directory h:\_work_agent_2\4\TestResults
Option '--results-directory' only accepts a single argument but 2 were provided.
Yep, am stuck now with the same issue. Didnt find a way to avoid that the --results-directory parameter is automatically passed instead of using my parameter provided in the arguments. Kind of annoying.
documentation says: publishTestResults automatically adds "--logger trx --results-directory $(Agent.TempDirectory)" but even without this option those parameters are always added it seems. Currently I have only command, projects and arguments specified and still see those parameters appended to the test commandline.
Did you try with publishTestResults set to false? That worked for me.
Didn't try false, but removed the argument completely (which I suppose should be equal to false) PS: Note to self: read the WHOLE documentation, it states "default: true" or as such, if not provided then the --result-directory will be set by the CLI anyway.
This issue is stale because it has been open for 180 days with no activity. Remove the stale label or comment on the issue otherwise this will be closed in 5 days
Still wanted.
Hi @woeterman94, may i know what agent you are using? self hosted or Microsoft hosted ?
I was using Microsoft hosted agents back then.Op 26 dec. 2023 06:54 schreef EshitaD @.***>: Hi @woeterman94, may i know what agent you are using? self hosted or Microsoft hosted ?
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>
Didn't try false, but removed the argument completely (which I suppose should be equal to false) PS: Note to self: read the WHOLE documentation, it states "default: true" or as such, if not provided then the --result-directory will be set by the CLI anyway.
Thats correct. Documentation says: publishTestResults
Default value: true
Setting this to false
worked for me too. I use a different task to publish the test results.
Type: Feature
Enter Task Name: .NET Core - test
Environment
Server - Azure Pipelines
Issue Description
Issue Description Checking the Publish test results and code coverage option sets --results-directory to the agent's temporary directory, making it difficult to isolate a single build's test output when publishing the results of multiple data collectors.
Recommendation: Allow --results-directory to be overridden (via textbox) when Publish test results and code coverage is checked.
This would allow users to harvest the output for publishing to additional code coverage tools or overcome shortcomings in the existing tooling (such as the code coverage tab only providing a link instead of an html report).