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

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

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Critical Critical
    • maven-plugin
    • None
    • Linux

      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.

          [JENKINS-9770] Maven 2/3 job not failing when tests cannot be run

          Per Rovegård created issue -

          kutzi added a comment -

          Related to JENKINS-6700. Maybe the same root cause

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

          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 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 made changes -
          Resolution New: Duplicate [ 3 ]
          Status Original: Open [ 1 ] New: Resolved [ 5 ]
          Jenkins IRC Bot made changes -
          Component/s New: maven-plugin [ 16033 ]
          Component/s Original: maven2 [ 15487 ]
          R. Tyler Croy made changes -
          Workflow Original: JNJira [ 139953 ] New: JNJira + In-Review [ 188768 ]

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

              Created:
              Updated:
              Resolved: