Hey guys, I am trying to upload coverage from my kotlin project using kotlinx-kover. Some details:
ALM Used: Github
CI system used: Github Actions
Language: Kotlin/Java
My xml report path is set like this in the base $project_dir/build.gradle.kts file
property(
"sonar.coverage.jacoco.xmlReportPaths",
"build/reports/kover/merged/xml/report.xml"
)
with the filesystem looking like
build.gradle.kts
build/ ## report file goes here under build/reports/
application1/
I have kotlinx-kover configured to use merged reports, as the application folder is configured as a sub project, and have set jacoco as the coverage agent. This outputs a single xml report in the $project_dir/build/reports/kover/merged/xml/report.xml
Heres the details from my GHA:
- name: Build and analyze
run: ./gradlew build koverMergedXmlReport -i
- name: ls filesystem
if: always()
run: |
echo ">> printing pwd"
pwd
echo ">> cat file"
cat build/reports/kover/merged/xml/report.xml
- name: Run Sonar
run: ./gradlew sonar --info
in the GHA logs, i can see the report.xml file being printed, so its there:
>> cat file
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><!DOCTYPE report PUBLIC "-//JACOCO//DTD Report 1.1//EN" "report.dtd"><report name=":"><sessioninfo id="small-standard-runner-eks-pool-pod"...etc
however during the sonar step, i am seeing this error:
No coverage report can be found with sonar.coverage.jacoco.xmlReportPaths='build/reports/kover/merged/xml/report.xml'. Using default locations: target/site/jacoco/jacoco.xml,target/site/jacoco-it/jacoco.xml,build/reports/jacoco/test/jacocoTestReport.xml
No report imported, no coverage information will be imported by JaCoCo XML Report Importer
The file is clearly there as proven by the prior step, why can’t it find this file? Does it think it is invalid?