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

Source directories set through glob syntax are ignored

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • prism-api-plugin
    • None
    • jenkins 2.452.3; coverage-plugin 1.16.1

      I have a project with multiple (ie, ~100) modules. From the project directory, code is in

      foo/src
      bar/src
      baz/src
      (etc)

      and coverage reports are in

      foo/generated/reports/jacoco/test/jacocoTestReport.xml
      bar/generated/reports/jacoco/test/jacocoTestReport.xml
      baz/generated/reports/jacoco/test/jacocoTestReport.xml
      (etc)

      My coverage DSL block is

      recordCoverage(
          sourceDirectories: [[path: 'glob:*/src']],
          tools: [[pattern: '*/generated/reports/jacoco/test/jacocoTestReport.xml']]
      )
      

      The plugin is able to find coverage reports in the expected directories:

      [Coverage] Successfully parsed file '/var/lib/jenkins/workspace/main/foo/generated/reports/jacoco/test/jacocoTestReport.xml'
      [Coverage] MODULE: 100.00% (1/1)
      [Coverage] PACKAGE: 25.00% (1/4)
      [Coverage] FILE: 11.11% (1/9)
      [Coverage] CLASS: 18.18% (2/11)
      [Coverage] METHOD: 4.26% (4/94)
      [Coverage] LINE: 1.48% (6/405)
      [Coverage] BRANCH: 1.59% (1/63)
      [Coverage] INSTRUCTION: 2.20% (40/1815)
      [Coverage] COMPLEXITY: 127
      [Coverage] COMPLEXITY_MAXIMUM: 6
      [Coverage] COMPLEXITY_DENSITY: 127/405
      [Coverage] LOC: 405
      [Coverage] Successfully processed file 'foo/generated/reports/jacoco/test/jacocoTestReport.xml'
      

      but is unable to resolve any source code, and doesn't search the path I set:

      [Coverage] [-ERROR-] Errors while resolving source files on agent:
      [Coverage] [-ERROR-] - Source file 'ca/uvic/dmas/core/system/ui/services/LayoutAccount.java' not found
      [Coverage] [-ERROR-]   ... skipped logging of 5588 additional errors ...
      [Coverage] Resolving source code files...
      [Coverage] Searching for source code files in '/var/lib/jenkins/workspace/main/src/main/java'
      [Coverage] -> finished resolving of absolute paths (found: 0, not found: 5589)
      

      In addition, the Snippet Generator reports an error when I set the source path to "glob:*/src":

            drulli Ulli Hafner
            pconley Patrick Conley
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: