Docket integrates well with
github.com/bloomberg/go-testgroup
.
This directory contains examples showing how you can use docket with a test
group.
TestDocketRunAtTopLevel
shows how to wrap an entire suite.
The EntireGroup
struct contains a docket.Context
member. When I call
docket.Run()
, I pass a pointer to that part of the struct so docket will fill
it in.
When I run the test with docket enabled, docket will run the containing test
entrypoint TestDocketRunAtTopLevel
inside the tester
Docker Compose service.
testgroup.RunSerially()
will run, which runs the subtest methods attached to
the EntireGroup
struct.
TestDocketRunForSingleSubtest
shows how to wrap a single subtest of a rgoup.
The SubtestGroup
struct has two subtests:
TestOutsideDocker
does not use docket at all.TestInsideDocker
wraps its body in adocket.Run()
call, just as you would if you weren't using a test group.