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

Performance plugin doesn't parse JUnit reports correctly

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Component/s: performance-plugin
    • Labels:
      None
    • Environment:

      Description

      The performance plugin doesn't parse the JUnit reports correctly (it uses the JMeter parser for them). This can be fixed by harcoding JUnitParser instead of JMeterParser in PerformanceReportMap, so that it looks like the following (around lines 62-63):

      if (files != null)

      { addAll(new JUnitParser("").parse(buildAction.getBuild(), Arrays.asList(files), listener)); }

      However a better fix is needed which selects the appropriate parser based on the current configuration.

        Issue Links

          Activity

          Hide
          cdman Attila-Mihaly Balazs added a comment -

          After more debugging it seems to me that I've found the issue: each parser should put its performance reports in its subdirectory (ie. performance-reports/JUnit, performance-reports/JMeter, etc), with the files in performance-reports directory being interpreted as JMeter (for backward compatibility). However this doesn't seem to be fully implemented in at least two ways:

          • the copying of files doesn't respect this pattern (rather it dumps everything into performance-reports)
          • when listing the performance reports (ie PerformanceProjectAction.getPerformanceReportList), it doesn't search in subdirectories.

          I attached a patch which fixes both of these issues, and additionally it changes the subdirectory name from being based on the class name on a string, because the class name can contain special characters (like "$") which might not be well liked by some filesystems.

          Please let me know if the diagnosis is correct. Also, one possible issue I see is that if two reports are present in two directories (ie a Junit report with name report.xml and a JMeter report with name report.xml), they will override each other in some data structures and the wrong data will be shown. Usually this shouldn't happen, given the naming convention of the unit test reports.

          Show
          cdman Attila-Mihaly Balazs added a comment - After more debugging it seems to me that I've found the issue: each parser should put its performance reports in its subdirectory (ie. performance-reports/JUnit, performance-reports/JMeter, etc), with the files in performance-reports directory being interpreted as JMeter (for backward compatibility). However this doesn't seem to be fully implemented in at least two ways: the copying of files doesn't respect this pattern (rather it dumps everything into performance-reports) when listing the performance reports (ie PerformanceProjectAction.getPerformanceReportList), it doesn't search in subdirectories. I attached a patch which fixes both of these issues, and additionally it changes the subdirectory name from being based on the class name on a string, because the class name can contain special characters (like "$") which might not be well liked by some filesystems. Please let me know if the diagnosis is correct. Also, one possible issue I see is that if two reports are present in two directories (ie a Junit report with name report.xml and a JMeter report with name report.xml), they will override each other in some data structures and the wrong data will be shown. Usually this shouldn't happen, given the naming convention of the unit test reports.
          Hide
          cdman Attila-Mihaly Balazs added a comment -

          Proposed patch to fix the parsing of JUnit reports.

          Show
          cdman Attila-Mihaly Balazs added a comment - Proposed patch to fix the parsing of JUnit reports.
          Hide
          manolo Manuel Carrasco added a comment -

          I Saw the patch, I think I could take a look in a couple of days and release.

          thanks

          Show
          manolo Manuel Carrasco added a comment - I Saw the patch, I think I could take a look in a couple of days and release. thanks
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Manolo Carrasco
          Path:
          src/main/java/hudson/plugins/performance/PerformanceBuildAction.java
          src/main/java/hudson/plugins/performance/PerformanceProjectAction.java
          src/main/java/hudson/plugins/performance/PerformancePublisher.java
          src/main/java/hudson/plugins/performance/PerformanceReportMap.java
          http://jenkins-ci.org/commit/performance-plugin/9688edeb307c76453d2a8892646f6506054b591b
          Log:
          Fix JENKINS-9655 patch by Attila-Mihaly

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Manolo Carrasco Path: src/main/java/hudson/plugins/performance/PerformanceBuildAction.java src/main/java/hudson/plugins/performance/PerformanceProjectAction.java src/main/java/hudson/plugins/performance/PerformancePublisher.java src/main/java/hudson/plugins/performance/PerformanceReportMap.java http://jenkins-ci.org/commit/performance-plugin/9688edeb307c76453d2a8892646f6506054b591b Log: Fix JENKINS-9655 patch by Attila-Mihaly
          Hide
          manolo Manuel Carrasco added a comment -

          patch applied in version 1.7

          Show
          manolo Manuel Carrasco added a comment - patch applied in version 1.7

            People

            • Assignee:
              manolo Manuel Carrasco
              Reporter:
              cdman Attila-Mihaly Balazs
            • Votes:
              2 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: