Closed dyapp1435 closed 1 year ago
ReportGenerator generates its results only based on the information available in the supplied coverages files (here: -reports:**/*cobertura*.xml
).
One of theses files must contain the "deleted" file, otherwise it would not be available in the report.
One way to debug this further:
**/*cobertura*.xml
.Thanks for the quick response! Yeah, now that I'm looking, Cobertura is definitely generating an html report with the deleted file's name. Would this issue be better submitted to the Cobertura repo?
Would this issue be better submitted to the Cobertura repo?
I think so, but first you should check if the file is really not available anywhere in your code base.
Every build in Azure Devops runs on a clean agent. Jest/Cobertura don't "remember" a deleted file. It must somehow still be present.
I can confirm that it's definitely not present anywhere in our repository.
I've also attempted running jest with the --clearCache and --noCache options with no change. This also does not seem to be a Cobertura issue, as when I run the test step with the --codeCoverage flag locally it does not pick up the deleted files. It only happens when using the Report Generator task in our Azure DevOps pipeline.
Could you please create an artifact of the coverage file supplied to ReportGenerator in your Azure DevOps pipeline.
See my comment above.
I'm pretty sure the file is listed in some of the Cobertura files.
Sorry for the delay. It's definitely listed in the Cobertura files, I can see it here:
Should this just go to the Cobertura GitHub board?
The highlighted file is an HTML file. An XML file must also exist here (ReportGenerator parses the XML file).
But the result will be the same: The HTML/XML contains the name of the deleted file. I have no idea how Cobertura comes up with this file. Perhaps the corresponding GitHub board can help.
Describe the bug It seems that ReportGenerator is caching deleted files when run in an Azure DevOps CI pipeline. Jest correctly outputs the current list of files, but the generated Cobertura report contains a file that was deleted months ago.
What I've tried
To Reproduce The following input helps to reproduce your issue: