chore: drop debug scaffolding from proxy-route bats files

Removes the per-step docker inspect label dumps in the caddy/traefik/openresty backend tests, the kubectl get service/ingress/endpoints dumps in the k3s T1 tests, the openresty T2 sidecar log fallback that became unnecessary once 0.12.1 fixed the upstream cache regression, and the trailing cat of /tmp/route-removed-body in every T3. The output/status echoes that match the project's bats convention stay, as does the file-based grep in T3 and every assertion-bearing kubectl call.
This commit is contained in:
Jose Diaz-Gonzalez
2026-06-07 23:36:02 -04:00
parent 1c6b16e823
commit 8375bb543a
6 changed files with 3 additions and 136 deletions

View File

@@ -37,18 +37,6 @@ teardown() {
echo "status: $status"
assert_success
# Surface the actual labels attached to the api container so CI logs show
# whether docker-args-process-deploy emitted them correctly.
run /bin/bash -c "docker inspect ${TEST_APP}.api.1 --format '{{json .Config.Labels}}' 2>&1 | jq . 2>/dev/null || docker inspect ${TEST_APP}.api.1 --format '{{json .Config.Labels}}' 2>&1"
echo "api labels: $output"
# Also dump the web container's labels so we can compare site declarators
# between web and api - caddy treats DOMAIN and DOMAIN:80 as separate
# sites, and a mismatch keeps caddy-docker-proxy from merging the two
# containers' directives into a single site block.
run /bin/bash -c "docker inspect ${TEST_APP}.web.1 --format '{{json .Config.Labels}}' 2>&1 | jq . 2>/dev/null || docker inspect ${TEST_APP}.web.1 --format '{{json .Config.Labels}}' 2>&1"
echo "web labels: $output"
# Give the daemon a moment to read the new labels.
sleep 5
@@ -72,11 +60,6 @@ teardown() {
echo "status: $status"
assert_success
# Surface the actual labels attached to the api container so CI logs show
# whether docker-args-process-deploy emitted them correctly.
run /bin/bash -c "docker inspect ${TEST_APP}.api.1 --format '{{json .Config.Labels}}' 2>&1 | jq . 2>/dev/null || docker inspect ${TEST_APP}.api.1 --format '{{json .Config.Labels}}' 2>&1"
echo "api labels: $output"
# Give the daemon a moment to read the new labels.
sleep 5
assert_http_localhost_response_contains "http" "${TEST_APP}.${DOKKU_DOMAIN}" "80" "/api/v0/Procfile" "" "404"
@@ -88,11 +71,6 @@ teardown() {
echo "status: $status"
assert_success
# Surface the actual labels attached to the api container so CI logs show
# whether docker-args-process-deploy emitted them correctly.
run /bin/bash -c "docker inspect ${TEST_APP}.api.1 --format '{{json .Config.Labels}}' 2>&1 | jq . 2>/dev/null || docker inspect ${TEST_APP}.api.1 --format '{{json .Config.Labels}}' 2>&1"
echo "api labels: $output"
# Give the daemon a moment to read the new labels.
sleep 5
assert_http_localhost_response_contains "http" "${TEST_APP}.${DOKKU_DOMAIN}" "80" "/api/v0/Procfile" "python3 -m http.server"
@@ -113,11 +91,6 @@ teardown() {
echo "status: $status"
assert_success
# Surface the actual labels attached to the api container so CI logs show
# whether docker-args-process-deploy emitted them correctly.
run /bin/bash -c "docker inspect ${TEST_APP}.api.1 --format '{{json .Config.Labels}}' 2>&1 | jq . 2>/dev/null || docker inspect ${TEST_APP}.api.1 --format '{{json .Config.Labels}}' 2>&1"
echo "api labels: $output"
# Give the daemon a moment to read the new labels.
sleep 5
assert_http_localhost_response_contains "http" "${TEST_APP}.${DOKKU_DOMAIN}" "80" "/api/v0/Procfile" "" "404"
@@ -129,11 +102,6 @@ teardown() {
echo "status: $status"
assert_success
# Surface the actual labels attached to the api container so CI logs show
# whether docker-args-process-deploy emitted them correctly.
run /bin/bash -c "docker inspect ${TEST_APP}.api.1 --format '{{json .Config.Labels}}' 2>&1 | jq . 2>/dev/null || docker inspect ${TEST_APP}.api.1 --format '{{json .Config.Labels}}' 2>&1"
echo "api labels: $output"
# Give the daemon a moment to read the new labels.
sleep 5
assert_http_localhost_response_contains "http" "${TEST_APP}.${DOKKU_DOMAIN}" "80" "/api/v0/Procfile" "python3 -m http.server"
@@ -154,11 +122,6 @@ teardown() {
echo "status: $status"
assert_success
# Surface the actual labels attached to the api container so CI logs show
# whether docker-args-process-deploy emitted them correctly.
run /bin/bash -c "docker inspect ${TEST_APP}.api.1 --format '{{json .Config.Labels}}' 2>&1 | jq . 2>/dev/null || docker inspect ${TEST_APP}.api.1 --format '{{json .Config.Labels}}' 2>&1"
echo "api labels: $output"
# Give the daemon a moment to read the new labels.
sleep 5
@@ -173,9 +136,6 @@ teardown() {
fi
sleep 1
done
echo "final body attempt $attempt:"
cat /tmp/route-removed-body
echo
run /bin/bash -c "grep -c 'python3 -m http.server' /tmp/route-removed-body || true"
assert_output "0"
}

View File

@@ -49,15 +49,6 @@ teardown() {
echo "status: $status"
assert_success
# Diagnostic: dump the cluster state so CI logs show whether the api
# Service and the Ingress are wired correctly.
run /bin/bash -c "kubectl get service -o yaml 2>&1"
echo "services: $output"
run /bin/bash -c "kubectl get ingress -o yaml 2>&1"
echo "ingresses: $output"
run /bin/bash -c "kubectl get endpoints -o yaml 2>&1"
echo "endpoints: $output"
# Without --strip-prefix, /api/v0/Procfile reaches api as /api/v0/Procfile
# which python's http.server returns 404 for. 404 proves the route reaches
# api (web's catch-all would have returned 200).

View File

@@ -49,15 +49,6 @@ teardown() {
echo "status: $status"
assert_success
# Diagnostic: dump the cluster state so CI logs show whether the api
# Service and the IngressRoute are wired correctly.
run /bin/bash -c "kubectl get service -o yaml 2>&1"
echo "services: $output"
run /bin/bash -c "kubectl get ingressroute.traefik.io -o yaml 2>&1"
echo "ingressroutes: $output"
run /bin/bash -c "kubectl get endpoints -o yaml 2>&1"
echo "endpoints: $output"
# Without --strip-prefix, /api/v0/Procfile reaches api as /api/v0/Procfile
# which python's http.server returns 404 for. 404 proves the route reaches
# api (web's catch-all would have returned 200).

View File

@@ -110,9 +110,6 @@ teardown() {
fi
sleep 1
done
echo "final body attempt $attempt:"
cat /tmp/route-removed-body
echo
run /bin/bash -c "grep -c 'python3 -m http.server' /tmp/route-removed-body || true"
assert_output "0"
}

View File

@@ -37,11 +37,6 @@ teardown() {
echo "status: $status"
assert_success
# Surface the actual labels attached to the api container so CI logs show
# whether docker-args-process-deploy emitted them correctly.
run /bin/bash -c "docker inspect ${TEST_APP}.api.1 --format '{{json .Config.Labels}}' 2>&1 | jq . 2>/dev/null || docker inspect ${TEST_APP}.api.1 --format '{{json .Config.Labels}}' 2>&1"
echo "api labels: $output"
# Give the daemon a moment to read the new labels.
sleep 5
@@ -65,11 +60,6 @@ teardown() {
echo "status: $status"
assert_success
# Surface the actual labels attached to the api container so CI logs show
# whether docker-args-process-deploy emitted them correctly.
run /bin/bash -c "docker inspect ${TEST_APP}.api.1 --format '{{json .Config.Labels}}' 2>&1 | jq . 2>/dev/null || docker inspect ${TEST_APP}.api.1 --format '{{json .Config.Labels}}' 2>&1"
echo "api labels: $output"
# Give the daemon a moment to read the new labels.
sleep 5
assert_http_localhost_response_contains "http" "${TEST_APP}.${DOKKU_DOMAIN}" "80" "/api/v0/Procfile" "" "404"
@@ -81,20 +71,9 @@ teardown() {
echo "status: $status"
assert_success
# Surface the actual labels attached to the api container so CI logs show
# whether docker-args-process-deploy emitted them correctly.
run /bin/bash -c "docker inspect ${TEST_APP}.api.1 --format '{{json .Config.Labels}}' 2>&1 | jq . 2>/dev/null || docker inspect ${TEST_APP}.api.1 --format '{{json .Config.Labels}}' 2>&1"
echo "api labels: $output"
# openresty-docker-proxy 0.12.0 has a polling/caching delay before it
# re-renders the config after labels on an existing route key change.
# Give it a longer window than the default HTTP retry. If this still
# times out, dump the sidecar logs so we can file an upstream bug.
HTTP_ASSERT_RETRIES=60 assert_http_localhost_response_contains "http" "${TEST_APP}.${DOKKU_DOMAIN}" "80" "/api/v0/Procfile" "python3 -m http.server" || {
run /bin/bash -c "dokku openresty:logs --num 200 2>&1 || docker logs openresty-openresty-1 --tail 200 2>&1"
echo "openresty sidecar logs: $output"
return 1
}
# Give the sidecar a longer window than the default HTTP retry to detect
# and re-render after a route's labels change on the api container.
HTTP_ASSERT_RETRIES=60 assert_http_localhost_response_contains "http" "${TEST_APP}.${DOKKU_DOMAIN}" "80" "/api/v0/Procfile" "python3 -m http.server"
}
@test "(proxy-route:openresty) removing a route falls back to web" {
@@ -112,11 +91,6 @@ teardown() {
echo "status: $status"
assert_success
# Surface the actual labels attached to the api container so CI logs show
# whether docker-args-process-deploy emitted them correctly.
run /bin/bash -c "docker inspect ${TEST_APP}.api.1 --format '{{json .Config.Labels}}' 2>&1 | jq . 2>/dev/null || docker inspect ${TEST_APP}.api.1 --format '{{json .Config.Labels}}' 2>&1"
echo "api labels: $output"
# Give the daemon a moment to read the new labels.
sleep 5
assert_http_localhost_response_contains "http" "${TEST_APP}.${DOKKU_DOMAIN}" "80" "/api/v0/Procfile" "" "404"
@@ -128,11 +102,6 @@ teardown() {
echo "status: $status"
assert_success
# Surface the actual labels attached to the api container so CI logs show
# whether docker-args-process-deploy emitted them correctly.
run /bin/bash -c "docker inspect ${TEST_APP}.api.1 --format '{{json .Config.Labels}}' 2>&1 | jq . 2>/dev/null || docker inspect ${TEST_APP}.api.1 --format '{{json .Config.Labels}}' 2>&1"
echo "api labels: $output"
# Give the daemon a moment to read the new labels.
sleep 5
assert_http_localhost_response_contains "http" "${TEST_APP}.${DOKKU_DOMAIN}" "80" "/api/v0/Procfile" "python3 -m http.server"
@@ -153,11 +122,6 @@ teardown() {
echo "status: $status"
assert_success
# Surface the actual labels attached to the api container so CI logs show
# whether docker-args-process-deploy emitted them correctly.
run /bin/bash -c "docker inspect ${TEST_APP}.api.1 --format '{{json .Config.Labels}}' 2>&1 | jq . 2>/dev/null || docker inspect ${TEST_APP}.api.1 --format '{{json .Config.Labels}}' 2>&1"
echo "api labels: $output"
# Give the daemon a moment to read the new labels.
sleep 5
@@ -172,9 +136,6 @@ teardown() {
fi
sleep 1
done
echo "final body attempt $attempt:"
cat /tmp/route-removed-body
echo
run /bin/bash -c "grep -c 'python3 -m http.server' /tmp/route-removed-body || true"
assert_output "0"
}

View File

@@ -39,11 +39,6 @@ teardown() {
echo "status: $status"
assert_success
# Surface the actual labels attached to the api container so CI logs show
# whether docker-args-process-deploy emitted them correctly.
run /bin/bash -c "docker inspect ${TEST_APP}.api.1 --format '{{json .Config.Labels}}' 2>&1 | jq . 2>/dev/null || docker inspect ${TEST_APP}.api.1 --format '{{json .Config.Labels}}' 2>&1"
echo "api labels: $output"
# Give the daemon a moment to read the new labels.
sleep 5
@@ -67,11 +62,6 @@ teardown() {
echo "status: $status"
assert_success
# Surface the actual labels attached to the api container so CI logs show
# whether docker-args-process-deploy emitted them correctly.
run /bin/bash -c "docker inspect ${TEST_APP}.api.1 --format '{{json .Config.Labels}}' 2>&1 | jq . 2>/dev/null || docker inspect ${TEST_APP}.api.1 --format '{{json .Config.Labels}}' 2>&1"
echo "api labels: $output"
# Give the daemon a moment to read the new labels.
sleep 5
assert_http_localhost_response_contains "http" "${TEST_APP}.${DOKKU_DOMAIN}" "80" "/api/v0/Procfile" "" "404"
@@ -83,11 +73,6 @@ teardown() {
echo "status: $status"
assert_success
# Surface the actual labels attached to the api container so CI logs show
# whether docker-args-process-deploy emitted them correctly.
run /bin/bash -c "docker inspect ${TEST_APP}.api.1 --format '{{json .Config.Labels}}' 2>&1 | jq . 2>/dev/null || docker inspect ${TEST_APP}.api.1 --format '{{json .Config.Labels}}' 2>&1"
echo "api labels: $output"
# Give the daemon a moment to read the new labels.
sleep 5
assert_http_localhost_response_contains "http" "${TEST_APP}.${DOKKU_DOMAIN}" "80" "/api/v0/Procfile" "python3 -m http.server"
@@ -109,11 +94,6 @@ teardown() {
echo "status: $status"
assert_success
# Surface the actual labels attached to the api container so CI logs show
# whether docker-args-process-deploy emitted them correctly.
run /bin/bash -c "docker inspect ${TEST_APP}.api.1 --format '{{json .Config.Labels}}' 2>&1 | jq . 2>/dev/null || docker inspect ${TEST_APP}.api.1 --format '{{json .Config.Labels}}' 2>&1"
echo "api labels: $output"
# Give the daemon a moment to read the new labels.
sleep 5
assert_http_localhost_response_contains "http" "${TEST_APP}.${DOKKU_DOMAIN}" "80" "/api/v0/Procfile" "" "404"
@@ -126,11 +106,6 @@ teardown() {
echo "status: $status"
assert_success
# Surface the actual labels attached to the api container so CI logs show
# whether docker-args-process-deploy emitted them correctly.
run /bin/bash -c "docker inspect ${TEST_APP}.api.1 --format '{{json .Config.Labels}}' 2>&1 | jq . 2>/dev/null || docker inspect ${TEST_APP}.api.1 --format '{{json .Config.Labels}}' 2>&1"
echo "api labels: $output"
# Give the daemon a moment to read the new labels.
sleep 5
assert_http_localhost_response_contains "http" "${TEST_APP}.${DOKKU_DOMAIN}" "80" "/api/v0/Procfile" "python3 -m http.server"
@@ -152,11 +127,6 @@ teardown() {
echo "status: $status"
assert_success
# Surface the actual labels attached to the api container so CI logs show
# whether docker-args-process-deploy emitted them correctly.
run /bin/bash -c "docker inspect ${TEST_APP}.api.1 --format '{{json .Config.Labels}}' 2>&1 | jq . 2>/dev/null || docker inspect ${TEST_APP}.api.1 --format '{{json .Config.Labels}}' 2>&1"
echo "api labels: $output"
# Give the daemon a moment to read the new labels.
sleep 5
@@ -173,9 +143,6 @@ teardown() {
fi
sleep 1
done
echo "final body attempt $attempt:"
cat /tmp/route-removed-body
echo
run /bin/bash -c "grep -c 'python3 -m http.server' /tmp/route-removed-body || true"
assert_output "0"
}