fix: address PR review feedback on per-backend route tests

T1 of every per-backend test file asserted 200 with the api Procfile body for a request that lacks --strip-prefix, but without the strip the upstream sees /api/v0/Procfile and python's http.server returns 404; the retry loop polled on status only and accepted web's catch-all 200 first. The assertion now expects 404, which is the right signal that the route reaches the api process. T3 was rewritten to follow T2's two-step pattern (404 without strip, then 200 with strip) so the route is proven applied before checking content. T4 of proxy-route-nginx.bats relaxes the WebSocket header assertions to allow more than one occurrence because the headers correctly appear in both the route location block and the existing location / block. Backticks in fn-traefik-host-rule and fn-traefik-route-labels are now triple-escaped so they survive the docker-args eval path that turns the labels into a docker run invocation, matching the existing convention in docker-args-process-deploy. The label-based backend test files also echo the ps:rebuild output now so future failures of that step surface in the CI logs instead of silently exiting non-zero.
This commit is contained in:
Jose Diaz-Gonzalez
2026-06-01 18:44:34 -04:00
parent 4a550fe4b9
commit 40e13b5f13
7 changed files with 133 additions and 14 deletions

View File

@@ -23,7 +23,8 @@ fn-traefik-route-labels() {
service_name="${APP}-${route_proc}-${route_slug}"
path_len="${#route_path}"
local rule="PathPrefix(\`${route_path}\`)"
# Triple-backslash for the same eval-survival reason as fn-traefik-host-rule.
local rule="PathPrefix(\\\`${route_path}\\\`)"
if [[ -n "$host_rule" ]]; then
rule="(${host_rule}) && ${rule}"
fi
@@ -75,12 +76,17 @@ fn-traefik-host-rule() {
return
fi
# Backticks must be double-escaped so they survive the docker-args eval
# path. A single backslash leaves a bare backtick in the final string,
# which then runs as a command substitution at eval time and breaks the
# docker run invocation. Triple-backslash matches the existing emission
# convention used by docker-args-process-deploy.
for domain in $(echo "$app_domains" | xargs); do
if [[ -z "$result" ]]; then
result="Host(\`${domain}\`)"
result="Host(\\\`${domain}\\\`)"
continue
fi
result="${result} || Host(\`${domain}\`)"
result="${result} || Host(\\\`${domain}\\\`)"
done
echo "$result"
}