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

SurefireArchiver ignores updated results when multiple testing plug-ins use the same reports directory

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • maven-plugin
    • None

      This problem occurs if the POM configures multiple testing plug-ins which all output to the same directory and the previous results are still present in the reports directory when the build starts. The SurefireArchiver remembers all existing result files when processing the first test MOJO execution, which misleads it to ignoring updated results produced by subsequent test MOJO executions in the same build.

      One solution would be to record both the existing file and its last modified timestamp and on processing subsequent test MOJOs only reject the same file if its timestamp is unchanged.

      I have prepared a fix, for which I am awaiting legal approval to submit a Pull Request.

          [JENKINS-31524] SurefireArchiver ignores updated results when multiple testing plug-ins use the same reports directory

          Adrian Price added a comment -

          Fixed in Pull Request #56.

          Adrian Price added a comment - Fixed in Pull Request #56 .

          Code changed in jenkins
          User: demonfiddler
          Path:
          src/main/java/hudson/maven/reporters/SurefireArchiver.java
          http://jenkins-ci.org/commit/maven-plugin/5945f85d9d12b430315cf2124dde0727197a395f
          Log:
          [FIXED JENKINS-31524]

          • Handle the case where existing test results have been updated by a subsequent test MOJO execution within the same build.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: demonfiddler Path: src/main/java/hudson/maven/reporters/SurefireArchiver.java http://jenkins-ci.org/commit/maven-plugin/5945f85d9d12b430315cf2124dde0727197a395f Log: [FIXED JENKINS-31524] Handle the case where existing test results have been updated by a subsequent test MOJO execution within the same build.

          Code changed in jenkins
          User: Adrian Price
          Path:
          src/main/java/hudson/maven/reporters/SurefireArchiver.java
          src/main/java/hudson/maven/reporters/TestMojo.java
          src/test/java/hudson/maven/reporters/SurefireArchiverDetectTestMojosTest.java
          src/test/java/hudson/maven/reporters/SurefireArchiverUnitTest.java
          http://jenkins-ci.org/commit/maven-plugin/45712ad8938580c1ae1a8c76095917f119d3f0be
          Log:
          Implement Oleg's code review suggestions:

          • replace extraneous tab characters with spaces
          • follow Oracle coding standards
          • remove unnecessary null check
          • add test for JENKINS-31258 'detect test Mojo identified by Jenkins Maven Property'
          • add test for JENKINS-31524 'ensure updated existing results are counted'

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Adrian Price Path: src/main/java/hudson/maven/reporters/SurefireArchiver.java src/main/java/hudson/maven/reporters/TestMojo.java src/test/java/hudson/maven/reporters/SurefireArchiverDetectTestMojosTest.java src/test/java/hudson/maven/reporters/SurefireArchiverUnitTest.java http://jenkins-ci.org/commit/maven-plugin/45712ad8938580c1ae1a8c76095917f119d3f0be Log: Implement Oleg's code review suggestions: replace extraneous tab characters with spaces follow Oracle coding standards remove unnecessary null check add test for JENKINS-31258 'detect test Mojo identified by Jenkins Maven Property' add test for JENKINS-31524 'ensure updated existing results are counted'

          Code changed in jenkins
          User: Olivier Lamy
          Path:
          src/main/java/hudson/maven/reporters/SurefireArchiver.java
          src/main/java/hudson/maven/reporters/TestMojo.java
          src/main/resources/hudson/maven/Messages.properties
          src/test/java/hudson/maven/MojoInfoBuilder.java
          src/test/java/hudson/maven/reporters/SurefireArchiverDetectTestMojosTest.java
          src/test/java/hudson/maven/reporters/SurefireArchiverUnitTest.java
          src/test/java/hudson/maven/reporters/TestMojoTest.java
          http://jenkins-ci.org/commit/maven-plugin/3ba74bd9564ce7af7300825341e4d392a2fa61bc
          Log:
          Merge pull request #56 from demonfiddler/master

          Merge fixes for JENKINS-31258 and JENKINS-31524.
          As it's merged now @demonfiddler please document the new expression in the wiki page.

          Compare: https://github.com/jenkinsci/maven-plugin/compare/0223184e413c...3ba74bd9564c

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Olivier Lamy Path: src/main/java/hudson/maven/reporters/SurefireArchiver.java src/main/java/hudson/maven/reporters/TestMojo.java src/main/resources/hudson/maven/Messages.properties src/test/java/hudson/maven/MojoInfoBuilder.java src/test/java/hudson/maven/reporters/SurefireArchiverDetectTestMojosTest.java src/test/java/hudson/maven/reporters/SurefireArchiverUnitTest.java src/test/java/hudson/maven/reporters/TestMojoTest.java http://jenkins-ci.org/commit/maven-plugin/3ba74bd9564ce7af7300825341e4d392a2fa61bc Log: Merge pull request #56 from demonfiddler/master Merge fixes for JENKINS-31258 and JENKINS-31524 . As it's merged now @demonfiddler please document the new expression in the wiki page. Compare: https://github.com/jenkinsci/maven-plugin/compare/0223184e413c...3ba74bd9564c

          Adrian Price added a comment -

          Wiki updated with a description of the new mechanism.

          Adrian Price added a comment - Wiki updated with a description of the new mechanism.

          Fixed in 2.13

          Arnaud Héritier added a comment - Fixed in 2.13

            Unassigned Unassigned
            adrianp Adrian Price
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: