Kotlin / kotlinx-kover

Apache License 2.0
1.37k stars 53 forks source link

XML report for the tests results #641

Closed RomanMichailov closed 5 months ago

RomanMichailov commented 5 months ago

Can I get an XML report for the tests with this plugin? When I run the koverXmlReport and some of my tests fail I'm getting the test results in HTML format and there is no generated coverage report.

shanshin commented 5 months ago

Hi, the coverage report is created only when the test task is successfully completed.

RomanMichailov commented 5 months ago

Hi, Thanks for the quick response. yes, I understand that all the tests must be passed for the coverage report to be generated. But my question is if it is possible to get the test results in XML format? eg the output that shows which test failed and why.

shanshin commented 5 months ago

But my question is if it is possible to get the test results in XML format? eg the output that shows which test failed and why.

Sorry, but I don't quite understand the question. If you mean the report build/tests/<taskname>/index.html - then this report has nothing to do with Kover Gradle Plugin, it is generated by Gradle itself and we do not read or write its contents.

koverXmlReport - it's JaCoCo compatible coverage XML report, it does not contain information about the tests being run, only about class coverage

RomanMichailov commented 5 months ago

ok thanks for the info

shanshin commented 5 months ago

@RomanMichailov, to get information about running tests you may use XML files from dir build/test-results/<taskname>/.... There are a set of XML files that are called something like this TEST-<TestClassName>.xml (depends on the settings of the test-suites).