Docket plays nicely with testify suites. This directory contains examples showing how you can use docket with a testify suite.
TestDocketRunAtTopLevel
shows how to wrap an entire suite.
The EntireSuite
struct embeds both a suite.Suite
(needed by testify/suite
)
and a docket.Context
. 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.
suite.Run()
will run, which runs the subtest methods attached to the
EntireSuite
struct.
TestDocketRunForSingleSubtest
shows how to wrap a single subtest of a suite.
The SubtestSuite
struct only needs to embed a suite.Suite
. The suite 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 testify suite.