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

maven-plugin insists on Surefire to run tests

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      The current implementation of Hudson's Maven support needlessly requires the use of maven-surefire-plugin for executing tests. If an alternative test runner plugin is used, Hudson's maven-plugin will not recognize test results, meaning that UNSTABLE builds are wrongly considered to be FAILED builds, and also that build status does not include test result reports.

      This behavior is due to the fact that the SurefireArchiver class includes conditional logic that insists that the test runner plugin is Surefire. If this conditional check is removed, then test results are correctly found and interpreted, and unstable builds are no longer considered failed builds.

      I've attached a simple patch that demonstrates this. Even though the contents of the patch may not be the correct fix, it at least illustrates the nature of the problem.

        Attachments

          Issue Links

            Activity

            Hide
            dogfood dogfood added a comment -

            Integrated in jenkins_main_trunk #2201
            Changelog and cleanup for JENKINS-8334 (Revision 6b1cc47024172238a65d45f28db84f13495d8780)

            Result = SUCCESS
            Christoph Kutzinski : 6b1cc47024172238a65d45f28db84f13495d8780
            Files :

            • maven-plugin/src/main/java/hudson/maven/reporters/SurefireArchiver.java
            • changelog.html
            • core/src/main/java/hudson/tasks/junit/TestResult.java
            Show
            dogfood dogfood added a comment - Integrated in jenkins_main_trunk #2201 Changelog and cleanup for JENKINS-8334 (Revision 6b1cc47024172238a65d45f28db84f13495d8780) Result = SUCCESS Christoph Kutzinski : 6b1cc47024172238a65d45f28db84f13495d8780 Files : maven-plugin/src/main/java/hudson/maven/reporters/SurefireArchiver.java changelog.html core/src/main/java/hudson/tasks/junit/TestResult.java
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Christoph Kutzinski
            Path:
            src/main/java/hudson/maven/reporters/SurefireArchiver.java
            src/test/java/hudson/maven/MojoInfoBuilder.java
            src/test/java/hudson/maven/reporters/SurefireArchiverDetectTestMojosTest.java
            src/test/java/hudson/maven/reporters/SurefireArchiverUnitTest.java
            http://jenkins-ci.org/commit/maven-plugin/61f6325a51ca37b4663cc096a79056755c764b94
            Log:
            Add regression test for SurefireArchiver test mojo detection JENKINS-8334
            Originally-Committed-As: 900341f4912e3d055c30cc12ea5ed05310bf97df

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Christoph Kutzinski Path: src/main/java/hudson/maven/reporters/SurefireArchiver.java src/test/java/hudson/maven/MojoInfoBuilder.java src/test/java/hudson/maven/reporters/SurefireArchiverDetectTestMojosTest.java src/test/java/hudson/maven/reporters/SurefireArchiverUnitTest.java http://jenkins-ci.org/commit/maven-plugin/61f6325a51ca37b4663cc096a79056755c764b94 Log: Add regression test for SurefireArchiver test mojo detection JENKINS-8334 Originally-Committed-As: 900341f4912e3d055c30cc12ea5ed05310bf97df
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Christoph Kutzinski
            Path:
            src/main/java/hudson/maven/MojoInfo.java
            src/main/java/hudson/maven/reporters/SurefireArchiver.java
            http://jenkins-ci.org/commit/maven-plugin/05d64e51bb883e2d684980ad8a8f52ce89761226
            Log:
            [FIXED JENKINS-8334] use heuristics to detect test-mojos instead of relying on hard-coded plugin names
            Originally-Committed-As: 2c0b577aabbd7aa1518eaf2f8111f80f7c549f20

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Christoph Kutzinski Path: src/main/java/hudson/maven/MojoInfo.java src/main/java/hudson/maven/reporters/SurefireArchiver.java http://jenkins-ci.org/commit/maven-plugin/05d64e51bb883e2d684980ad8a8f52ce89761226 Log: [FIXED JENKINS-8334] use heuristics to detect test-mojos instead of relying on hard-coded plugin names Originally-Committed-As: 2c0b577aabbd7aa1518eaf2f8111f80f7c549f20
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Christoph Kutzinski
            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/4d603c4c96f155821f15b0298928a512eea44599
            Log:
            Refactored detection of test mojos to simplify SurefireArchiver class JENKINS-8334
            Originally-Committed-As: b68b84eaa04e521ac99c02257d91802d1ab9f3ff

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Christoph Kutzinski 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/4d603c4c96f155821f15b0298928a512eea44599 Log: Refactored detection of test mojos to simplify SurefireArchiver class JENKINS-8334 Originally-Committed-As: b68b84eaa04e521ac99c02257d91802d1ab9f3ff
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Christoph Kutzinski
            Path:
            src/main/java/hudson/maven/reporters/SurefireArchiver.java
            http://jenkins-ci.org/commit/maven-plugin/487579aacc73afca228d4533598b4f44877da108
            Log:
            Changelog and cleanup for JENKINS-8334
            Originally-Committed-As: 6b1cc47024172238a65d45f28db84f13495d8780

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Christoph Kutzinski Path: src/main/java/hudson/maven/reporters/SurefireArchiver.java http://jenkins-ci.org/commit/maven-plugin/487579aacc73afca228d4533598b4f44877da108 Log: Changelog and cleanup for JENKINS-8334 Originally-Committed-As: 6b1cc47024172238a65d45f28db84f13495d8780

              People

              Assignee:
              kutzi kutzi
              Reporter:
              jvoegele jvoegele
              Votes:
              2 Vote for this issue
              Watchers:
              8 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: