Skip to content

Commit 9a141ce

Browse files
authored
Update test-aoai-response.yml
1 parent 6c4b821 commit 9a141ce

1 file changed

Lines changed: 23 additions & 24 deletions

File tree

.github/workflows/test-aoai-response.yml

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Test AOAI Responses API
1+
name: Test Azure OpenAI response
22

33
on:
44
workflow_dispatch:
@@ -32,33 +32,32 @@ jobs:
3232
AZURE_OPENAI_API_MODEL: ${{ secrets.AZURE_OPENAI_API_MODEL }}
3333
run: |
3434
python - <<'PY'
35-
import datetime, json, os, subprocess, sys, textwrap, shlex, pathlib
35+
import datetime, json, os, subprocess, sys, pathlib
3636
37-
# Execute the existing script and capture its stdout / exit code
38-
proc = subprocess.run(
39-
[sys.executable, "responses-basic-aoai-v1.py"],
40-
capture_output=True, text=True
41-
)
42-
output = proc.stdout.strip()
43-
error_code = proc.returncode
44-
passed = bool(output) and error_code == 0 # tweak this test however you like
37+
# Execute the existing script and capture its stdout / exit code
38+
proc = subprocess.run(
39+
[sys.executable, "responses-basic-aoai-v1.py"],
40+
capture_output=True, text=True
41+
)
42+
output = proc.stdout.strip()
43+
error_code = proc.returncode
44+
passed = bool(output) and error_code == 0 # tweak this test however you like
4545
46-
result = {
47-
"run_timestamp_utc": datetime.datetime.utcnow().isoformat(timespec="seconds") + "Z",
48-
"output": output,
49-
"pass": passed,
50-
"error_code": error_code,
51-
}
46+
result = {
47+
"run_timestamp_utc": datetime.datetime.utcnow().isoformat(timespec="seconds") + "Z",
48+
"output": output,
49+
"pass": passed,
50+
"error_code": error_code,
51+
}
5252
53-
path = pathlib.Path("aoai_test_result.json")
54-
path.write_text(json.dumps(result, indent=2), encoding="utf-8")
53+
pathlib.Path("aoai_test_result.json").write_text(
54+
json.dumps(result, indent=2), encoding="utf-8"
55+
)
5556
56-
# Surface the “pass” status to later steps
57-
print(f"pass={passed}", file=sys.stderr)
58-
# Exit non‑zero only if you want the job to fail on an invalid response:
59-
if not passed:
60-
sys.exit(error_code or 1)
61-
PY
57+
# Exit non‑zero if the test failed so the job goes red
58+
if not passed:
59+
sys.exit(error_code or 1)
60+
PY
6261
6362
# ───────────── UPLOAD REPORT ─────────────
6463
- name: 📤 Upload test artifact

0 commit comments

Comments
 (0)