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

TestNG shouldn't look for result files if build was aborted

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor Minor
    • testng-plugin
    • None

      When the build was aborted the plugin still seems to scan the workspace for TestNG result files.
      This is only a minor issue, but could save some time. See build log below where we could have spared 50 seconds by this.

      17:48:11 Build was aborted
      17:48:11 [WARNINGS] Skipping publisher since build result is ABORTED
      17:48:11 Archiving artifacts
      17:48:11 ERROR: Ignore Problem expanding maven opts macros org.jenkinsci.plugins.tokenmacro.TokenMacro
      17:48:11 Checking console output
      17:48:11 Looking for TestNG results report in workspace using pattern: */target/surefire-reports/*/testng-results.xml
      17:49:08 [ci-game] evaluating rule: Build result
      17:49:08 [ci-game] evaluating rule: Increased number of failed tests

          [JENKINS-12046] TestNG shouldn't look for result files if build was aborted

          nalin_makar added a comment -

          fix checked in. will be available in v.30

          nalin_makar added a comment - fix checked in. will be available in v.30

          nalin_makar added a comment -

          This seems like incorrect behavior. See JENKINS-12648.

          nalin_makar added a comment - This seems like incorrect behavior. See JENKINS-12648 .

          nalin_makar added a comment -

          Reverting change made for this fix. will be reverted in v0.32

          nalin_makar added a comment - Reverting change made for this fix. will be reverted in v0.32

          Code changed in jenkins
          User: Nalin Makar
          Path:
          README
          src/main/java/hudson/plugins/testng/Publisher.java
          http://jenkins-ci.org/commit/testng-plugin-plugin/523dfea36f91a1425d1f377101e9207d02a48afc
          Log:
          Fixed: JENKINS-12648 - Results should be reported for failed/aborted builds as well (Reverted fix for JENKINS-12046 in v0.30)

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Nalin Makar Path: README src/main/java/hudson/plugins/testng/Publisher.java http://jenkins-ci.org/commit/testng-plugin-plugin/523dfea36f91a1425d1f377101e9207d02a48afc Log: Fixed: JENKINS-12648 - Results should be reported for failed/aborted builds as well (Reverted fix for JENKINS-12046 in v0.30)

          kutzi added a comment -

          I agree that the plugin should look for results if a build is a failure (not looking for them in that case was btw never requested in this issue)

          I don't agree with looking for results in case of aborted builds. In the worst case an aborted build could leave broken, invalid result files which could let the reporter crash. Even in the best case that all results are written already, I don't see any good reason to parse them when the build is already aborted, as:

          a) it takes unnecessary time (often I abort build, becuase I want the next build for theat job to start immediately)
          b) the results are of no real value as the user doesn't know how many of all test have already been running. So deltas are of no value

          Also, other reporters seem to do the same (can not speak for all obviously). See e.g. above in the log string:
          "17:48:11 [WARNINGS] Skipping publisher since build result is ABORTED"

          kutzi added a comment - I agree that the plugin should look for results if a build is a failure (not looking for them in that case was btw never requested in this issue) I don't agree with looking for results in case of aborted builds. In the worst case an aborted build could leave broken, invalid result files which could let the reporter crash. Even in the best case that all results are written already, I don't see any good reason to parse them when the build is already aborted, as: a) it takes unnecessary time (often I abort build, becuase I want the next build for theat job to start immediately) b) the results are of no real value as the user doesn't know how many of all test have already been running. So deltas are of no value Also, other reporters seem to do the same (can not speak for all obviously). See e.g. above in the log string: "17:48:11 [WARNINGS] Skipping publisher since build result is ABORTED"

          kutzi added a comment -

          Reopening, as I still think my last comment stays. IMO there's a clear difference between aborted and failed builds and I can see no value in parsing test results for aborted builds.

          kutzi added a comment - Reopening, as I still think my last comment stays. IMO there's a clear difference between aborted and failed builds and I can see no value in parsing test results for aborted builds.

          kutzi added a comment -

          Could you please reconsider this issue?

          kutzi added a comment - Could you please reconsider this issue?

          nalin_makar added a comment -

          Kutzi, I'll make the change to not look for results in case build is aborted. And, continue looking for reports in case of build failures.

          nalin_makar added a comment - Kutzi, I'll make the change to not look for results in case build is aborted. And, continue looking for reports in case of build failures.

          Code changed in jenkins
          User: Nalin Makar
          Path:
          README
          pom.xml
          src/main/java/hudson/plugins/testng/Publisher.java
          src/test/java/hudson/plugins/testng/PublisherTest.java
          http://jenkins-ci.org/commit/testng-plugin-plugin/fa2df404a99ef2fd27ca48ef2fb3bac5337f539c
          Log:
          Fixed: JENKINS-12046 - TestNG shouldn't look for result files if build was aborted (again!)

          Also added a test for this.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Nalin Makar Path: README pom.xml src/main/java/hudson/plugins/testng/Publisher.java src/test/java/hudson/plugins/testng/PublisherTest.java http://jenkins-ci.org/commit/testng-plugin-plugin/fa2df404a99ef2fd27ca48ef2fb3bac5337f539c Log: Fixed: JENKINS-12046 - TestNG shouldn't look for result files if build was aborted (again!) Also added a test for this.

          kutzi added a comment -

          Thanks!

          kutzi added a comment - Thanks!

            nalin_makar nalin_makar
            kutzi kutzi
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: