Capture container health log when unhealthy

This commit is contained in:
Jberczel
2023-05-03 14:15:46 -04:00
parent 38c85e8021
commit 0e19ead37c
6 changed files with 22 additions and 0 deletions

View File

@@ -51,6 +51,12 @@ class CommandsHealthcheckTest < ActiveSupport::TestCase
new_command.status.join(" ")
end
test "container_health_log" do
assert_equal \
"docker container ls --all --filter name=^healthcheck-app-123$ --quiet | xargs docker inspect --format '{{json .State.Health}}'",
new_command.container_health_log.join(" ")
end
test "stop" do
assert_equal \
"docker container ls --all --filter name=^healthcheck-app-123$ --quiet | xargs docker stop",