microsoft / azure-pipelines-tasks

Tasks for Azure Pipelines
https://aka.ms/tfbuild
MIT License
3.42k stars 2.58k forks source link

Publish Code Coverage failing with ##[error]NoInputFiles #19270

Open GavinToddlds opened 7 months ago

GavinToddlds commented 7 months ago

Task name

PublishCodeCoverageResults

Task version

2.x

Environment type (Please select at least one enviroment where you face this issue)

Azure DevOps Server type

dev.azure.com (formerly visualstudio.com)

Azure DevOps Server Version (if applicable)

No response

Operation system

Ubuntu 22.04

Question

We just moved from the V1 to the V2 and on projects that dont have any coverage were getting ##[warning]No code coverage results were found to publish.
but no when we moved to V2 if that same teams runs they are getting
##[warning]No code coverage results were found to publish.
##[warning]Cant find loc string for key: NoInputFiles
##[error]NoInputFiles

coming from this function call
https://github.com/microsoft/azure-pipelines-tasks/blob/8b5f195ca075a581e57e9f1df6a8c12bc83a3cf4/Tasks/PublishCodeCoverageResultsV2/publishcodecoverageresults.ts#L27

This is the line throwing the error 
https://github.com/microsoft/azure-pipelines-tasks/blob/8b5f195ca075a581e57e9f1df6a8c12bc83a3cf4/Tasks/Common/coveragepublisher/coveragepublisher.ts#L19

We have the failIfCoverageEmpty set to false so we weren't expecting this behavior. Is this something expected?
GavinToddlds commented 7 months ago

We have a work around for teams but is this expected behavior?

henri-kohlberg commented 6 months ago

We have the same issue in our pipelines.

@GavinToddlds Did you just switch back to V1 or do you have another workaround?

GavinToddlds commented 6 months ago

No our workaround isn't great. It is just adding a parameter in our template that we validate against before running the task instead of letting it run and not publish anything.

I am still hoping to get some information back if this is expected behavior on the V2 or not.

j-d-harvey commented 6 months ago

@vinayakmsft is this something you can help with?

GavinToddlds commented 5 months ago

Is there someone who can take a look at this?