Add test for custom per-role healthchecks
This adds the test for checking whether custom healthcheck options in the role context are actually accepted into configuration.
This commit is contained in:
@@ -46,6 +46,14 @@ class CommandsHealthcheckTest < ActiveSupport::TestCase
|
|||||||
new_command.run.join(" ")
|
new_command.run.join(" ")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
test "run with custom per-role healthcheck options" do
|
||||||
|
@config[:servers] = { "web" => { "hosts" => [ "1.1.1.1" ],
|
||||||
|
"healthcheck" => { "log_lines" => 150 } } }
|
||||||
|
assert_equal \
|
||||||
|
"docker container ls --all --filter name=^healthcheck-app-123$ --quiet | xargs docker logs --tail 150 2>&1",
|
||||||
|
new_command.logs.join(" ")
|
||||||
|
end
|
||||||
|
|
||||||
test "status" do
|
test "status" do
|
||||||
assert_equal \
|
assert_equal \
|
||||||
"docker container ls --all --filter name=^healthcheck-app-123$ --quiet | xargs docker inspect --format '{{if .State.Health}}{{.State.Health.Status}}{{else}}{{.State.Status}}{{end}}'",
|
"docker container ls --all --filter name=^healthcheck-app-123$ --quiet | xargs docker inspect --format '{{if .State.Health}}{{.State.Health.Status}}{{else}}{{.State.Status}}{{end}}'",
|
||||||
|
|||||||
Reference in New Issue
Block a user