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

Maven 2/3 job not failing when tests cannot be run

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved (View Workflow)
    • Critical
    • Resolution: Duplicate
    • maven-plugin
    • None
    • Linux

    Description

      I have a Maven 2/3 project in Jenkins. Some days ago I discovered that the tests in the project couldn't be run, but Jenkins had marked the last build as successful.

      In the suite file, one developer had added the name of a class that didn't exist (wrong package). This means that TestNG failed early since it couldn't load the class. In the Jenkins log I could see the failure:

      04:02:42 -------------------------------------------------------
      04:02:42 T E S T S
      04:02:42 -------------------------------------------------------
      04:02:42 Running TestSuite
      04:02:42 [ERROR] There are test failures.

      But shortly thereafter in the log:

      04:02:46 projectSucceeded ...

      I worked around the problem (i.e., that Jenkins doesn't fail the build despite the error) by adding -Dmaven.test.failure.ignore=false to MAVEN_OPTS.

      I believe that Jenkins sets maven.test.failure.ignore to true in order to be able to mark a project as unstable instead of failing. If that is the case, then it's clearly a bug that it doesn't detect that no test cases were run whatsoever.

      Attachments

        Issue Links

          Activity

            provegard Per Rovegård created issue -
            kutzi kutzi added a comment -

            Related to JENKINS-6700. Maybe the same root cause

            kutzi kutzi added a comment - Related to JENKINS-6700 . Maybe the same root cause
            kutzi kutzi made changes -
            Field Original Value New Value
            Link This issue is related to JENKINS-6700 [ JENKINS-6700 ]
            kutzi kutzi made changes -
            Link This issue duplicates JENKINS-6700 [ JENKINS-6700 ]
            kutzi kutzi made changes -
            Link This issue is related to JENKINS-6700 [ JENKINS-6700 ]
            kutzi kutzi added a comment -

            I think this should actually be the same as JENKINS-6700.

            Please reopen if the fix for that issue doesn't fix your problem.

            kutzi kutzi added a comment - I think this should actually be the same as JENKINS-6700 . Please reopen if the fix for that issue doesn't fix your problem.
            kutzi kutzi made changes -
            Resolution Duplicate [ 3 ]
            Status Open [ 1 ] Resolved [ 5 ]
            ircbot Jenkins IRC Bot made changes -
            Component/s maven-plugin [ 16033 ]
            Component/s maven2 [ 15487 ]
            rtyler R. Tyler Croy made changes -
            Workflow JNJira [ 139953 ] JNJira + In-Review [ 188768 ]

            People

              Unassigned Unassigned
              provegard Per Rovegård
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: