Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-72726

Unable to use glob syntax to configure source directories

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Minor Minor
    • coverage-plugin
    • None

      This is my DSL block:

      recordCoverage(
              failOnError: true,
              sourceCodeEncoding: 'UTF-8',
              sourceDirectories: [[path: "glob:$projectDir/*/src/**"]],
              tools: [[parser: 'JACOCO', pattern: "$projectDir/*/build/reports/kover/report.xml"]],
              sourceCodeRetention: 'MODIFIED'
      ) 

      where projectDir resolves to a Gradle product component (multi-module project) of a monorepo workspace (let's call this "foo"). Now, when I execute a build and record the coverage it seems to totally ignore the source directory:

      ...
      COMPLEXITY_DENSITY: 654/1832
      LOC: 1832
      Successfully processed file 'path/to/build/reports/kover/report.xml'
      Resolving source code files...
      Searching for source code files in '/home/jenkins/workspace/..redacted_PR-80/src/main/java'
      -> finished resolving of absolute paths (found: 0, not found: 307)
      Obtaining action of reference build 
      ...

      I figured the actual path resolving happens within the prism plugin and that any prefix like glob: or regex: is not evaluated at all on the plugin's side, which puzzles me a lot.

      Now, when I use the glob-less source parameter to just point at the subdirectory (i.e. sourceDirectories: [[path: projectDir]]), no sources are found either:

      ...
      Searching for source code files in:
      -> /home/jenkins/workspace/...redacted_PR-80/src/main/java
      -> /home/jenkins/workspace/...redacted_PR-80/foo/
      -> finished resolving of absolute paths (found: 0, not found: 307)
      Obtaining action of reference build 

       

            drulli Ulli Hafner
            deadfish Thomas Keler
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: