Repository navigation
210 lines (189 loc) · 8.96 KB
/
Copy pathagent-e2e.yml
File metadata and controls
210 lines (189 loc) · 8.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
name: Agent E2E
# Runs the agent e2e suites (e2e/) against the Conductor OSS server boot
# JAR (Maven Central) — the server this SDK ships against, with the agent
# runtime on by default from 3.32.0-rc.8 onward.
# tests/integration/ai stays manual-only: run it locally against
# a live server with `pytest tests/integration/ai`.
#
# These tests call real LLMs via the OPENAI_API_KEY / ANTHROPIC_API_KEY
# repo secrets. Fork PRs cannot see repo secrets, so for them the run
# fails at the silently-empty guard rather than passing vacuously.
on: [pull_request, workflow_dispatch]
permissions:
contents: read
concurrency:
group: agent-e2e-${{ github.ref }}
cancel-in-progress: true
env:
# Tracks the org-level E2E_TEST_OSS_CONDUCTOR_VERSION, set by conductor's
# publish.yml on each release (shared with the pull_request.yml docker e2e).
# Fork PRs can't read org vars, so they fall back to the pinned default.
CONDUCTOR_SERVER_VERSION: ${{ vars.E2E_TEST_OSS_CONDUCTOR_VERSION || '3.33.0' }}
jobs:
agent-e2e:
runs-on: ubuntu-latest
timeout-minutes: 45
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
CONDUCTOR_SERVER_URL: http://localhost:8080/api
# Default model for every suite. Tracks the org-level E2E_TEST_OPENAI_MODEL
# (provider-prefixed, e.g. openai/gpt-6-luna); fork PRs can't read org
# vars, so they fall back to the pinned default. The Orkes-Developers
# OpenAI project only allows the gpt-5.6 / gpt-6 families; gpt-6-luna is
# OpenAI's replacement for gpt-4o-mini, which shuts down on 2027-01-14.
CONDUCTOR_AGENT_LLM_MODEL: ${{ vars.E2E_TEST_OPENAI_MODEL || 'openai/gpt-6-luna' }}
SKIP_IMAGE_GEN: 'true' # no image models in the Orkes-Developers OpenAI project; dall-e-3 is retired, so re-enabling also needs gpt-image-1
SKIP_TTS: 'true' # tts-1 is not enabled in the Orkes-Developers OpenAI project (HTTP 403)
steps:
# A dead key, exhausted quota, retired model or provider outage makes
# every agent test fail at its client timeout, three times over with
# reruns — the job then hits timeout-minutes before pytest prints a
# single traceback. Call each model the suites use directly, before any
# setup: the HTTP status and body name the cause in seconds.
- name: LLM provider check
timeout-minutes: 1
run: |
fail=0
probe() { # label, url, curl args...
local label=$1 url=$2; shift 2
local code
code=$(curl -sS -m 15 -o "$RUNNER_TEMP/probe.json" -w '%{http_code}' "$url" "$@" \
-H 'content-type: application/json') || true
echo "$label: HTTP $code"
if [ "$code" != 200 ]; then
echo "::error::$label check failed (HTTP $code; 000 = no response in 15s)"
cat "$RUNNER_TEMP/probe.json" 2>/dev/null || true; echo
fail=1
fi
}
# Responses API, as the server uses; 16 is its minimum max_output_tokens.
openai_model=${CONDUCTOR_AGENT_LLM_MODEL#openai/}
probe "OpenAI $openai_model" https://api.openai.com/v1/responses \
-H "authorization: Bearer $OPENAI_API_KEY" \
-d "{\"model\":\"$openai_model\",\"input\":\"ping\",\"max_output_tokens\":16,\"reasoning\":{\"effort\":\"none\"}}"
for model in claude-sonnet-4-6 claude-sonnet-4-5; do
probe "Anthropic $model" https://api.anthropic.com/v1/messages \
-H "x-api-key: $ANTHROPIC_API_KEY" -H 'anthropic-version: 2023-06-01' \
-d "{\"model\":\"$model\",\"max_tokens\":5,\"messages\":[{\"role\":\"user\",\"content\":\"ping\"}]}"
done
exit $fail
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'pip'
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '21'
- name: Cache server JAR
id: jar_cache
uses: actions/cache@v4
with:
path: conductor-server.jar
key: conductor-oss-server-${{ env.CONDUCTOR_SERVER_VERSION }}
- name: Download server JAR from Maven Central
if: steps.jar_cache.outputs.cache-hit != 'true'
run: |
curl -fL --retry 3 -o conductor-server.jar \
"https://repo1.maven.org/maven2/org/conductoross/conductor-server/${CONDUCTOR_SERVER_VERSION}/conductor-server-${CONDUCTOR_SERVER_VERSION}-boot.jar"
- name: Install SDK + test deps
run: |
python -m pip install --upgrade pip
pip install -e '.[agents]'
# mcp 2.0 dropped mcp.server.fastmcp, which mcp-testkit's server and
# tool modules still import — hold the resolver on the 1.x line until
# the testkit ships a 2.x-compatible release.
# pytest 9.2.0 silently breaks --dist=loadgroup with pytest-xdist 3.8.0:
# xdist_group marks are ignored, so grouped suites (shared ports, shared
# server credentials) run in parallel and collide. Fixed on xdist master
# (pytest-dev/pytest-xdist#1388), not yet released. Once a pytest-xdist
# release after 3.8.0 is out, drop the pytest cap and require that xdist.
pip install 'pytest<9.2' pytest-asyncio pytest-xdist pytest-rerunfailures mcp-testkit 'mcp<2'
- name: Start mcp-testkit
run: |
mcp-testkit --transport http --port 3001 &
# Probe the port instead of a blind sleep — a testkit that dies on
# import used to leave this step green and surface only as downstream
# skips. curl exits non-zero while the port is refusing connections
# (a bare GET on a live /mcp answers 406, which counts as up).
for i in $(seq 1 15); do
if curl -s -o /dev/null http://localhost:3001/mcp; then
echo "mcp-testkit ready after ~${i}s"; exit 0
fi
sleep 1
done
echo "::error::mcp-testkit failed to start on port 3001"
exit 1
- name: Start server
# conductor-oss serves secrets from the server process environment and
# rejects writes, so suites that consume a credential need theirs
# provisioned here or their authenticated phase self-skips.
env:
CONDUCTOR_SECRET_MCP_AUTH_KEY: e2e-test-secret-key-12345
CONDUCTOR_SECRET_HTTP_AUTH_KEY: e2e-http-test-secret-key-67890
run: |
java -jar conductor-server.jar --server.port=8080 > server.log 2>&1 &
- name: Wait for server health
run: |
for i in $(seq 1 45); do
if curl -sf http://localhost:8080/health | grep -q '"healthy"[[:space:]]*:[[:space:]]*true'; then
echo "server healthy after ~$((i*2))s"; exit 0
fi
sleep 2
done
echo "::error::server failed to become healthy within 90s"
tail -100 server.log
exit 1
- name: Run e2e suites
run: |
mkdir -p results
pytest e2e/ -v --tb=short -n 3 --dist=loadgroup \
--junitxml=results/junit-e2e.xml
# The uploaded server.log is lost when the run is re-run, and a run
# killed at timeout-minutes never prints pytest's tracebacks — keep the
# server's own errors in the job log, which survives both.
- name: Show server errors
if: failure() || cancelled()
run: |
[ -f server.log ] || exit 0
grep -nE ' (ERROR|WARN) |Exception|[Qq]uota|rate.?limit|\b(401|403|404|429)\b' server.log \
| grep -vE 'cannot init (Cohere|Mistral)' | tail -150 || true
# e2e/conftest.py pytest.skip()s the whole session when the server is
# unreachable — without this guard a boot failure after the health gate
# (or a future gate regression) would yield a green job that ran nothing.
- name: Guard against silently-empty runs
if: always()
run: |
python - <<'EOF'
import glob
import sys
import xml.etree.ElementTree as ET
total = executed = 0
for path in glob.glob("results/junit-*.xml"):
root = ET.parse(path).getroot()
for suite in root.iter("testsuite"):
t = int(suite.get("tests", 0))
sk = int(suite.get("skipped", 0))
total += t
executed += t - sk
print(f"executed {executed}/{total} tests")
sys.exit(0 if executed > 0 else 1)
EOF
- name: Generate HTML report
if: always()
run: |
python e2e/report_generator.py results/junit-e2e.xml results/report.html || true
- name: Upload results
if: always()
uses: actions/upload-artifact@v4
with:
name: agent-e2e-results
path: |
results/
server.log
retention-days: 14