ci: fix smoke test failing on curl | grep -q under pipefail

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-06 23:53:40 -04:00
co-authored by Claude Opus 5.5
parent 94a7f622b8
commit 4aa2ad3244
+4 -1
View File
@@ -84,6 +84,7 @@ jobs:
- name: Smoke test - name: Smoke test
run: | run: |
set -x
apt-get install -y -qq ./out/devdesk_*.deb >/dev/null apt-get install -y -qq ./out/devdesk_*.deb >/dev/null
/usr/lib/devdesk/bin/ttyd --version /usr/lib/devdesk/bin/ttyd --version
test -s /etc/devdesk/secret.env test -s /etc/devdesk/secret.env
@@ -95,7 +96,9 @@ jobs:
for _ in $(seq 1 30); do curl -s -o /dev/null localhost:7681/ && break; sleep 0.2; done for _ in $(seq 1 30); do curl -s -o /dev/null localhost:7681/ && break; sleep 0.2; done
code=$(curl -s -o /dev/null -w '%{http_code}' localhost:7681/) code=$(curl -s -o /dev/null -w '%{http_code}' localhost:7681/)
[ "$code" = 401 ] || { echo "expected 401 without credential, got $code"; exit 1; } [ "$code" = 401 ] || { echo "expected 401 without credential, got $code"; exit 1; }
curl -sf -u "$DEVDESK_CREDENTIAL" localhost:7681/ | grep -q 'name="generator" content="devdesk"' # Download first: `curl | grep -q` fails under pipefail (grep exits early, curl gets SIGPIPE).
curl -sf -u "$DEVDESK_CREDENTIAL" -o page.html localhost:7681/
grep -q 'name="generator" content="devdesk"' page.html
curl -sf -u "$DEVDESK_CREDENTIAL" localhost:7681/token | jq -e '.token | length > 0' curl -sf -u "$DEVDESK_CREDENTIAL" localhost:7681/token | jq -e '.token | length > 0'
DEVDESK_NO_SYSTEMD=1 devdesk attach --list | jq -e '.default == "main"' DEVDESK_NO_SYSTEMD=1 devdesk attach --list | jq -e '.default == "main"'
echo "smoke test passed" echo "smoke test passed"