From 4ddcb5d1555e64f7d3005dce6eb55c5e4d178c73 Mon Sep 17 00:00:00 2001 From: Vitor Mattos <1079143+vitormattos@users.noreply.github.com> Date: Mon, 5 Oct 2026 02:25:27 +0000 Subject: [PATCH 1/3] test: cover HTTPS access from worker networks Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com> --- tests/proxy/integration.bats | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/proxy/integration.bats b/tests/proxy/integration.bats index 65e8665..a19633a 100644 --- a/tests/proxy/integration.bats +++ b/tests/proxy/integration.bats @@ -141,6 +141,20 @@ certificate_matches_host() { wait_for_absent librecode-dev-proxy-ssl-companion } +@test "shared proxy accepts HTTPS from the worker network alias" { + compose_test proxytesta up --detach + + wait_for_running librecode-dev-proxy + wait_for_network librecode-dev-proxy proxytesta_default + wait_for_https_status proxytesta.localhost 200 + + run compose_test proxytesta exec -T nginx \ + wget --no-check-certificate --server-response --spider \ + "https://proxytesta.localhost/" 2>&1 + [ "$status" -eq 0 ] + [[ "$output" == *"HTTP/1.1 200 OK"* ]] +} + @test "Ctrl+C on attached compose stops the last shared proxy promptly" { log="$BATS_TEST_TMPDIR/compose-up.log" From 3fc5d710c62a4e418f62cfe18e0518b638d3395a Mon Sep 17 00:00:00 2001 From: Vitor Mattos <1079143+vitormattos@users.noreply.github.com> Date: Mon, 5 Oct 2026 02:26:40 +0000 Subject: [PATCH 2/3] test: fail fast on internal proxy connectivity Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com> --- tests/proxy/integration.bats | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tests/proxy/integration.bats b/tests/proxy/integration.bats index a19633a..b0bf5c3 100644 --- a/tests/proxy/integration.bats +++ b/tests/proxy/integration.bats @@ -141,18 +141,22 @@ certificate_matches_host() { wait_for_absent librecode-dev-proxy-ssl-companion } -@test "shared proxy accepts HTTPS from the worker network alias" { +@test "shared proxy accepts HTTP and HTTPS from the worker network alias" { compose_test proxytesta up --detach wait_for_running librecode-dev-proxy wait_for_network librecode-dev-proxy proxytesta_default wait_for_https_status proxytesta.localhost 200 - run compose_test proxytesta exec -T nginx \ + run compose_test proxytesta exec -T nginx sh -c \ + 'nc -z -w 2 proxytesta.localhost 80 && nc -z -w 2 proxytesta.localhost 443' + [ "$status" -eq 0 ] + + run timeout 10 compose_test proxytesta exec -T nginx \ wget --no-check-certificate --server-response --spider \ - "https://proxytesta.localhost/" 2>&1 + "https://proxytesta.localhost/" [ "$status" -eq 0 ] - [[ "$output" == *"HTTP/1.1 200 OK"* ]] + [[ "$output" == *"200 OK"* ]] } @test "Ctrl+C on attached compose stops the last shared proxy promptly" { From 33f9103723989e97b4127a1eb3ec6f29ae67dfbc Mon Sep 17 00:00:00 2001 From: Vitor Mattos <1079143+vitormattos@users.noreply.github.com> Date: Mon, 5 Oct 2026 02:28:14 +0000 Subject: [PATCH 3/3] test: bound internal proxy request retries Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com> --- tests/proxy/integration.bats | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/proxy/integration.bats b/tests/proxy/integration.bats index b0bf5c3..1b7007c 100644 --- a/tests/proxy/integration.bats +++ b/tests/proxy/integration.bats @@ -152,8 +152,8 @@ certificate_matches_host() { 'nc -z -w 2 proxytesta.localhost 80 && nc -z -w 2 proxytesta.localhost 443' [ "$status" -eq 0 ] - run timeout 10 compose_test proxytesta exec -T nginx \ - wget --no-check-certificate --server-response --spider \ + run compose_test proxytesta exec -T nginx \ + wget -T 5 -t 1 --no-check-certificate --server-response --spider \ "https://proxytesta.localhost/" [ "$status" -eq 0 ] [[ "$output" == *"200 OK"* ]]