Uploaded image for project: 'Gradle'
  1. Gradle
  2. GRADLE-1208

gradle test with JUnit 4 only reports cleanup failures when setup also failed

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Resolution: Fixed
    • Affects Version/s: 0.9.1
    • Fix Version/s: 0.9

      Description

      Given a JUnit 4 test with both setup and cleanup functions, if both of them fail, gradle only reports that the cleanup function failed. This can be very confusing because it leads the test writer to think that setup passed, which can make debugging the cleanup failure very difficult. (In my original case, the failure in setup was creating a situation that caused cleanup to fail, but since I was assuming that setup passed (no report otherwise), I couldn't understand why cleanup was failing.)
      JUnit 4's test runner, Maven 2, and IDEA all report failures of both setup and cleanup. Gradle is only reporting the failure in cleanup.
      I originally found this with a (Spock) test in Groovy, but I've confirmed it with straight JUnit4 tests in Groovy and Java - see attachments.

        Attachments

          Activity

            People

            Assignee:
            hans_d Hans Dockter
            Reporter:
            cander Charles Anderson
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: