fix: allow configurations without web roles
This commit is contained in:
@@ -64,9 +64,14 @@ class CliHealthcheckTest < CliTestCase
|
||||
end
|
||||
assert_match "container not ready (unhealthy)", exception.message
|
||||
end
|
||||
|
||||
test "does not perform if primary does not have traefik" do
|
||||
SSHKit::Backend::Abstract.any_instance.expects(:execute).never
|
||||
run_command("perform", config_file: "test/fixtures/deploy_workers_only.yml")
|
||||
end
|
||||
|
||||
private
|
||||
def run_command(*command)
|
||||
stdouted { Kamal::Cli::Healthcheck.start([*command, "-c", "test/fixtures/deploy_with_accessories.yml"]) }
|
||||
def run_command(*command, config_file: "test/fixtures/deploy_with_accessories.yml")
|
||||
stdouted { Kamal::Cli::Healthcheck.start([*command, "-c", config_file]) }
|
||||
end
|
||||
end
|
||||
|
||||
@@ -58,9 +58,9 @@ class ConfigurationTest < ActiveSupport::TestCase
|
||||
assert_equal [ "1.1.1.1", "1.1.1.2", "1.1.1.3" ], @config_with_roles.all_hosts
|
||||
end
|
||||
|
||||
test "primary web host" do
|
||||
assert_equal "1.1.1.1", @config.primary_web_host
|
||||
assert_equal "1.1.1.1", @config_with_roles.primary_web_host
|
||||
test "primary host" do
|
||||
assert_equal "1.1.1.1", @config.primary_host
|
||||
assert_equal "1.1.1.1", @config_with_roles.primary_host
|
||||
end
|
||||
|
||||
test "traefik hosts" do
|
||||
|
||||
10
test/fixtures/deploy_workers_only.yml
vendored
Normal file
10
test/fixtures/deploy_workers_only.yml
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
service: app
|
||||
image: dhh/app
|
||||
servers:
|
||||
workers:
|
||||
hosts:
|
||||
- 1.1.1.1
|
||||
- 1.1.1.2
|
||||
registry:
|
||||
username: user
|
||||
password: pw
|
||||
Reference in New Issue
Block a user