Skip to content

Commit 3d461ca

Browse files
committed
ci: be more restrictive with what tests run
Signed-off-by: Tyler Slaton <[email protected]>
1 parent 5ca083c commit 3d461ca

File tree

1 file changed

+74
-4
lines changed

1 file changed

+74
-4
lines changed

.github/workflows/dojo-e2e.yml

Lines changed: 74 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,37 @@ jobs:
3333
- 'typescript-sdk/turbo.json'
3434
core_py:
3535
- 'python-sdk/**'
36-
e2e_tests:
36+
# Treat e2e config files as core, but tests are filtered per-suite below
37+
e2e_config:
3738
- 'typescript-sdk/apps/dojo/e2e/**'
39+
- '!typescript-sdk/apps/dojo/e2e/tests/**'
40+
e2e_scripts:
3841
- 'typescript-sdk/apps/dojo/scripts/**'
42+
# Per-suite e2e test filters so changing a test only runs that suite
43+
e2e_agno_tests:
44+
- 'typescript-sdk/apps/dojo/e2e/tests/agnoTests/**'
45+
e2e_crew_ai_tests:
46+
- 'typescript-sdk/apps/dojo/e2e/tests/crewAITests/**'
47+
e2e_langgraph_tests:
48+
- 'typescript-sdk/apps/dojo/e2e/tests/langgraphTests/**'
49+
e2e_langgraph_fastapi_tests:
50+
- 'typescript-sdk/apps/dojo/e2e/tests/langgraphFastAPITests/**'
51+
e2e_llama_index_tests:
52+
- 'typescript-sdk/apps/dojo/e2e/tests/llamaIndexTests/**'
53+
e2e_mastra_tests:
54+
- 'typescript-sdk/apps/dojo/e2e/tests/mastraTests/**'
55+
e2e_mastra_agent_local_tests:
56+
- 'typescript-sdk/apps/dojo/e2e/tests/mastraAgentLocalTests/**'
57+
e2e_middleware_starter_tests:
58+
- 'typescript-sdk/apps/dojo/e2e/tests/middlewareStarterTests/**'
59+
e2e_pydantic_ai_tests:
60+
- 'typescript-sdk/apps/dojo/e2e/tests/pydanticAITests/**'
61+
e2e_server_starter_tests:
62+
- 'typescript-sdk/apps/dojo/e2e/tests/serverStarterTests/**'
63+
e2e_server_starter_all_tests:
64+
- 'typescript-sdk/apps/dojo/e2e/tests/serverStarterAllFeaturesTests/**'
65+
e2e_vercel_ai_sdk_tests:
66+
- 'typescript-sdk/apps/dojo/e2e/tests/vercelAISdkTests/**'
3967
workflow_self:
4068
- '.github/workflows/dojo-e2e.yml'
4169
agno:
@@ -64,7 +92,20 @@ jobs:
6492
env:
6593
CORE_TS: ${{ steps.filter.outputs.core_ts }}
6694
CORE_PY: ${{ steps.filter.outputs.core_py }}
67-
E2E_TESTS: ${{ steps.filter.outputs.e2e_tests }}
95+
E2E_CONFIG: ${{ steps.filter.outputs.e2e_config }}
96+
E2E_SCRIPTS: ${{ steps.filter.outputs.e2e_scripts }}
97+
E2E_AGNO_TESTS: ${{ steps.filter.outputs.e2e_agno_tests }}
98+
E2E_CREW_AI_TESTS: ${{ steps.filter.outputs.e2e_crew_ai_tests }}
99+
E2E_LANGGRAPH_TESTS: ${{ steps.filter.outputs.e2e_langgraph_tests }}
100+
E2E_LANGGRAPH_FASTAPI_TESTS: ${{ steps.filter.outputs.e2e_langgraph_fastapi_tests }}
101+
E2E_LLAMA_INDEX_TESTS: ${{ steps.filter.outputs.e2e_llama_index_tests }}
102+
E2E_MASTRA_TESTS: ${{ steps.filter.outputs.e2e_mastra_tests }}
103+
E2E_MASTRA_AGENT_LOCAL_TESTS: ${{ steps.filter.outputs.e2e_mastra_agent_local_tests }}
104+
E2E_MIDDLEWARE_STARTER_TESTS: ${{ steps.filter.outputs.e2e_middleware_starter_tests }}
105+
E2E_PYDANTIC_AI_TESTS: ${{ steps.filter.outputs.e2e_pydantic_ai_tests }}
106+
E2E_SERVER_STARTER_TESTS: ${{ steps.filter.outputs.e2e_server_starter_tests }}
107+
E2E_SERVER_STARTER_ALL_TESTS: ${{ steps.filter.outputs.e2e_server_starter_all_tests }}
108+
E2E_VERCEL_AI_SDK_TESTS: ${{ steps.filter.outputs.e2e_vercel_ai_sdk_tests }}
68109
WORKFLOW_SELF: ${{ steps.filter.outputs.workflow_self }}
69110
AGNO: ${{ steps.filter.outputs.agno }}
70111
CREW_AI: ${{ steps.filter.outputs.crew_ai }}
@@ -99,7 +140,8 @@ jobs:
99140
core_changed = (
100141
(os.environ.get('CORE_TS') == 'true') or
101142
(os.environ.get('CORE_PY') == 'true') or
102-
(os.environ.get('E2E_TESTS') == 'true') or
143+
(os.environ.get('E2E_CONFIG') == 'true') or
144+
(os.environ.get('E2E_SCRIPTS') == 'true') or
103145
(os.environ.get('WORKFLOW_SELF') == 'true')
104146
)
105147
@@ -130,7 +172,35 @@ jobs:
130172
if os.environ.get('VERCEL_AI_SDK') == 'true':
131173
include.append(entry_by_suite['vercel-ai-sdk'])
132174
133-
matrix = {"include": include}
175+
# Include suites whose tests changed directly
176+
if os.environ.get('E2E_AGNO_TESTS') == 'true':
177+
include.append(entry_by_suite['agno'])
178+
if os.environ.get('E2E_CREW_AI_TESTS') == 'true':
179+
include.append(entry_by_suite['crew-ai'])
180+
if os.environ.get('E2E_LANGGRAPH_TESTS') == 'true':
181+
include.append(entry_by_suite['langgraph'])
182+
if os.environ.get('E2E_LANGGRAPH_FASTAPI_TESTS') == 'true':
183+
include.append(entry_by_suite['langgraph-fastapi'])
184+
if os.environ.get('E2E_LLAMA_INDEX_TESTS') == 'true':
185+
include.append(entry_by_suite['llama-index'])
186+
if os.environ.get('E2E_MASTRA_TESTS') == 'true':
187+
include.append(entry_by_suite['mastra'])
188+
if os.environ.get('E2E_MASTRA_AGENT_LOCAL_TESTS') == 'true':
189+
include.append(entry_by_suite['mastra-agent-local'])
190+
if os.environ.get('E2E_MIDDLEWARE_STARTER_TESTS') == 'true':
191+
include.append(entry_by_suite['middleware-starter'])
192+
if os.environ.get('E2E_PYDANTIC_AI_TESTS') == 'true':
193+
include.append(entry_by_suite['pydantic-ai'])
194+
if os.environ.get('E2E_SERVER_STARTER_TESTS') == 'true':
195+
include.append(entry_by_suite['server-starter'])
196+
if os.environ.get('E2E_SERVER_STARTER_ALL_TESTS') == 'true':
197+
include.append(entry_by_suite['server-starter-all'])
198+
if os.environ.get('E2E_VERCEL_AI_SDK_TESTS') == 'true':
199+
include.append(entry_by_suite['vercel-ai-sdk'])
200+
201+
# de-duplicate by suite in case multiple reasons include the same suite
202+
include_unique = list({e['suite']: e for e in include}.values())
203+
matrix = {"include": include_unique}
134204
with open(os.environ['GITHUB_OUTPUT'], 'a') as fh:
135205
fh.write(f"matrix={json.dumps(matrix)}\n")
136206
fh.write(f"should_run={'true' if include else 'false'}\n")

0 commit comments

Comments
 (0)