azure-pipelines-tasks: PublishCodeCoverageResults can't find its own html report when the agent is installed to a dir with a space in the name

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: PublishCodeCoverageResults@1

Environment

  • Server - Azure Pipelines

  • Agent - Hosted or Private:

      - Self hosted agent: vsts-agent-win-x64-2.168.2
    
    • Windows Server 2019 (1809)

Issue Description

Task is configured to process a cobertura-coverage.xml produced by jest

        - task: PublishCodeCoverageResults@1
          inputs:
            codeCoverageTool: 'Cobertura'
            summaryFileLocation: './coverage/cobertura-coverage.xml'
            failIfCoverageEmpty: true

On execution, the task processes this and writes the report to a new (unexpected?) directory

Writing report file 'D:\Azure\index.htm'

This and other output files representing the source files are written correctly. The cobertura-coverage.xml is uploaded as an artifact.

However the task then states

Generated code coverage html report: D:\Azure Agent\vsts-agent-win-x64-2.168.2\_work\_temp\cchtml

and generates a warning

##[warning]Directory not found: 'D:\Azure Agent\vsts-agent-win-x64-2.168.2\_work\_temp\cchtml

There is nothing in that _temp directory.

If I specifically set reportDirectory to 'D:\Azure' within the task it complains

[warning]Ignoring coverage report directory with Html content as we are auto-generating Html content

https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/test/publish-code-coverage-results?view=azure-devops doesn’t document the reportDirectory option aside to say it’s optional.

Have I come across a bug or is my configuration wrong?

Many thanks

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 17 (6 by maintainers)

Most upvoted comments

Hi @DevRCRun, we’ve fixed this issue, but it may take a few weeks until the changes are deployed. We’ll let you know once they’re available.

@adamconnelly yes. We will try and patch this immediately.

It looks like the change in https://github.com/microsoft/azure-pipelines-tasks/pull/13861 to quote the path to the ReportGenerator.dll causes this task to break on Linux agents. I’ve added a full description of the problem here: https://github.com/microsoft/azure-pipelines-tasks/issues/13914#issuecomment-731019183.

Can this change be temporarily reverted until a fix that doesn’t break the task can be made?