From 6898e8789e220714520393ce68a153a2bef6a87a Mon Sep 17 00:00:00 2001 From: Matthew Kent Date: Fri, 10 Nov 2023 17:17:16 -0800 Subject: [PATCH] Further test the override. --- test/cli/main_test.rb | 10 ++++++++++ .../deploy_primary_web_role_override.yml | 20 +++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 test/fixtures/deploy_primary_web_role_override.yml diff --git a/test/cli/main_test.rb b/test/cli/main_test.rb index a19ff90e..07e47f8d 100644 --- a/test/cli/main_test.rb +++ b/test/cli/main_test.rb @@ -283,6 +283,16 @@ class CliMainTest < CliTestCase end end + test "config with primary web role override" do + run_command("config", config_file: "deploy_primary_web_role_override").tap do |output| + config = YAML.load(output) + + assert_equal ["web_chicago", "web_tokyo"], config[:roles] + assert_equal ["1.1.1.1", "1.1.1.2", "1.1.1.3", "1.1.1.4"], config[:hosts] + assert_equal "1.1.1.3", config[:primary_host] + end + end + test "config with destination" do run_command("config", "-d", "world", config_file: "deploy_for_dest").tap do |output| config = YAML.load(output) diff --git a/test/fixtures/deploy_primary_web_role_override.yml b/test/fixtures/deploy_primary_web_role_override.yml new file mode 100644 index 00000000..264819fe --- /dev/null +++ b/test/fixtures/deploy_primary_web_role_override.yml @@ -0,0 +1,20 @@ +service: app +image: dhh/app +servers: + web_chicago: + traefik: enabled + hosts: + - 1.1.1.1 + - 1.1.1.2 + web_tokyo: + traefik: enabled + hosts: + - 1.1.1.3 + - 1.1.1.4 +env: + REDIS_URL: redis://x/y +registry: + server: registry.digitalocean.com + username: user + password: pw +primary_web_role: web_tokyo