File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -65,10 +65,17 @@ cleanup() {
6565# SIGINT: sent on Ctrl+C.
6666trap cleanup EXIT
6767
68- # bring up compose file & get exit status-code from the integration test container
68+ # bring up compose file & get exit status-code from the integration test container.
6969docker_compose_up_cmd=" $docker_compose_bin -f $ABSOLUTE_COMPOSE_FILE_PATH up --abort-on-container-failure --exit-code-from $DOCKER_COMPOSE_TEST_CONTAINER $EXTRA_DOCKER_COMPOSE_UP_ARGS "
7070echo " running: $docker_compose_up_cmd "
7171echo " $docker_compose_up_cmd " | bash
7272result=$?
7373
74+ # Figure out the exit code of the test container incase it never actually started.
75+ EXIT_CODE=$( docker inspect $( docker compose -f $ABSOLUTE_COMPOSE_FILE_PATH ps -qa $DOCKER_COMPOSE_TEST_CONTAINER ) --format=' {{.State.ExitCode}}' 2> /dev/null)
76+ if [ " $EXIT_CODE " != " 0" ] || [ -z " $EXIT_CODE " ]; then
77+ echo " Error: $DOCKER_COMPOSE_TEST_CONTAINER container failed or never started!"
78+ exit 1
79+ fi
80+
7481exit $result
You can’t perform that action at this time.
0 commit comments