-
Notifications
You must be signed in to change notification settings - Fork 1.4k
285 lines (259 loc) · 10.6 KB
/
Copy pathdojo-e2e.yml
File metadata and controls
285 lines (259 loc) · 10.6 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
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
name: e2e
on:
workflow_dispatch:
push:
branches: [main]
paths:
- "integrations/**"
- "apps/dojo/**"
- "middlewares/**"
- "pnpm-lock.yaml"
- "pnpm-workspace.yaml"
- ".github/workflows/dojo-e2e.yml"
- "sdks/python/**"
- "sdks/typescript/**"
pull_request:
branches: [main]
paths:
- "apps/dojo/**"
- "integrations/**"
- "middlewares/**"
- "pnpm-lock.yaml"
- "pnpm-workspace.yaml"
- ".github/workflows/dojo-e2e.yml"
- "sdks/python/**"
- "sdks/typescript/**"
jobs:
check-generated-files:
name: dojo / check-generated-files
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "22"
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 10.13.1
- name: Validate agentFilesMapper and regenerate files.json
working-directory: apps/dojo
run: pnpm generate-content-json
- name: Check files.json is up to date
working-directory: apps/dojo
run: |
if git diff --exit-code src/files.json > /dev/null; then
echo "✅ No changes detected in dojo/src/files.json. Everything is up to date."
else
echo "❌ Detected changes in dojo/src/files.json."
echo ""
echo "The committed files.json doesn't match what would be generated."
echo "Please run \`(p)npm run generate-content-json\` in the apps/dojo folder and commit the updated file."
echo ""
echo "The detected diff was as follows:"
echo "::group::Diff for dojo/src/files.json"
git diff src/files.json
echo "::endgroup::"
exit 1
fi
dojo:
name: dojo / ${{ matrix.suite }}
needs: check-generated-files
runs-on: depot-ubuntu-24.04
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
include:
- suite: a2a-middleware
test_path: tests/a2aMiddlewareTests
services: ["dojo", "a2a-middleware"]
wait_on: http://localhost:9999,http-get://localhost:8011/.well-known/agent.json,http-get://localhost:8012/.well-known/agent.json,http-get://localhost:8013/.well-known/agent.json,http-get://localhost:8014/openapi.json
- suite: adk-middleware
test_path: tests/adkMiddlewareTests
services: ["dojo", "adk-middleware"]
wait_on: http://localhost:9999,tcp:localhost:8010
- suite: agno
test_path: tests/agnoTests
services: ["dojo", "agno"]
wait_on: http://localhost:9999,tcp:localhost:8002
- suite: crew-ai
test_path: tests/crewAITests
services: ["dojo", "crew-ai"]
wait_on: http://localhost:9999,tcp:localhost:8003
- suite: langroid
test_path: tests/langroidTests
services: ["dojo", "langroid"]
wait_on: http://localhost:9999,tcp:localhost:8021
- suite: langgraph-python
test_path: tests/langgraphPythonTests
services: ["dojo", "langgraph-platform-python"]
wait_on: http://localhost:9999,tcp:localhost:8005
- suite: langgraph-typescript
test_path: tests/langgraphTypescriptTests
services: ["dojo", "langgraph-platform-typescript"]
wait_on: http://localhost:9999,tcp:localhost:8006
- suite: langgraph-fastapi
test_path: tests/langgraphFastAPITests
services: ["dojo", "langgraph-fastapi"]
wait_on: http://localhost:9999,tcp:localhost:8004
- suite: llama-index
test_path: tests/llamaIndexTests
services: ["dojo", "llama-index"]
wait_on: http://localhost:9999,tcp:localhost:8007
- suite: mastra
test_path: tests/mastraTests
services: ["dojo", "mastra"]
wait_on: http://localhost:9999,tcp:localhost:8008
- suite: mastra-agent-local
test_path: tests/mastraAgentLocalTests
services: ["dojo"]
wait_on: http://localhost:9999
- suite: middleware-starter
test_path: tests/middlewareStarterTests
services: ["dojo"]
wait_on: http://localhost:9999
- suite: pydantic-ai
test_path: tests/pydanticAITests
services: ["dojo", "pydantic-ai"]
wait_on: http://localhost:9999,tcp:localhost:8009
- suite: server-starter
test_path: tests/serverStarterTests
services: ["dojo", "server-starter"]
wait_on: http://localhost:9999,tcp:localhost:8000
- suite: server-starter-all
test_path: tests/serverStarterAllFeaturesTests
services: ["dojo", "server-starter-all"]
wait_on: http://localhost:9999,tcp:localhost:8001
- suite: aws-strands
test_path: tests/awsStrandsTests
services: ["dojo", "aws-strands"]
wait_on: http://localhost:9999,tcp:localhost:8017
- suite: claude-agent-sdk-python
test_path: tests/claudeAgentSdkPythonTests
services: ["dojo", "claude-agent-sdk-python"]
wait_on: http://localhost:9999,tcp:localhost:8019
- suite: claude-agent-sdk-typescript
test_path: tests/claudeAgentSdkTypescriptTests
services: ["dojo", "claude-agent-sdk-typescript"]
wait_on: http://localhost:9999,tcp:localhost:8020
# - suite: vercel-ai-sdk
# test_path: tests/vercelAISdkTests
# services: ["dojo"]
# wait_on: http://localhost:9999
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "22"
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 10.13.1
# Now that pnpm is available, cache its store to speed installs
- name: Resolve pnpm store path
id: pnpm-store
run: echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- name: Cache pnpm store
uses: actions/cache@v4
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Cache Python dependencies
uses: actions/cache@v4
with:
path: |
~/.cache/pip
~/.cache/pypoetry
~/.cache/uv
**/.venv
key: ${{ runner.os }}-pydeps-${{ matrix.suite }}-${{ hashFiles('**/poetry.lock', '**/pyproject.toml') }}
restore-keys: |
${{ runner.os }}-pydeps-${{ matrix.suite }}-
${{ runner.os }}-pydeps-
- name: Cache Next.js build
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/apps/dojo/.next/cache
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ hashFiles('apps/dojo/src/**/*.ts', 'apps/dojo/src/**/*.tsx', 'apps/dojo/src/**/*.js', 'apps/dojo/src/**/*.jsx') }}
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.yaml') }}-
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: latest
virtualenvs-create: true
virtualenvs-in-project: true
- name: Install uv
uses: astral-sh/setup-uv@v6
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Prepare dojo for e2e
working-directory: apps/dojo
if: ${{ join(matrix.services, ',') != '' }}
run: node ./scripts/prep-dojo-everything.js --only ${{ join(matrix.services, ',') }}
- name: Cache Playwright browsers
id: cache-playwright
uses: actions/cache@v4
with:
path: ~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-${{ hashFiles('apps/dojo/e2e/package.json') }}
restore-keys: |
${{ runner.os }}-playwright-
- name: Install e2e dependencies
working-directory: apps/dojo/e2e
run: pnpm install --ignore-scripts
- name: Install Playwright browsers
working-directory: apps/dojo/e2e
if: steps.cache-playwright.outputs.cache-hit != 'true'
run: pnpm exec playwright install --with-deps chromium
- name: Install Playwright system dependencies
working-directory: apps/dojo/e2e
if: steps.cache-playwright.outputs.cache-hit == 'true'
run: pnpm exec playwright install-deps chromium
- name: Create langgraph stub .env files
if: ${{ contains(join(matrix.services, ','), 'langgraph-platform-python') || contains(join(matrix.services, ','), 'langgraph-platform-typescript') }}
run: |
# langgraph.json declares "env": ".env" — the CLI requires this file
# to exist on disk. Values don't matter since run-dojo-everything.js
# injects LLMock env vars into the process environment.
touch integrations/langgraph/python/examples/.env
touch integrations/langgraph/typescript/examples/.env
- name: write langroid env files
working-directory: integrations/langroid/python/examples
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
if: ${{ contains(join(matrix.services, ','), 'langroid') }}
run: |
echo "OPENAI_API_KEY=${OPENAI_API_KEY}" > .env
- name: Run dojo+agents
uses: JarvusInnovations/background-action@v1
if: ${{ join(matrix.services, ',') != '' && contains(join(matrix.services, ','), 'dojo') }}
with:
run: |
node ../scripts/run-dojo-everything.js --only ${{ join(matrix.services, ',') }}
working-directory: apps/dojo/e2e
wait-on: ${{ matrix.wait_on }}
wait-for: 300000
- name: Run tests – ${{ matrix.suite }}
working-directory: apps/dojo/e2e
env:
BASE_URL: http://localhost:9999
PLAYWRIGHT_SUITE: ${{ matrix.suite }}
run: |
pnpm test -- ${{ matrix.test_path }}
- name: Upload traces – ${{ matrix.suite }}
if: always() # Uploads artifacts even if tests fail
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.suite }}-playwright-traces
path: |
apps/dojo/e2e/test-results/${{ matrix.suite }}/**/*
apps/dojo/e2e/playwright-report/**/*
retention-days: 7