Merge pull request #472 from basecamp/move-healthcheck-poller-to-cli

Healthcheck polling is a CLI concern
This commit is contained in:
David Heinemeier Hansson
2023-09-16 11:31:28 -07:00
committed by GitHub
6 changed files with 71 additions and 71 deletions

View File

@@ -5,7 +5,7 @@ class CliHealthcheckTest < CliTestCase
# Prevent expected failures from outputting to terminal
Thread.report_on_exception = false
Kamal::Utils::HealthcheckPoller.stubs(:sleep) # No sleeping when retrying
Kamal::Cli::Healthcheck::Poller.stubs(:sleep) # No sleeping when retrying
Kamal::Configuration.any_instance.stubs(:run_id).returns("12345678901234567890123456789012")
SSHKit::Backend::Abstract.any_instance.stubs(:execute)
@@ -35,7 +35,7 @@ class CliHealthcheckTest < CliTestCase
# Prevent expected failures from outputting to terminal
Thread.report_on_exception = false
Kamal::Utils::HealthcheckPoller.stubs(:sleep) # No sleeping when retrying
Kamal::Cli::Healthcheck::Poller.stubs(:sleep) # No sleeping when retrying
SSHKit::Backend::Abstract.any_instance.stubs(:execute)
.with(:docker, :container, :ls, "--all", "--filter", "name=^healthcheck-app-999$", "--quiet", "|", :xargs, :docker, :stop, raise_on_non_zero_exit: false)

View File

@@ -216,7 +216,7 @@ class CliMainTest < CliTestCase
test "rollback without old version" do
Kamal::Cli::Main.any_instance.stubs(:container_available?).returns(true)
Kamal::Utils::HealthcheckPoller.stubs(:sleep)
Kamal::Cli::Healthcheck::Poller.stubs(:sleep)
SSHKit::Backend::Abstract.any_instance.expects(:capture_with_info)
.with(:docker, :container, :ls, "--all", "--filter", "name=^app-web-123$", "--quiet", raise_on_non_zero_exit: false)