Reputation: 1459
I run tests inside docker container on a shell runner (NodeJS/jest);
How can I fail gitlab pipeline if tests fail from inside the container?
process.exit(1)
in case there are failing tests but it didn't help.RUN
but I need the
environment
variables to configure URLs to other containers.Since all tests are http calls to other containers I also expect that after_script
will work for tearing down the environment regardless of the outcome.
Upvotes: 0
Views: 624
Reputation: 40861
When using docker compose, you'll need to use the --exit-code-from
to specify the service that should be used for the exit code of the docker-compose
command.
See also: https://stackoverflow.com/a/43367250/5747944
Upvotes: 1