I have a monorepo project, created with lerna. And, I use Karma+Jasmine for the unit testing. The project structure looks as follows:
|-packages
| |-package1
| | |-coverage
| | | |-cobertura
| | | | |-coverage.xml // here goes the coverage report in cobertura format
| | | |-Browser1
| | | | |-html // here goes the reports in html (istanbul) for Browser 1
| | | |-Browser2
| | | |-html // here goes the reports in html (istanbul) for Browser 2
| | |-src
| | |-tests
| |-package2
| | |-coverage
| | | |-cobertura
| | | | |-coverage.xml
| | | |-Browser1
| | | | |-html
| | | |-Browser2
| | | |-html
| | |-src
| | |-tests
| .
| .
| .
|-karma.conf.js
The test setup is working properly and generating the html reports as well as the coverage.xml
in Cobertura format inside the each individual package. In TFS CI, I have a "Publish Code Coverage Results" build step to publish the coverage results with following values for different options:
- Code Coverage Tool:
Cobertura
- Summary File:
$(System.DefaultWorkingDirectory)\packages\*\coverage\cobertura\coverage.xml
- Report Directory:
$(System.DefaultWorkingDirectory)\packages\*\coverage
(for HTML reports)
However, the build step warns about following
Multiple file or directory matches were found. Using the first match: C:\MyAgent\path\to\packages\package1\coverage\cobertura\coverage.xml
Multiple file or directory matches were found. Using the first match: C:\MyAgent\path\to\packages\package1\coverage
Naturally it also shows the coverage results for only one package. Is there any way to publish all coverage reports without adding a build step in CI for each package?