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

SkipNoTestFiles flag ignored. Build still set to failed if test files missing

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • xunit-plugin
    • None
    • Windows Server 2003

      I have a parameterised build that allows me to skip the Unit Tests as required, but the build fails when this is used because:

      With the checkboxes:
      "Skip if there are no test files" checked
      "Fail the build if the results were not updated this run" unchecked
      I would expect the absence of the test files not to fail the build.

      BUILD SUCCESSFUL
      Total time: 16 minutes 34 seconds
      [xUnit] [INFO] - Starting to record.
      [xUnit] [INFO] - Processing PHPUnit-3.x (default)
      [xUnit] [INFO] - [PHPUnit-3.x (default)] - No test report file(s) were found with the pattern 'build\*\report\*.xml' relative to 'C:\jenkins-node-workspace\workspace\Reports-Package' for the testing framework 'PHPUnit-3.x (default)'.  Did you enter a pattern relative to the correct directory?  Did you generate the result report(s) for 'PHPUnit-3.x (default)'?
      [xUnit] [WARNING] - No test reports found for the metric 'PHPUnit' with the resolved pattern 'build\*\report\*.xmlIgnore.
      [xUnit] [INFO] - Setting the build status to FAILURE
      [xUnit] [INFO] - Stopping recording.
      Build step 'Publish xUnit test result report' changed build result to FAILURE
      Archiving artifacts
      Sending e-mails to: xxx
      Finished: FAILURE
      

          [JENKINS-18443] SkipNoTestFiles flag ignored. Build still set to failed if test files missing

          Code changed in jenkins
          User: Gregory Boissinot
          Path:
          src/main/java/org/jenkinsci/plugins/xunit/XUnitProcessor.java
          http://jenkins-ci.org/commit/xunit-plugin/90224cdd4c458c6a43b9a7cee54a36f7b44e4460
          Log:
          Fix JENKINS-18443

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Gregory Boissinot Path: src/main/java/org/jenkinsci/plugins/xunit/XUnitProcessor.java http://jenkins-ci.org/commit/xunit-plugin/90224cdd4c458c6a43b9a7cee54a36f7b44e4460 Log: Fix JENKINS-18443

          Should be fixed in 1.82

          Gregory Boissinot added a comment - Should be fixed in 1.82

          x29a added a comment -

          Unfortunately, it still doesnt work.

          On version 1.82 (jenkins 1.544), i have enabled "Skip if there are no test files" for all configurations and get:

          Archiving artifacts
          [xUnit] [INFO] - Starting to record.
          [xUnit] [INFO] - Processing CppUnit-1.12.1 (default)
          [xUnit] [INFO] - [CppUnit-1.12.1 (default)] - No test report file(s) were found with the pattern '*UnitTestU.log' relative to 'e:\jenkins\workspace\job' for the testing framework 'CppUnit-1.12.1 (default)'.  Did you enter a pattern relative to the correct directory?  Did you generate the result report(s) for 'CppUnit-1.12.1 (default)'?
          [xUnit] [WARNING] - No test reports found for the metric 'CppUnit' with the resolved pattern '*UnitTestU.log'.
          [xUnit] [INFO] - Failing BUILD because 'set build failed if errors' option is activated.
          [xUnit] [INFO] - There are errors when processing test results.
          [xUnit] [INFO] - Skipping tests recording.
          [xUnit] [INFO] - Stop build.
          Build step 'Publish xUnit test result report' changed build result to FAILURE
          Finished: FAILURE
          

          x29a added a comment - Unfortunately, it still doesnt work. On version 1.82 (jenkins 1.544), i have enabled "Skip if there are no test files" for all configurations and get: Archiving artifacts [xUnit] [INFO] - Starting to record. [xUnit] [INFO] - Processing CppUnit-1.12.1 ( default ) [xUnit] [INFO] - [CppUnit-1.12.1 ( default )] - No test report file(s) were found with the pattern '*UnitTestU.log' relative to 'e:\jenkins\workspace\job' for the testing framework 'CppUnit-1.12.1 ( default )' . Did you enter a pattern relative to the correct directory? Did you generate the result report(s) for 'CppUnit-1.12.1 ( default )' ? [xUnit] [WARNING] - No test reports found for the metric 'CppUnit' with the resolved pattern '*UnitTestU.log' . [xUnit] [INFO] - Failing BUILD because 'set build failed if errors' option is activated. [xUnit] [INFO] - There are errors when processing test results. [xUnit] [INFO] - Skipping tests recording. [xUnit] [INFO] - Stop build. Build step 'Publish xUnit test result report' changed build result to FAILURE Finished: FAILURE

          Fixed for me.
          Check your version

          Gregory Boissinot added a comment - Fixed for me. Check your version

          It works for me as well. Thank you for the fix!

          Alexander Artemov added a comment - It works for me as well. Thank you for the fix!

          Code changed in jenkins
          User: Mathieu Cantin
          Path:
          src/main/java/org/jenkinsci/plugins/xunit/XUnitProcessor.java
          http://jenkins-ci.org/commit/xunit-plugin/fbb835f47592f7271a0ea7e2f16bfe961a0bf652
          Log:
          Fix JENKINS-18443

          If we have 2 tests, A and B, both having the "Skip if there are no test
          files" checkbox checked and parser A has test files, but parser B
          doesn't. The result of parser A is ignored because parser B doesn't have
          any files.

          I see the reason of the line added for JENKINS-18443, but that just
          hides the real problem.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Mathieu Cantin Path: src/main/java/org/jenkinsci/plugins/xunit/XUnitProcessor.java http://jenkins-ci.org/commit/xunit-plugin/fbb835f47592f7271a0ea7e2f16bfe961a0bf652 Log: Fix JENKINS-18443 If we have 2 tests, A and B, both having the "Skip if there are no test files" checkbox checked and parser A has test files, but parser B doesn't. The result of parser A is ignored because parser B doesn't have any files. I see the reason of the line added for JENKINS-18443 , but that just hides the real problem.

          Code changed in jenkins
          User: Gregory Boissinot
          Path:
          src/main/java/org/jenkinsci/plugins/xunit/XUnitProcessor.java
          http://jenkins-ci.org/commit/xunit-plugin/be6f3ecc808d03e0d57afbddf5aa0e9362ccc1a9
          Log:
          Merge pull request #20 from harcher81/master

          Fix JENKINS-18443

          Compare: https://github.com/jenkinsci/xunit-plugin/compare/68dda81eadd7...be6f3ecc808d

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Gregory Boissinot Path: src/main/java/org/jenkinsci/plugins/xunit/XUnitProcessor.java http://jenkins-ci.org/commit/xunit-plugin/be6f3ecc808d03e0d57afbddf5aa0e9362ccc1a9 Log: Merge pull request #20 from harcher81/master Fix JENKINS-18443 Compare: https://github.com/jenkinsci/xunit-plugin/compare/68dda81eadd7...be6f3ecc808d

          Code changed in jenkins
          User: Jean-Jacques Lafay
          Path:
          src/main/java/org/jenkinsci/plugins/xunit/XUnitProcessor.java
          http://jenkins-ci.org/commit/xunit-plugin/bfbd152110312588b99d20a0f94305c8c07cd02c
          Log:
          Fix JENKINS-18443 when running on slaves

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jean-Jacques Lafay Path: src/main/java/org/jenkinsci/plugins/xunit/XUnitProcessor.java http://jenkins-ci.org/commit/xunit-plugin/bfbd152110312588b99d20a0f94305c8c07cd02c Log: Fix JENKINS-18443 when running on slaves

          Code changed in jenkins
          User: Gregory Boissinot
          Path:
          src/main/java/org/jenkinsci/plugins/xunit/XUnitProcessor.java
          http://jenkins-ci.org/commit/xunit-plugin/531de4bb33d769c33d91a4547fc5322ca026f238
          Log:
          Merge pull request #21 from lanfeust69/master

          Fix JENKINS-18443 when running on slaves

          Compare: https://github.com/jenkinsci/xunit-plugin/compare/be6f3ecc808d...531de4bb33d7

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Gregory Boissinot Path: src/main/java/org/jenkinsci/plugins/xunit/XUnitProcessor.java http://jenkins-ci.org/commit/xunit-plugin/531de4bb33d769c33d91a4547fc5322ca026f238 Log: Merge pull request #21 from lanfeust69/master Fix JENKINS-18443 when running on slaves Compare: https://github.com/jenkinsci/xunit-plugin/compare/be6f3ecc808d...531de4bb33d7

          Eric Donovan added a comment - - edited

          Hi I'm seeing this issue on xUnit 1.95, on Jenkins 1.565.1. That is, the inabililty to save the option to skip if no report files are found.

          Eric Donovan added a comment - - edited Hi I'm seeing this issue on xUnit 1.95, on Jenkins 1.565.1. That is, the inabililty to save the option to skip if no report files are found.

            gbois Gregory Boissinot
            iainmackay85 Iain Mackay
            Votes:
            4 Vote for this issue
            Watchers:
            14 Start watching this issue

              Created:
              Updated:
              Resolved: