Skip to content

Commit a79a313

Browse files
Kowserclaude
andcommitted
Port agent e2e suites to jest under repo-root e2e/
All 25 upstream e2e suites move to e2e/ (with fixtures/, _configs/, and the loose harness scripts under e2e/tools/), run by jest.e2e.config.mjs: testMatch e2e/**, 60s default timeout, maxWorkers 3 (upstream's maxForks 3), jest-junit to results/junit-e2e.xml. New script: npm run test:agent-e2e (--forceExit, matching the repo's other jest scripts — agent polling keeps handles open after LLM suites). Deliberately invisible to test/test:unit/test:integration globs — per-PR CI cost is unchanged (verified: unit run still 74 suites). Beyond the mechanical vitest-to-jest pass, six vitest-isms needed real porting (verified by loading all 25 suites under jest — 196 tests enumerate clean — and by running suites 1/2/9 against a live release-JAR server): - expect(actual, message) two-arg form (265 sites, jest 30 rejects it) -> expectMsg helper in e2e/helpers.ts that prepends the diagnostic message to matcher failures - describe(name, { timeout }, fn) options object (19 files) -> file-level jest.setTimeout - it.skipIf(cond) (19 sites) -> itSkipIf helper - it.fails -> it.failing (suite 7) - it(name, { retry: 2 }, fn) (4 sites) -> file-level jest.retryTimes(2) (jest has no per-test retry; both files are LLM-variability suites) - top-level await gates (suites 11/21/23; illegal in CJS) -> synchronous require for the langgraph availability probe, and fail-hard beforeAll health/scheduler gates (matches the TS-e2e fail-hard philosophy; the CI workflow health-gates the server before tests run) Live-server proof (local V1): suites 1/2/9 against agentspan-server 0.4.0 — 11 tests pass; the only failures are server-side OpenAI 401s from the missing local LLM key (the CI run with repo secrets is the full proof). Unused-var noise (port artifacts + upstream) fixed with _-prefixes and import trims; the stylistic eslint relaxations for migrated tests extend to e2e/**. jest-junit output dirs (reports/, results/) are now gitignored. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 398b778 commit a79a313

62 files changed

Lines changed: 13901 additions & 4 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,3 +85,7 @@ fabric.properties
8585
.env.development.local
8686

8787
/.idea
88+
89+
# jest-junit output (unit CI uses reports/, agent e2e uses results/)
90+
reports/
91+
results/

e2e/_configs/01_basic_agent.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"name": "greeter",
3+
"model": "openai/gpt-4o-mini"
4+
}

e2e/_configs/02_tools.json

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
{
2+
"name": "tool_demo_agent",
3+
"model": "openai/gpt-4o-mini",
4+
"instructions": "You are a helpful assistant with access to weather, calculator, and email tools.",
5+
"tools": [
6+
{
7+
"name": "get_weather",
8+
"description": "Get current weather for a city.",
9+
"inputSchema": {
10+
"type": "object",
11+
"properties": {
12+
"city": {
13+
"type": "string",
14+
"description": "The city to get weather for"
15+
}
16+
},
17+
"required": [
18+
"city"
19+
],
20+
"additionalProperties": false,
21+
"$schema": "http://json-schema.org/draft-07/schema#"
22+
},
23+
"toolType": "worker"
24+
},
25+
{
26+
"name": "calculate",
27+
"description": "Evaluate a math expression.",
28+
"inputSchema": {
29+
"type": "object",
30+
"properties": {
31+
"expression": {
32+
"type": "string",
33+
"description": "The math expression to evaluate"
34+
}
35+
},
36+
"required": [
37+
"expression"
38+
],
39+
"additionalProperties": false,
40+
"$schema": "http://json-schema.org/draft-07/schema#"
41+
},
42+
"toolType": "worker"
43+
},
44+
{
45+
"name": "send_email",
46+
"description": "Send an email.",
47+
"inputSchema": {
48+
"type": "object",
49+
"properties": {
50+
"to": {
51+
"type": "string",
52+
"description": "Recipient email address"
53+
},
54+
"subject": {
55+
"type": "string",
56+
"description": "Email subject"
57+
},
58+
"body": {
59+
"type": "string",
60+
"description": "Email body"
61+
}
62+
},
63+
"required": [
64+
"to",
65+
"subject",
66+
"body"
67+
],
68+
"additionalProperties": false,
69+
"$schema": "http://json-schema.org/draft-07/schema#"
70+
},
71+
"toolType": "worker",
72+
"approvalRequired": true,
73+
"timeoutSeconds": 60
74+
}
75+
]
76+
}
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
{
2+
"name": "weather_reporter",
3+
"model": "openai/gpt-4o-mini",
4+
"instructions": "You are a weather reporter. Get the weather and provide a recommendation.",
5+
"tools": [
6+
{
7+
"name": "get_weather",
8+
"description": "Get current weather data for a city.",
9+
"inputSchema": {
10+
"type": "object",
11+
"properties": {
12+
"city": {
13+
"type": "string",
14+
"description": "The city to get weather for"
15+
}
16+
},
17+
"required": [
18+
"city"
19+
],
20+
"additionalProperties": false,
21+
"$schema": "http://json-schema.org/draft-07/schema#"
22+
},
23+
"toolType": "worker"
24+
}
25+
],
26+
"outputType": {
27+
"schema": {
28+
"type": "object",
29+
"properties": {
30+
"city": {
31+
"type": "string"
32+
},
33+
"temperature": {
34+
"type": "number"
35+
},
36+
"condition": {
37+
"type": "string"
38+
},
39+
"recommendation": {
40+
"type": "string"
41+
}
42+
},
43+
"required": [
44+
"city",
45+
"temperature",
46+
"condition",
47+
"recommendation"
48+
],
49+
"additionalProperties": false,
50+
"$schema": "http://json-schema.org/draft-07/schema#"
51+
},
52+
"className": "Output"
53+
}
54+
}

e2e/_configs/05_handoffs.json

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
{
2+
"name": "support",
3+
"model": "openai/gpt-4o-mini",
4+
"instructions": "Route customer requests to the right specialist: billing, technical, or sales.",
5+
"agents": [
6+
{
7+
"name": "billing",
8+
"model": "openai/gpt-4o-mini",
9+
"instructions": "You handle billing questions: balances, payments, invoices.",
10+
"tools": [
11+
{
12+
"name": "check_balance",
13+
"description": "Check the balance of a bank account.",
14+
"inputSchema": {
15+
"type": "object",
16+
"properties": {
17+
"accountId": {
18+
"type": "string",
19+
"description": "The account ID to check"
20+
}
21+
},
22+
"required": [
23+
"accountId"
24+
],
25+
"additionalProperties": false,
26+
"$schema": "http://json-schema.org/draft-07/schema#"
27+
},
28+
"toolType": "worker"
29+
}
30+
]
31+
},
32+
{
33+
"name": "technical",
34+
"model": "openai/gpt-4o-mini",
35+
"instructions": "You handle technical questions: order status, shipping, returns.",
36+
"tools": [
37+
{
38+
"name": "lookup_order",
39+
"description": "Look up the status of an order.",
40+
"inputSchema": {
41+
"type": "object",
42+
"properties": {
43+
"orderId": {
44+
"type": "string",
45+
"description": "The order ID to look up"
46+
}
47+
},
48+
"required": [
49+
"orderId"
50+
],
51+
"additionalProperties": false,
52+
"$schema": "http://json-schema.org/draft-07/schema#"
53+
},
54+
"toolType": "worker"
55+
}
56+
]
57+
},
58+
{
59+
"name": "sales",
60+
"model": "openai/gpt-4o-mini",
61+
"instructions": "You handle sales questions: pricing, products, promotions.",
62+
"tools": [
63+
{
64+
"name": "get_pricing",
65+
"description": "Get pricing information for a product.",
66+
"inputSchema": {
67+
"type": "object",
68+
"properties": {
69+
"product": {
70+
"type": "string",
71+
"description": "The product to get pricing for"
72+
}
73+
},
74+
"required": [
75+
"product"
76+
],
77+
"additionalProperties": false,
78+
"$schema": "http://json-schema.org/draft-07/schema#"
79+
},
80+
"toolType": "worker"
81+
}
82+
]
83+
}
84+
],
85+
"strategy": "handoff"
86+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"name": "researcher_writer_editor",
3+
"agents": [
4+
{
5+
"name": "researcher",
6+
"model": "openai/gpt-4o-mini",
7+
"instructions": "You are a researcher. Given a topic, provide key facts and data points. Be thorough but concise. Output raw research findings."
8+
},
9+
{
10+
"name": "writer",
11+
"model": "openai/gpt-4o-mini",
12+
"instructions": "You are a writer. Take research findings and write a clear, engaging article. Use headers and bullet points where appropriate."
13+
},
14+
{
15+
"name": "editor",
16+
"model": "openai/gpt-4o-mini",
17+
"instructions": "You are an editor. Review the article for clarity, grammar, and tone. Make improvements and output the final polished version."
18+
}
19+
],
20+
"strategy": "sequential"
21+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"name": "analysis",
3+
"model": "openai/gpt-4o-mini",
4+
"agents": [
5+
{
6+
"name": "market_analyst",
7+
"model": "openai/gpt-4o-mini",
8+
"instructions": "You are a market analyst. Analyze the given topic from a market perspective: market size, growth trends, key players, and opportunities."
9+
},
10+
{
11+
"name": "risk_analyst",
12+
"model": "openai/gpt-4o-mini",
13+
"instructions": "You are a risk analyst. Analyze the given topic for risks: regulatory risks, technical risks, competitive threats, and mitigation strategies."
14+
},
15+
{
16+
"name": "compliance",
17+
"model": "openai/gpt-4o-mini",
18+
"instructions": "You are a compliance specialist. Check the given topic for compliance considerations: data privacy, regulatory requirements, and industry standards."
19+
}
20+
],
21+
"strategy": "parallel"
22+
}

e2e/_configs/08_router_agent.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"name": "dev_team",
3+
"model": "openai/gpt-4o-mini",
4+
"instructions": "You are the tech lead. Route requests to the right team member: planner for design/architecture, coder for implementation, reviewer for code review.",
5+
"agents": [
6+
{
7+
"name": "planner",
8+
"model": "openai/gpt-4o-mini",
9+
"instructions": "You create implementation plans. Break down tasks into clear numbered steps."
10+
},
11+
{
12+
"name": "coder",
13+
"model": "openai/gpt-4o-mini",
14+
"instructions": "You write code. Output clean, well-documented Python code."
15+
},
16+
{
17+
"name": "reviewer",
18+
"model": "openai/gpt-4o-mini",
19+
"instructions": "You review code. Check for bugs, style issues, and suggest improvements."
20+
}
21+
],
22+
"strategy": "router",
23+
"router": {
24+
"name": "planner",
25+
"model": "openai/gpt-4o-mini",
26+
"instructions": "You create implementation plans. Break down tasks into clear numbered steps."
27+
}
28+
}

e2e/_configs/10_guardrails.json

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
{
2+
"name": "support_agent",
3+
"model": "openai/gpt-4o-mini",
4+
"instructions": "You are a customer support assistant. Use the available tools to answer questions about orders and customers. Always include all details from the tool results in your response.",
5+
"tools": [
6+
{
7+
"name": "get_order_status",
8+
"description": "Look up the current status of an order.",
9+
"inputSchema": {
10+
"type": "object",
11+
"properties": {
12+
"orderId": {
13+
"type": "string",
14+
"description": "The order ID to look up"
15+
}
16+
},
17+
"required": [
18+
"orderId"
19+
],
20+
"additionalProperties": false,
21+
"$schema": "http://json-schema.org/draft-07/schema#"
22+
},
23+
"toolType": "worker"
24+
},
25+
{
26+
"name": "get_customer_info",
27+
"description": "Retrieve customer details including payment info on file.",
28+
"inputSchema": {
29+
"type": "object",
30+
"properties": {
31+
"customerId": {
32+
"type": "string",
33+
"description": "The customer ID to look up"
34+
}
35+
},
36+
"required": [
37+
"customerId"
38+
],
39+
"additionalProperties": false,
40+
"$schema": "http://json-schema.org/draft-07/schema#"
41+
},
42+
"toolType": "worker"
43+
}
44+
],
45+
"guardrails": [
46+
{
47+
"name": "no_pii",
48+
"position": "output",
49+
"onFail": "retry",
50+
"guardrailType": "custom",
51+
"taskName": "no_pii"
52+
}
53+
]
54+
}

0 commit comments

Comments
 (0)