From 13bdf50cebbf6594f09a58f3c5d706a5efaefd7f Mon Sep 17 00:00:00 2001 From: Donal McBreen Date: Thu, 5 Sep 2024 14:28:44 +0100 Subject: [PATCH] Fix tests for proxy defaults and required builder arch --- test/cli/proxy_test.rb | 2 +- test/commands/proxy_test.rb | 4 ++-- test/fixtures/deploy_with_proxy.yml | 2 ++ 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/test/cli/proxy_test.rb b/test/cli/proxy_test.rb index 7d08c62f..92ab3003 100644 --- a/test/cli/proxy_test.rb +++ b/test/cli/proxy_test.rb @@ -25,7 +25,7 @@ class CliProxyTest < CliTestCase assert_match "docker container prune --force --filter label=org.opencontainers.image.title=kamal-proxy on 1.1.1.1", output assert_match "docker container prune --force --filter label=org.opencontainers.image.title=Traefik on 1.1.1.1", output assert_match "docker run --name kamal-proxy --detach --restart unless-stopped --publish 80:80 --publish 443:443 --volume /var/run/docker.sock:/var/run/docker.sock --volume kamal-proxy:/root/.config/kamal-proxy --log-opt max-size=\"10m\" #{Kamal::Configuration::Proxy::DEFAULT_IMAGE} on 1.1.1.1", output - assert_match "docker exec kamal-proxy kamal-proxy deploy app-web --target \"172.1.0.2:80\" --deploy-timeout \"6s\" on 1.1.1.1", output + assert_match "docker exec kamal-proxy kamal-proxy deploy app-web --target \"172.1.0.2:80\" --deploy-timeout \"6s\" --buffer-requests --buffer-responses --log-request-header \"Cache-Control\" --log-request-header \"Last-Modified\" on 1.1.1.1", output assert_match "docker container stop kamal-proxy on 1.1.1.2", output assert_match "docker container stop traefik on 1.1.1.2", output diff --git a/test/commands/proxy_test.rb b/test/commands/proxy_test.rb index 73e7bfbf..7e7a60cb 100644 --- a/test/commands/proxy_test.rb +++ b/test/commands/proxy_test.rb @@ -3,7 +3,7 @@ require "test_helper" class CommandsProxyTest < ActiveSupport::TestCase setup do @config = { - service: "app", image: "dhh/app", registry: { "username" => "dhh", "password" => "secret" }, servers: [ "1.1.1.1" ] + service: "app", image: "dhh/app", registry: { "username" => "dhh", "password" => "secret" }, servers: [ "1.1.1.1" ], builder: { "arch" => "amd64" } } ENV["EXAMPLE_API_KEY"] = "456" @@ -109,7 +109,7 @@ class CommandsProxyTest < ActiveSupport::TestCase test "deploy" do assert_equal \ - "docker exec kamal-proxy kamal-proxy deploy service --target \"172.1.0.2:80\"", + "docker exec kamal-proxy kamal-proxy deploy service --target \"172.1.0.2:80\" --buffer-requests --buffer-responses --log-request-header \"Cache-Control\" --log-request-header \"Last-Modified\"", new_command.deploy("service", target: "172.1.0.2:80").join(" ") end diff --git a/test/fixtures/deploy_with_proxy.yml b/test/fixtures/deploy_with_proxy.yml index bfe8c505..2912c645 100644 --- a/test/fixtures/deploy_with_proxy.yml +++ b/test/fixtures/deploy_with_proxy.yml @@ -10,6 +10,8 @@ servers: registry: username: user password: pw +builder: + arch: amd64 proxy: enabled: true