package
module
Version:
v0.0.0-...-f32bd8a
Opens a new window with list of versions in this module.
Published: Mar 4, 2024
License: MIT
Opens a new window with license information.
Imports: 3
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
Testcontainer factories
Test container factories are sweet.DepFactory
implementations that bootstrap
starting containers for testing.
The containers
- clean themselves up after tests
- start up ready to serve traffic
- client tests should never have to call
time.Sleep
before testing
- client tests should never fail due to a container dependency not being
ready
- start tests as soon as they're ready to serve traffic
- client tests should not be waiting because a factory is calling
time.Sleep
Links
Documentation
¶
NewContainer sets up and runs a docker container for the given image.
The container is cleaned up when the test ends.
NewFactory generates a sweet compatible DepFactory that spins up Redis test
containers of the given image.
type Container interface {
Request() testcontainers.ContainerRequest
Close(ctx context.Context, container testcontainers.Container) error
}
Source Files
¶
Directories
¶
Click to show internal directories.
Click to hide internal directories.