azure-pipelines-tasks: PublishCodeCoverageResults@2 fails to write report to reportDirectory
Required Information
Type: Bug Task Name: PublishCodeCoverageResults@2
Environment
- Server: Azure Pipelines
- Agent: MS hosted Ubuntu-22.04
Issue Description
PublishCodeCoverageResults@2 produces an invalid command to the underlying program
Ran with the following template
steps:
- task: UseDotNet@2
inputs:
packageType: 'sdk'
version: '2.1.x'
- task: PublishCodeCoverageResults@2
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: '$(Agent.TempDirectory)/**/coverage.cobertura.xml'
Error logs
Starting: PublishCodeCoverageResults
==============================================================================
Task : Publish code coverage results
Description : Publish any of the code coverage results from a build
Version : 2.215.0
Author : Microsoft Corporation
Help : https://docs.microsoft.com/azure/devops/pipelines/tasks/test/publish-code-coverage-results
==============================================================================
CoveragePublisher.Console 1.0.0
Copyright (C) 2023 CoveragePublisher.Console
ERROR(S):
Option 'reportDirectory
/home/vsts/work/_temp/c2a6c08c-dd26-417e-925a-9a9502100a9e' is unknown.
--reportDirectory (Default: ) Path where html report will be generated.
--sourceDirectory (Default: ) List of source directories separated by ';'.
--timeout (Default: 120) Timeout for CoveragePublisher in seconds.
--noTelemetry (Default: false) Disable telemetry data collection.
--help Display this help screen.
--version Display version information.
value pos. 0 Required. Set of coverage files to be published.
Found 2 result(s) matching pattern: /home/vsts/work/_temp/**/coverage.cobertura.xml
/home/vsts/work/_temp/595a46d5-239e-47eb-8b18-452278343573/coverage.cobertura.xml
/home/vsts/work/_temp/_fv-az363-480_2023-02-13_14_17_13/In/fv-az363-480/coverage.cobertura.xml
/opt/hostedtoolcache/dotnet/dotnet /home/vsts/work/_tasks/PublishCodeCoverageResults_2a7ebc54-c13e-490e-81a5-d7561ab7cd97/2.215.0/node_modules/coveragepublisher/CoveragePublisher/CoveragePublisher.Console.dll "/home/vsts/work/_temp/595a46d5-239e-47eb-8b18-452278343573/coverage.cobertura.xml" "/home/vsts/work/_temp/_fv-az363-480_2023-02-13_14_17_13/In/fv-az363-480/coverage.cobertura.xml" --reportDirectory /home/vsts/work/_temp/c2a6c08c-dd26-417e-925a-9a9502100a9e
Finishing: PublishCodeCoverageResults
About this issue
- Original URL
- State: open
- Created a year ago
- Reactions: 29
- Comments: 28
Commits related to this issue
- https://github.com/microsoft/azure-pipelines-tasks/issues/17756 — committed to etherfactor/sqlmonitor by etherfactor a year ago
- Unit/Integration Tests (#4) * Added a base for unit/integration tests, as well as some basic tests * More tests and some experimentation on errors * Added additional tests * Cleaned up test ... — committed to etherfactor/sqlmonitor by etherfactor a year ago
Ran into the exact same issue. Seems like it’s time for a
@3
. Why do we need to use a dotnet version that’s end of life anyway?Hi, everyone! I did an workaround for this issue. Im just bypassing the native task and running it as a CmdLine. Notice the tasks UseDotnet@2 and PublishCodeCoverageResult@2 are nedded to download dependencies.
In short based on what I see here and in my own use of PublishCodeCoverageResults:
I’ll go with the middle option for now: @1.
So is this task actually working now or should I not waste time trying to get it to work 🗡️? Seems that something got updated somewhere and the solution that was presented earlier no longer works.
Seems that something is broken again…
It’s worked flawlessly for the past few months but I get a framework mismatch now ( as if it does not respect that I stated to use 2.1.x earlier…’
Tried to use UseDotNet@2 ver 2.x but no dice
And of course if you try to use 3.1.x you get:
I don’t think I’ll be only one to say that this is getting irritating…
My though exactly - this whole thing is just a big facepalm. And why can’t the mess be encapsulated instead of irritating all ADO users, after all it’s not exactly rocket-science going on here…
According to @vinayakmsft it has been fixed in master: https://github.com/microsoft/azure-pipelines-tasks/pull/18401#issuecomment-1622946934