Skip to content

Commit b51604d

Browse files
committed
try some codex stuff
Signed-off-by: Tyler Slaton <[email protected]>
1 parent 12b0983 commit b51604d

File tree

3 files changed

+261
-221
lines changed

3 files changed

+261
-221
lines changed

.github/workflows/dojo-e2e.yml

Lines changed: 37 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,40 +10,70 @@ jobs:
1010
e2e:
1111
name: ${{ matrix.suite }}
1212
runs-on: depot-ubuntu-24.04
13-
strategy:
13+
strategy:
1414
fail-fast: false
1515
matrix:
1616
include:
1717
- suite: smoke
1818
test_path: tests/smoke-only
19+
services: []
20+
wait_on: []
1921
- suite: integration
2022
test_path: tests/integration
23+
services: []
24+
wait_on: []
2125
- suite: copilotkit-home
2226
test_path: tests/copilotkit-home.spec.ts
27+
services: []
28+
wait_on: []
2329
- suite: agno
2430
test_path: tests/agnoTests
31+
services: ["dojo","agno"]
32+
wait_on: ["http://localhost:9999","tcp:localhost:8002"]
2533
- suite: crew-ai
2634
test_path: tests/crewAITests
35+
services: ["dojo","crew-ai"]
36+
wait_on: ["http://localhost:9999","tcp:localhost:8003"]
2737
- suite: langgraph
2838
test_path: tests/langgraphTests
39+
services: ["dojo","langgraph-platform-python","langgraph-platform-typescript"]
40+
wait_on: ["http://localhost:9999","tcp:localhost:8005","tcp:localhost:8006"]
2941
- suite: langgraph-fastapi
3042
test_path: tests/langgraphFastAPITests
43+
services: ["dojo","langgraph-fastapi"]
44+
wait_on: ["http://localhost:9999","tcp:localhost:8004"]
3145
- suite: llama-index
3246
test_path: tests/llamaIndexTests
47+
services: ["dojo","llama-index"]
48+
wait_on: ["http://localhost:9999","tcp:localhost:8007"]
3349
- suite: mastra
3450
test_path: tests/mastraTests
51+
services: ["dojo","mastra"]
52+
wait_on: ["http://localhost:9999","tcp:localhost:8008"]
3553
- suite: mastra-agent-local
3654
test_path: tests/mastraAgentLocalTests
55+
services: ["dojo"]
56+
wait_on: ["http://localhost:9999"]
3757
- suite: middleware-starter
3858
test_path: tests/middlewareStarterTests
59+
services: ["dojo"]
60+
wait_on: ["http://localhost:9999"]
3961
- suite: pydantic-ai
4062
test_path: tests/pydanticAITests
63+
services: ["dojo","pydantic-ai"]
64+
wait_on: ["http://localhost:9999","tcp:localhost:8009"]
4165
- suite: server-starter
4266
test_path: tests/serverStarterTests
67+
services: ["dojo","server-starter"]
68+
wait_on: ["http://localhost:9999","tcp:localhost:8000"]
4369
- suite: server-starter-all
4470
test_path: tests/serverStarterAllFeaturesTests
71+
services: ["dojo","server-starter-all"]
72+
wait_on: ["http://localhost:9999","tcp:localhost:8001"]
4573
- suite: vercel-ai-sdk
4674
test_path: tests/vercelAISdkTests
75+
services: ["dojo"]
76+
wait_on: ["http://localhost:9999"]
4777

4878
steps:
4979
- name: Checkout code
@@ -83,7 +113,8 @@ jobs:
83113

84114
- name: Prepare dojo for e2e
85115
working-directory: typescript-sdk/apps/dojo
86-
run: node ./scripts/prep-dojo-everything.js -e2e
116+
if: ${{ join(matrix.services, ',') != '' }}
117+
run: node ./scripts/prep-dojo-everything.js --only ${{ join(matrix.services, ',') }}
87118

88119
- name: Install e2e dependencies
89120
working-directory: typescript-sdk/apps/dojo/e2e
@@ -95,6 +126,7 @@ jobs:
95126
env:
96127
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
97128
LANGSMITH_API_KEY: ${{ secrets.LANGSMITH_API_KEY }}
129+
if: ${{ contains(join(matrix.services, ','), 'langgraph-fastapi') || contains(join(matrix.services, ','), 'langgraph-platform-python') || contains(join(matrix.services, ','), 'langgraph-platform-typescript') }}
98130
run: |
99131
echo "OPENAI_API_KEY=${OPENAI_API_KEY}" > examples/python/.env
100132
echo "LANGSMITH_API_KEY=${LANGSMITH_API_KEY}" >> examples/python/.env
@@ -108,22 +140,12 @@ jobs:
108140
env:
109141
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
110142
LANGSMITH_API_KEY: ${{ secrets.LANGSMITH_API_KEY }}
143+
if: ${{ join(matrix.services, ',') != '' && contains(join(matrix.services, ','), 'dojo') }}
111144
with:
112145
run: |
113-
node ../scripts/run-dojo-everything.js
146+
node ../scripts/run-dojo-everything.js --only ${{ join(matrix.services, ',') }}
114147
working-directory: typescript-sdk/apps/dojo/e2e
115-
wait-on: |
116-
http://localhost:9999
117-
tcp:localhost:8000
118-
tcp:localhost:8001
119-
tcp:localhost:8002
120-
tcp:localhost:8003
121-
tcp:localhost:8004
122-
tcp:localhost:8005
123-
tcp:localhost:8006
124-
tcp:localhost:8007
125-
tcp:localhost:8008
126-
tcp:localhost:8009
148+
wait-on: ${{ join(matrix.wait_on, '\n') }}
127149

128150
- name: Run tests – ${{ matrix.suite }}
129151
working-directory: typescript-sdk/apps/dojo/e2e

typescript-sdk/apps/dojo/scripts/prep-dojo-everything.js

Lines changed: 94 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,36 @@ const args = process.argv.slice(2);
99
const showHelp = args.includes('--help') || args.includes('-h');
1010
const dryRun = args.includes('--dry-run');
1111

12+
// selection controls
13+
function parseList(flag) {
14+
const idx = args.indexOf(flag);
15+
if (idx !== -1 && args[idx + 1]) {
16+
return args[idx + 1]
17+
.split(',')
18+
.map((s) => s.trim())
19+
.filter(Boolean);
20+
}
21+
return null;
22+
}
23+
24+
const onlyList = parseList('--only') || parseList('--include');
25+
const excludeList = parseList('--exclude') || [];
26+
1227
if (showHelp) {
1328
console.log(`
1429
Usage: node prep-dojo-everything.js [options]
1530
1631
Options:
1732
--dry-run Show what would be installed without actually running
33+
--only list Comma-separated services to include (defaults to all)
34+
--exclude list Comma-separated services to exclude
1835
--help, -h Show this help message
1936
2037
Examples:
2138
node prep-dojo-everything.js
2239
node prep-dojo-everything.js --dry-run
40+
node prep-dojo-everything.js --only dojo,agno
41+
node prep-dojo-everything.js --exclude crew-ai,mastra
2342
`);
2443
process.exit(0);
2544
}
@@ -29,78 +48,62 @@ const integrationsRoot = path.join(gitRoot, 'typescript-sdk', 'integrations');
2948

3049

3150

32-
// Server Starter
33-
const serverStarter = {
34-
command: 'poetry install',
35-
name: 'Server Starter',
36-
cwd: path.join(integrationsRoot, 'server-starter/server/python'),
37-
}
38-
39-
// Server Starter All Features
40-
const serverStarterAllFeatures = {
41-
command: 'poetry install',
42-
name: 'Server AF',
43-
cwd: path.join(integrationsRoot, 'server-starter-all-features/server/python'),
44-
}
45-
46-
// Agno
47-
const agno = {
48-
command: 'uv sync',
49-
name: 'Agno',
50-
cwd: path.join(integrationsRoot, 'agno/examples'),
51-
}
52-
53-
// CrewAI
54-
const crewai = {
55-
command: 'poetry install',
56-
name: 'CrewAI',
57-
cwd: path.join(integrationsRoot, 'crewai/python'),
58-
}
59-
60-
// Langgraph (FastAPI)
61-
const langgraphFastapi = {
62-
command: 'poetry install',
63-
name: 'LG FastAPI',
64-
cwd: path.join(integrationsRoot, 'langgraph/examples/python'),
65-
env: {
66-
POETRY_VIRTUALENVS_IN_PROJECT: "false"
67-
}
68-
}
69-
70-
// Langgraph (Platorm {typescript})
71-
const langgraphPlatformTypescript = {
72-
command: 'pnpm install',
73-
name: 'LG Platform TS',
74-
cwd: path.join(integrationsRoot, 'langgraph/examples/typescript/'),
75-
}
76-
77-
// Llama Index
78-
const llamaIndex = {
79-
command: 'uv sync',
80-
name: 'Llama Index',
81-
cwd: path.join(integrationsRoot, 'llamaindex/server-py'),
82-
}
83-
84-
// Mastra
85-
const mastra = {
86-
command: 'npm install',
87-
name: 'Mastra',
88-
cwd: path.join(integrationsRoot, 'mastra/example'),
89-
}
90-
91-
// Pydantic AI
92-
const pydanticAi = {
93-
command: 'uv sync',
94-
name: 'Pydantic AI',
95-
cwd: path.join(integrationsRoot, 'pydantic-ai/examples'),
96-
}
97-
98-
// THE ACTUAL DOJO
99-
const dojo = {
100-
command: 'pnpm install --no-frozen-lockfile && pnpm build --filter=demo-viewer...',
101-
name: 'Dojo',
102-
cwd: path.join(gitRoot, 'typescript-sdk'),
103-
}
51+
// Define all prep targets keyed by a stable id
52+
const ALL_TARGETS = {
53+
'server-starter': {
54+
command: 'poetry install',
55+
name: 'Server Starter',
56+
cwd: path.join(integrationsRoot, 'server-starter/server/python'),
57+
},
58+
'server-starter-all': {
59+
command: 'poetry install',
60+
name: 'Server AF',
61+
cwd: path.join(integrationsRoot, 'server-starter-all-features/server/python'),
62+
},
63+
'agno': {
64+
command: 'uv sync',
65+
name: 'Agno',
66+
cwd: path.join(integrationsRoot, 'agno/examples'),
67+
},
68+
'crew-ai': {
69+
command: 'poetry install',
70+
name: 'CrewAI',
71+
cwd: path.join(integrationsRoot, 'crewai/python'),
72+
},
73+
'langgraph-fastapi': {
74+
command: 'poetry install',
75+
name: 'LG FastAPI',
76+
cwd: path.join(integrationsRoot, 'langgraph/examples/python'),
77+
env: {
78+
POETRY_VIRTUALENVS_IN_PROJECT: "false",
79+
},
80+
},
81+
'langgraph-platform-typescript': {
82+
command: 'pnpm install',
83+
name: 'LG Platform TS',
84+
cwd: path.join(integrationsRoot, 'langgraph/examples/typescript/'),
85+
},
86+
'llama-index': {
87+
command: 'uv sync',
88+
name: 'Llama Index',
89+
cwd: path.join(integrationsRoot, 'llamaindex/server-py'),
90+
},
91+
'mastra': {
92+
command: 'npm install',
93+
name: 'Mastra',
94+
cwd: path.join(integrationsRoot, 'mastra/example'),
95+
},
96+
'pydantic-ai': {
97+
command: 'uv sync',
98+
name: 'Pydantic AI',
99+
cwd: path.join(integrationsRoot, 'pydantic-ai/examples'),
100+
},
101+
'dojo': {
102+
command: 'pnpm install --no-frozen-lockfile && pnpm build --filter=demo-viewer...',
103+
name: 'Dojo',
104+
cwd: path.join(gitRoot, 'typescript-sdk'),
105+
},
106+
};
104107

105108
function printDryRunServices(procs) {
106109
console.log('Dry run - would install dependencies for the following services:');
@@ -113,18 +116,25 @@ function printDryRunServices(procs) {
113116
}
114117

115118
async function main() {
116-
const procs = [
117-
serverStarter,
118-
serverStarterAllFeatures,
119-
agno,
120-
crewai,
121-
langgraphFastapi,
122-
langgraphPlatformTypescript,
123-
llamaIndex,
124-
mastra,
125-
pydanticAi,
126-
dojo
127-
];
119+
// determine selection
120+
let selectedKeys = Object.keys(ALL_TARGETS);
121+
if (onlyList && onlyList.length) {
122+
selectedKeys = onlyList;
123+
}
124+
if (excludeList && excludeList.length) {
125+
selectedKeys = selectedKeys.filter((k) => !excludeList.includes(k));
126+
}
127+
128+
// Build procs list, warning on unknown keys
129+
const procs = [];
130+
for (const key of selectedKeys) {
131+
const target = ALL_TARGETS[key];
132+
if (!target) {
133+
console.warn(`Skipping unknown service: ${key}`);
134+
continue;
135+
}
136+
procs.push(target);
137+
}
128138

129139
if (dryRun) {
130140
printDryRunServices(procs);

0 commit comments

Comments
 (0)