Compare commits

..

No commits in common. "71874310aab319f17029b7cb324a0344180a98d1" and "4aeeef8c2d28fd308c6286540e44c8319704c0a3" have entirely different histories.

View file

@ -1,33 +0,0 @@
#!/bin/sh
# Smoke-test the tradein-browser service (camoufox HTTP wrapper, #905) from
# inside the tradein docker network. Verifies /health and a real /fetch.
#
# Run from the deploy host (after `git pull`), piping the script into the
# backend container (which shares the tradein-net with tradein-browser):
#
# docker exec -i tradein-backend sh < tradein-mvp/scripts/browser-smoke.sh
#
# Override the target URL:
# URL=https://example.com docker exec -i -e URL tradein-backend sh < tradein-mvp/scripts/browser-smoke.sh
set -eu
B="${BROWSER_HTTP_ENDPOINT:-http://tradein-browser:3000}"
U="${URL:-https://www.avito.ru/ekaterinburg/kvartiry/prodam}"
printf 'health: '
curl -s --max-time 10 "$B/health" || echo "(no response)"
echo
echo "{\"url\":\"$U\"}" > /tmp/smoke_payload.json
curl -s --max-time 120 -X POST "$B/fetch" \
-H 'Content-Type: application/json' \
-d @/tmp/smoke_payload.json \
-o /tmp/smoke_result.html || true
echo "url: $U"
echo "bytes: $(wc -c < /tmp/smoke_result.html 2>/dev/null || echo 0)"
echo "preloaded: $(grep -c preloadedState /tmp/smoke_result.html 2>/dev/null || echo 0)"
echo "firewall: $(grep -ci firewall-container /tmp/smoke_result.html 2>/dev/null || echo 0)"
echo "--- first 200 bytes (error JSON shows here if /fetch failed) ---"
head -c 200 /tmp/smoke_result.html 2>/dev/null || true
echo