Uploaded image for project: 'Zanata'
  1. ZNTA-2266

Failing JS unit tests should fail the build

    Details

    • Tested Version/s:
      None
    • Sprint:

      Description

      According to the build log, master build #301 had a failing storybook test (later fixed by https://github.com/zanata/zanata-platform/commit/a874be9a93da0e1d1a294c60d0913df0363651a6) but was still considered a successful build.

      You can trigger a similar test failure by adding this:
      expect("THIS SHOULD FAIL").toEqual("something else")
      to one of the tests, eg server/zanata-frontend/src/frontend/app/components/DraggableVersionPanels/DraggableVersionPanels.test.js

      Our Jenkinsfile builds use the option maven.test.failure.ignore because we want Maven to log and continue after failing JUnit tests, allowing Jenkins to handle them, but the javascript tests are not currently producing JUnit XML files, thus Jenkins doesn't notice the failures.

      Ultimately, it would be best to have Jest output a file format which Jenkins can parse (perhaps by switching to the Jenkins XUnit Plugin, or perhaps by having Jest output junit.xml), but for now we should just ensure that failing tests actually fail the build.

        Attachments

          Issue links

            Activity

              People

              • Assignee:
                sflanigan Sean Flanigan
                Reporter:
                sflanigan Sean Flanigan
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: