-
Notifications
You must be signed in to change notification settings - Fork 272
Testing on container
Thang Chung edited this page May 14, 2021
·
1 revision
- Orchestration — how do you know when Redis will be ready to receive traffic after you start it? You’d need some kind of health check and waiting strategy.
- Parallelism — Since port 6379 will be allocated, you cannot run multiple tests in parallel. You could choose not to expose that specific port and the - Docker daemon would automatically bind it to a random free port on your machine, but then you wouldn’t know what port to connect to from your tests to interact with Redis.
- Test lifecycle — normally you would want to recreate the container in between tests to have an isolated and clean environment for each test scenario.
- Cleanup — You need to stop and remove the container after your tests run.
Ref at https://medium.com/@jdelucaa/integration-testing-with-docker-and-testcontainers-3e53e6f44a1b
- Unit tests
- Integration tests