jenkinsci / code-coverage-api-plugin

Deprecated Jenkins Code Coverage Plugin
https://plugins.jenkins.io/code-coverage-api/
MIT License
112 stars 75 forks source link

Sources for relative paths are not found #692

Closed TVycas closed 1 year ago

TVycas commented 1 year ago

Jenkins and plugins versions report

code-coverage-api 4.3.0 Jenkins 2.387.2 JAVA 11.0.12 Linux

What Operating System are you using (both controller, and any agents involved in the problem)?

Linux

Reproduction steps

Using kotlinx.kover code coverage reports in a multimodule Android project. Kover generates Jacoco style XML reports.

Jenkins pipeline script:

recordCoverage(
        tools: [[parser: 'JACOCO'], [pattern: "build/reports/kover/merged/xml/report.xml"]],
        id: 'kover',
        name: 'Kover Code Coverage',
        sourceDirectories: [[path: "*/module-name/src/main/java/"]]
        sourceCodeRetention: 'EVERY_BUILD'
)

Expected Results

Source files for module-name are found.

Actual Results

[Coverage] Resolving source code files...
[Coverage] Searching for source code files in:
[Coverage] -> /var/lib/jenkins/workspace/PR-22196/src/main/java
[Coverage] -> /var/lib/jenkins/workspace/PR-22196/*/module-name/src/main/java/
[Coverage] -> finished resolving of absolute paths (found: 0, not found: 3585)

The source files are not found. From the logs, looks like only absolute paths are searched for.

Also, seems like /var/lib/jenkins/workspace/PR-22196/src/main/java will always get searched.

Anything else?

Would be good to know what would be the advised way to handle sources in multi-module projects.

uhafner commented 1 year ago

There are no wildcards supported for source paths.