Skip to content

feat: improve test context (#149) - #149

Merged
tkrop merged 1 commit into
mainfrom
context
Jul 24, 2026
Merged

feat: improve test context (#149)#149
tkrop merged 1 commit into
mainfrom
context

Conversation

@tkrop

@tkrop tkrop commented Jun 4, 2026

Copy link
Copy Markdown
Owner

Description

This pull request improves the usability of the test.Context by applying a generic test.Tester interface, improving the semantic of the test.New(...) function, and adding a generic context.Mode(...) function - currently only used for test.Parallel or test,Sequential test mode setup. However, it may be an idea to also encode the currently separated test expectations test.Success and test.Failure in it.

Besides, this breaking change is simplifying the default setup of new isolated test.Contexts, via the new test.Tester interface, that now allows dedicated access to the test context via its factory functions, so that the new convenience functions test.Run(...), test.RunSeq(...) and test.RunSafe(...) may make naming-wise more sense.

The pull request finally adds a small convenience method test.Okay(any, bool) mirroring test.Must(any, error), and updates all dependencies including support for the latest go-1.26.5.

Related Issue(s)

fixes #149.

Testing

Run make test, since the code is highly unit tested.

Checklist

  • I have reviewed and tested the changes thoroughly.
  • I have added appropriate documentation to the code for clarity.
  • I have communicated the consequences of the updates to customers.

Signed-off-by: Tronje Krop tronje.krop@jactors.de

@tkrop tkrop self-assigned this Jun 4, 2026
tkrop added a commit that referenced this pull request Jun 4, 2026
Signed-off-by: Tronje Krop <tronje.krop@jactors.de>
tkrop added a commit that referenced this pull request Jun 5, 2026
Signed-off-by: Tronje Krop <tronje.krop@jactors.de>
tkrop added a commit that referenced this pull request Jun 5, 2026
Signed-off-by: Tronje Krop <tronje.krop@jactors.de>
tkrop added a commit that referenced this pull request Jun 6, 2026
Signed-off-by: Tronje Krop <tronje.krop@jactors.de>
tkrop added a commit that referenced this pull request Jun 6, 2026
Signed-off-by: Tronje Krop <tronje.krop@jactors.de>
tkrop added a commit that referenced this pull request Jun 6, 2026
Signed-off-by: Tronje Krop <tronje.krop@jactors.de>
tkrop added a commit that referenced this pull request Jun 8, 2026
Signed-off-by: Tronje Krop <tronje.krop@jactors.de>
tkrop added a commit that referenced this pull request Jun 8, 2026
Signed-off-by: Tronje Krop <tronje.krop@jactors.de>
tkrop added a commit that referenced this pull request Jun 8, 2026
Signed-off-by: Tronje Krop <tronje.krop@jactors.de>
tkrop added a commit that referenced this pull request Jul 1, 2026
Signed-off-by: Tronje Krop <tronje.krop@jactors.de>
@tkrop
tkrop marked this pull request as ready for review July 24, 2026 15:30
tkrop added a commit that referenced this pull request Jul 24, 2026
Signed-off-by: Tronje Krop <tronje.krop@jactors.de>
tkrop added a commit that referenced this pull request Jul 24, 2026
Signed-off-by: Tronje Krop <tronje.krop@jactors.de>
tkrop added a commit that referenced this pull request Jul 24, 2026
Signed-off-by: Tronje Krop <tronje.krop@jactors.de>
Signed-off-by: Tronje Krop <tronje.krop@jactors.de>
@tkrop
tkrop merged commit 821d6f6 into main Jul 24, 2026
9 checks passed
@tkrop
tkrop deleted the context branch July 24, 2026 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant