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

Performance plugin doesn't parse JUnit reports correctly

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Fixed
    • performance-plugin
    • None

    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.

      Attachments

        Issue Links

          Activity

            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.

            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.

            Proposed patch to fix the parsing of JUnit reports.

            cdman Attila-Mihaly Balazs added a comment - Proposed patch to fix the parsing of JUnit reports.

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

            thanks

            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

            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

            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

            patch applied in version 1.7

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

            People

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

              Dates

                Created:
                Updated:
                Resolved: