Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

suite: fix SetupSubTest and TearDownSubTest execution order #1471

Commits on Oct 16, 2023

  1. fix: SetupSubTest and TearDownSubTest execution order

    There were two problems with the order of execution in the Suite.Run() method:
    - One could not access the correct testing context ("s.T()") inside the SetupSubTest and TearDownSubTest methods. If the testing context was used for e.g. assertions of mocks in the TearDownSubTest, the results would not be "attached" to the correct test in the test output.
    - The behavior was different to the order of execution for "root" tests (see lines 167-201) regarding the SetupTest and TearDownTest methods. This could confuse users of the library.
    
    Also the logic to be deferred was joined together. This was fine beforehand because a panic in the TearDownSubTest would have had no influence on the "suite.SetT(oldT)". Now since a panic in the TearDownSubTest would lead to omitting the "suite.SetT(oldT)" this defer was split into two separate defers.
    linusbarth committed Oct 16, 2023
    Configuration menu
    Copy the full SHA
    916ce79 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    83e44bc View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    4657972 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    aa01ed0 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    ac5cd69 View commit details
    Browse the repository at this point in the history

Commits on Oct 17, 2023

  1. Configuration menu
    Copy the full SHA
    c8efd3c View commit details
    Browse the repository at this point in the history

Commits on Oct 18, 2023

  1. fix: panic behavior for subtests

    This fix adds panic handling for subtests which will achieve:
    - subtests will fail for the correct test context when panicking
    - the test execution is not stopped; the next subtest will be executed
    linusbarth committed Oct 18, 2023
    Configuration menu
    Copy the full SHA
    91478fe View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    c18759c View commit details
    Browse the repository at this point in the history