AWS CodeBuild Code Coverage supporting clover.xml
See original GitHub issueI am using CDK to deploy a CodePipeline which then handles cross account deployments for my NodeJS Lambda. In the build stage of my CodePipeline, I would like to run unit tests and generate a code coverage report. I am using jest with the coverage flag which default creates a clover.xml for code coverage.
https://docs.aws.amazon.com/codebuild/latest/userguide/code-coverage-report.html says it supports clover.xml but I have been struggling to find a good example on how to do this, when I try to deploy my cdk pipeline stack with reports like this
reports: {
jest_reports: {
files: ['reports/CodeCoverageReport.xml'],
fileFormat: 'JUNITXML',
baseDirectory: 'reports',
},
clover_reports: {
files: ['reports/coverage/jest/clover.xml'],
fileFormat: 'CLOVERXML',
baseDirectory: 'reports',
},
},
I am getting this error:
[code_coverage_reports: [error processing report: [/codebuild/output/src245295669/src/reports/coverage/jest/clover.xml: expected element type <testsuite> but have <coverage>]]]
Is there any examples on how to do this or any advice on how to fix this?
This is 🐛 Bug Report
Issue Analytics
- State:
- Created 2 years ago
- Comments:18 (9 by maintainers)
Top Results From Across the Web
node.js - AWS CodeBuild Code Coverage supporting clover.xml
I'm trying to create two report groups for test and code coverage, the test group is working fine whereas my code coverage group...
Read more >Code coverage reports - AWS CodeBuild
Generate a code coverage report in CodeBuild. ... The following code coverage report file formats are supported: JaCoCo XML. SimpleCov JSON¹. Clover XML....
Read more >Aws Codebuild Code Coverage Supporting Clover.Xml - ADocLib
The following code coverage report file formats are supported: JaCoCo XML.SimpleCov JSON.Clover XML.Cobertura XML.CodeBuild accepts JSON code. The Cypress code ...
Read more >Codebuild Test Coverage with .Net Core : r/aws - Reddit
In Codebuild, test coverage supports these formats: JaCoCo XML. SimpleCov JSON. Clover XML. Cobertura XML. So it looks like cobertura is the ...
Read more >AWS CodeBuild Report Groups 101 - YouTube
AWS CodeBuild provides a fully managed, Docker-based build environment. You can use it in standalone mode or together with CodePipeline.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Commenting the fix here for visibility in case anyone else runs into this. What happens is the incorrect version in my original post created the report group
clover_reports
as aTEST
report type. This is because the keys were incorrect and the default isJUNITXML
. The code snippet here: https://github.com/aws/aws-cdk/issues/13867#issuecomment-810555222 is correct, all I had to do was delete the incorrectly created report group. Alternatively, one could simply rename the report group to something else.Thanks for the follow up @xrzhuang!