test-reporter
test-reporter copied to clipboard
.NET, Cobertura, Code Climate generates invalid results
Hi, I recently decided to set up Code Climate for my repository, but I've been having a lot of issues.
I generate coverage reports with Coverlet, using the following command:
dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura RomanizationTests/RomanizationTests.csproj
This creates RomanizationTests/coverage.cobertura.xml
. As far as I can tell this file is without issue, and correct.
I then process it with the following:
./cc-test-reporter format-coverage --input-type cobertura --output RomanizationTests/codeclimate.json RomanizationTests/coverage.cobertura.xml
./cc-test-reporter upload-coverage --input RomanizationTests/codeclimate.json
The file is successfully uploaded to Code Climate, but I get the following error:
With the full error:
{
"message": "Invalid path part \"/\"",
"file_document": "{
\"_id\"=>BSON::ObjectId('601f0378f8aa324544001911'),
\"type\"=>\"test_file_reports\",
\"blob_id\"=>\"ef8306fb90e8f744279ee7f4df8eece02ff9d4d5\",
\"coverage\"=>\"[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,0,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,3,3,null,null,null,null,3,3,67749,79047,3,null,null,null,null,null,null,null,null,null,null,null,0,0,null,null,null,null,null,null,null,null,null,null,16,56,null,null,null,null,null,null,null,null,null,null,null,2,2,2,2,null,null,null,null,null,null,null,null,null,null,null,19,19,53,53,19,53,136,53,119,19,53,53,19,null,null,null,null,null,null,null,null,null,null,19]\",
\"covered_percent\"=>90,
\"covered_strength\"=>4919.266666666666,
\"line_counts\"=>{
\"missed\"=>3,
\"covered\"=>27,
\"total\"=>30
},
\"path\"=>\"Romanization//Languages/Japanese/KanjiReadings.cs\",
\"test_report_id\"=>BSON::ObjectId('601f0378c4082a440f001a32')
}"
}
The issue is clearly with the double /
in the path, but it makes no sense. Romanization/Languages/Japanese/KanjiReadings.cs
is about halfway through the file list, and there are way more files than just it in the repo.
Am I missing something obvious, or is this a known issue?
For reference
I just tried it using the lcov
format instead of cobertura
, and the test seems to be valid.
This seems to be an issue with the Cobertura format in some regard.
@efueger Is this on our radar already?