From 8981a6245c7f09fcbafd856c2e220507f8983192 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A0=20Arrufat?= Date: Sun, 17 May 2026 10:43:03 +0200 Subject: [PATCH] ci: tighten mcp-smoke jq assertions Replace `grep '"id":N' | jq -e ...` with `jq -ec 'select(.id == N) | ...'`. The grep form also matched `"id":10`, `"id":11`, ... and any tool description containing that substring; numeric `select` is type-correct. `jq -e` still fails the job when `select` produces no output (exit 4), so the smoke semantics are preserved. Also add `jq --version` up front so the job fails fast and loud if the `ubuntu-latest` image ever stops shipping jq. --- .github/workflows/e2e-test.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml index f6f859b85..00daec2c7 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/e2e-test.yml @@ -476,6 +476,8 @@ jobs: run: | set -euo pipefail + jq --version + timeout 30 ./lightpanda mcp > mcp.out <<'JSONRPC' {"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"ci","version":"1.0.0"}}} {"jsonrpc":"2.0","method":"notifications/initialized"} @@ -484,8 +486,5 @@ jobs: cat mcp.out - grep '"id":1' mcp.out \ - | jq -e '.result.protocolVersion == "2024-11-05"' > /dev/null - - grep '"id":2' mcp.out \ - | jq -e '.result.tools | type == "array" and length > 0' > /dev/null + jq -ec 'select(.id == 1) | .result.protocolVersion == "2024-11-05"' mcp.out > /dev/null + jq -ec 'select(.id == 2) | .result.tools | type == "array" and length > 0' mcp.out > /dev/null