Skip to content

Commit add321a

Browse files
authored
Refactor exit code retrieval for test container
Simplified the exit code retrieval for the test container.
1 parent 9f91bcd commit add321a

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

docker_compose_test/docker_compose_test.sh

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,7 @@ echo "$docker_compose_up_cmd" | bash
7272
result=$?
7373

7474
# Figure out the exit code of the test container incase it never actually started.
75-
docker_inspect_cmd="$(docker inspect $($docker_compose_bin -f $ABSOLUTE_COMPOSE_FILE_PATH ps -qa $DOCKER_COMPOSE_TEST_CONTAINER) --format='{{.State.ExitCode}}' 2>/dev/null)"
76-
echo "running: $docker_inspect_cmd"
77-
echo "$docker_inspect_cmd" | bash
78-
EXIT_CODE=$?
75+
EXIT_CODE=$(docker inspect $($docker_compose_bin -f $ABSOLUTE_COMPOSE_FILE_PATH ps -qa $DOCKER_COMPOSE_TEST_CONTAINER) --format='{{.State.ExitCode}}' 2>/dev/null)
7976
if [ "$EXIT_CODE" != "0" ] || [ -z "$EXIT_CODE" ]; then
8077
echo "Error: $DOCKER_COMPOSE_TEST_CONTAINER container failed or never started!"
8178
exit 1

0 commit comments

Comments
 (0)