Derby
  1. Derby
  2. DERBY-6401

Create a test option to stop running Junit tests after first failure or error

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 10.10.2.0, 10.11.1.1
    • Component/s: Test
    • Labels:
      None
    • Issue & fix info:
      Patch Available

      Description

      Sometimes when debugging issues, it would be convenient to have the tests stop after the first failure or error. Add System property option derby.tests.stopAfterFirstFail to do this.

        Activity

        Kathey Marsden created issue -
        Hide
        Kathey Marsden added a comment -

        Here is a patch that makes this change. It is a bit hokey the way it just abruptly exits in BaseTestCase.runBare(). I suppose the cleaner way to do it is to make a TestRunner to extend junit.textui.TestRunner, but that would not be something I could check in. Anyway, please review and let me know if you object to this change or see a better way. I noticed the ant task for junit has a haltonerror and haltonfailure attributes but don't see anything for the junit.textui.TestRunner

        Show
        Kathey Marsden added a comment - Here is a patch that makes this change. It is a bit hokey the way it just abruptly exits in BaseTestCase.runBare(). I suppose the cleaner way to do it is to make a TestRunner to extend junit.textui.TestRunner, but that would not be something I could check in. Anyway, please review and let me know if you object to this change or see a better way. I noticed the ant task for junit has a haltonerror and haltonfailure attributes but don't see anything for the junit.textui.TestRunner
        Kathey Marsden made changes -
        Field Original Value New Value
        Attachment derby-6401_diff.txt [ 12611636 ]
        Kathey Marsden made changes -
        Issue & fix info Patch Available [ 10102 ]
        Hide
        Myrna van Lunteren added a comment -

        I took a quick look at it looks reasonable to me - we'd use this option only while actively debugging, I imagine...Some comments to clarify would be nice.

        Show
        Myrna van Lunteren added a comment - I took a quick look at it looks reasonable to me - we'd use this option only while actively debugging, I imagine...Some comments to clarify would be nice.
        Hide
        Mamta A. Satoor added a comment -

        Kathey, I took a look at the patch and for the purpose that it is serving, I think it is ok for it to just exit out when the first test fails with error.

        Show
        Mamta A. Satoor added a comment - Kathey, I took a look at the patch and for the purpose that it is serving, I think it is ok for it to just exit out when the first test fails with error.
        Kathey Marsden made changes -
        Assignee Kathey Marsden [ kmarsden ]
        Hide
        ASF subversion and git services added a comment -

        Commit 1539729 from Kathey Marsden in branch 'code/trunk'
        [ https://svn.apache.org/r1539729 ]

        DERBY-6401 Create a test option to stop running Junit tests after first failure or error
        Adds test option. If run with -Dderby.tests.stopAfterFirstFail=true tests will stop after first failure or error

        Show
        ASF subversion and git services added a comment - Commit 1539729 from Kathey Marsden in branch 'code/trunk' [ https://svn.apache.org/r1539729 ] DERBY-6401 Create a test option to stop running Junit tests after first failure or error Adds test option. If run with -Dderby.tests.stopAfterFirstFail=true tests will stop after first failure or error
        Hide
        ASF subversion and git services added a comment -

        Commit 1541258 from Kathey Marsden in branch 'code/branches/10.10'
        [ https://svn.apache.org/r1541258 ]

        DERBY-6401 Create a test option to stop running Junit tests after first failure or error

        merge revision 1539829 from trunk

        Show
        ASF subversion and git services added a comment - Commit 1541258 from Kathey Marsden in branch 'code/branches/10.10' [ https://svn.apache.org/r1541258 ] DERBY-6401 Create a test option to stop running Junit tests after first failure or error merge revision 1539829 from trunk
        Kathey Marsden made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 10.10.1.3 [ 12324247 ]
        Fix Version/s 10.11.0.0 [ 12324243 ]
        Resolution Fixed [ 1 ]
        Myrna van Lunteren made changes -
        Component/s Test [ 11413 ]
        Myrna van Lunteren made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Myrna van Lunteren made changes -
        Fix Version/s 10.10.2.0 [ 12326659 ]
        Fix Version/s 10.10.1.4 [ 12324247 ]

          People

          • Assignee:
            Kathey Marsden
            Reporter:
            Kathey Marsden
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development