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

Fail test if no tests ran

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Resolved (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Component/s: xunit-plugin
    • Labels:
      None
    • Environment:
      Jenkins + xunit latest and greatest
    • Similar Issues:

      Description

      I have a test application that exited with error code 0 (which was wrong and is fixed now). It did not run any tests and created the attached Junit report basically stating that 0 tests ran, 0 tests passed and 0 tests failed.

      I would suggest to set the verdict of the test to at least unstable or give the possibility to configure that at least 1 test has to be executed and otherwise fail the job.

        Attachments

          Activity

          Hide
          nfalco Nikolas Falco added a comment -

          That kind of option is demanded to a specific type of reporter.
          By default xUnit comes with JUnit reporter that by default fails if no test ran (Skip if there are no test files).

          Show
          nfalco Nikolas Falco added a comment - That kind of option is demanded to a specific type of reporter. By default xUnit comes with JUnit reporter that by default fails if no test ran (Skip if there are no test files).
          Hide
          nfalco Nikolas Falco added a comment -

          I will add a new threshold based on the number of test, so you could set failure/unstable based on the total count of tests/new tests.

          Show
          nfalco Nikolas Falco added a comment - I will add a new threshold based on the number of test, so you could set failure/unstable based on the total count of tests/new tests.
          Hide
          nfalco Nikolas Falco added a comment -

          Use the new Passed Threshold to fail the build in case the total number of test is less or equals the threshold (in this case 0)

          Show
          nfalco Nikolas Falco added a comment - Use the new Passed Threshold to fail the build in case the total number of test is less or equals the threshold (in this case 0)

            People

            • Assignee:
              nfalco Nikolas Falco
              Reporter:
              bruce Dirk Kuypers
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: