I am currently running a docker-compose stack for basic integration tests with a protractor test runner, a nodejs server serving a web page and a wildfly server serving a java b
The solution I found to be most elegant is to use depends_on
in your docker-compose.yml
file.
services:
dynamodb:
...
test_runner:
...
depends_on:
- dynamodb
Now you can use docker-compose run --rm test_runner
which will set up your dependencies, run your tests, tear down everything, and propagate the return code.
docker-compose run test_runner false
Starting test_dynamodb_1 ... done
echo $?
1
docker-compose run test_runner true
Starting test_dynamodb_1 ... done
echo $?