Skip to content

Commit

Permalink
feat(docker): print all container logs on verbose mode after tests fail
Browse files Browse the repository at this point in the history
  • Loading branch information
keskiju committed Jun 5, 2024
1 parent 4ba117c commit afda4e3
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions plugins/docker/util-test-50
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,13 @@ if [[ ! -z ${commands} ]]; then
echo "-----------------"
fi

taito::execute_on_host_fg "${compose_pre_cmd}${commands}"

if [[ ${taito_verbose:-} == true ]]; then
taito::execute_on_host_fg "echo --- ALL CONTAINER LOGS ---; docker compose -f ./${docker_compose_test_file} logs"
fi
taito::execute_on_host_fg "${compose_pre_cmd}${commands}" ||
if [[ ${taito_verbose:-} == true ]]; then
taito::execute_on_host_fg "echo --- ALL CONTAINER LOGS ---; docker compose -f ./${docker_compose_test_file} logs"
exit 1
else
exit 1
fi
fi

# Stop all test containers started by docker-compose
Expand Down

0 comments on commit afda4e3

Please sign in to comment.