@@ -71,11 +71,46 @@ jobs:
7171 with :
7272 version : " latest"
7373 - run : uv sync --all-extras
74- - name : Run integration tests
74+ - name : Register test app with broker
75+ id : register-app
76+ env :
77+ AGENTWRIT_BROKER_URL : http://localhost:8080
78+ AA_ADMIN_SECRET : ${{ secrets.AA_ADMIN_SECRET }}
79+ run : |
80+ # Authenticate as admin
81+ ADMIN_TOKEN=$(curl -sf -X POST "${AGENTWRIT_BROKER_URL}/v1/admin/auth" \
82+ -H "Content-Type: application/json" \
83+ -d "{\"secret\":\"${AA_ADMIN_SECRET}\"}" | python3 -c "import sys,json; print(json.load(sys.stdin)['access_token'])")
84+
85+ # Register a test app with broad scope ceiling
86+ APP_JSON=$(curl -sf -X POST "${AGENTWRIT_BROKER_URL}/v1/admin/apps" \
87+ -H "Content-Type: application/json" \
88+ -H "Authorization: Bearer ${ADMIN_TOKEN}" \
89+ -d '{"name":"ci-integration","scopes":["read:data:*","write:data:*"]}')
90+
91+ # Extract credentials and mask the secret
92+ CLIENT_ID=$(echo "${APP_JSON}" | python3 -c "import sys,json; print(json.load(sys.stdin)['client_id'])")
93+ CLIENT_SECRET=$(echo "${APP_JSON}" | python3 -c "import sys,json; print(json.load(sys.stdin)['client_secret'])")
94+
95+ echo "::add-mask::${CLIENT_SECRET}"
96+ echo "client_id=${CLIENT_ID}" >> "$GITHUB_OUTPUT"
97+ echo "client_secret=${CLIENT_SECRET}" >> "$GITHUB_OUTPUT"
98+ echo "Registered test app: ${CLIENT_ID}"
99+ - name : Run integration tests (all 15 stories)
75100 env :
76101 AGENTWRIT_BROKER_URL : http://localhost:8080
77102 AGENTWRIT_ADMIN_SECRET : ${{ secrets.AA_ADMIN_SECRET }}
78- run : uv run pytest -m integration -q
103+ AGENTWRIT_CLIENT_ID : ${{ steps.register-app.outputs.client_id }}
104+ AGENTWRIT_CLIENT_SECRET : ${{ steps.register-app.outputs.client_secret }}
105+ run : |
106+ result=$(uv run pytest -m integration -v 2>&1)
107+ echo "${result}"
108+
109+ # Fail if any tests were skipped — no silent skips allowed
110+ if echo "${result}" | grep -q "skipped"; then
111+ echo "::error::Integration tests had skipped stories — all 15 must run"
112+ exit 1
113+ fi
79114
80115 secrets-scan :
81116 name : Secrets Scan
0 commit comments