Skip to content

Commit fe56023

Browse files
test(e2e): Run node-eve against eve 1.x (#26580)
## What `node-eve` now runs on eve `^1.0.0`. The `node-eve (latest)` variant is gone, `node-eve (content off)` uses the base install, and a new `node-eve (0.x)` variant runs eve 0.63. ## Why eve 1.0 is out, and the old `^0.63.0` range only installed 0.63.x. Test apps have no lockfile, so `^1.0.0` already installs the newest 1.x and a `latest` variant would run the same thing (same rule as #26579). `ai` goes to `^7.0.172` because eve 1.x needs it as a peer. The 0.x variant pins 0.63, the version the base job used until now, so the SDK's pre-0.84 handling (`step.attempt.started`, `session.waiting`) and eve's old production content default still run somewhere. The content tests now pick their expectations from the installed eve version instead of `SENTRY_GENAI_CONTENT=on`. On eve >= 1.0.0-rc.10 the Sentry trace policy applies, so content is recorded unless `dataCollection.genAI` turns it off. On eve 0.x, production withholds content. The SDK needs no changes: eve 1.0's breaking changes don't touch the instrumentation events, hooks, or `tracePolicy` it uses. <!-- junior-request-attribution:start --> via @mydea. <!-- junior-request-attribution:end --> <!-- junior-session-footer:start --> <!-- junior-conversation-id:slack%3AD0CA8FXFXAS%3A1795007010.989339 --> -- [View Session](https://junior-prod.sentry.dev/conversations/slack%3AD0CA8FXFXAS%3A1795007010.989339) [[Sentry]](https://sentry.sentry.io/explore/conversations/slack%3AD0CA8FXFXAS%3A1795007010.989339/?project=4510944073809921) <!-- junior-session-footer:end --> Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com> Co-authored-by: Francesco Gringl-Novy <[email protected]>
1 parent 61961d3 commit fe56023

3 files changed

Lines changed: 24 additions & 20 deletions

File tree

‎dev-packages/e2e-tests/test-applications/node-eve/package.json‎

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,9 @@
1515
"clean": "npx rimraf node_modules .eve .output pnpm-lock.yaml",
1616
"test:build": "pnpm install && pnpm build",
1717
"test:build-orchestrion": "USE_ORCHESTRION=1 pnpm test:build",
18-
"test:build-latest": "pnpm install && pnpm add eve@latest ai@latest && pnpm build",
19-
"test:build-content-off": "SENTRY_GENAI_CONTENT=off pnpm test:build-latest",
18+
"test:build-0.x": "pnpm install && pnpm add eve@0.63 && pnpm build",
19+
"test:build-content-off": "SENTRY_GENAI_CONTENT=off pnpm test:build",
2020
"test:assert": "pnpm test:prod && pnpm test:dev",
21-
"test:assert-latest": "SENTRY_GENAI_CONTENT=on pnpm test:assert",
2221
"test:assert-content-off": "SENTRY_GENAI_CONTENT=off pnpm test:assert",
2322
"test:assert-orchestrion": "USE_ORCHESTRION=1 pnpm test:assert",
2423
"test:prod": "TEST_ENV=production playwright test",
@@ -27,9 +26,9 @@
2726
"dependencies": {
2827
"@openrouter/ai-sdk-provider": "^3.0.0",
2928
"@sentry/node": "file:../../packed/sentry-node-packed.tgz",
30-
"ai": "^7.0.82",
29+
"ai": "^7.0.172",
3130
"dataloader": "^2.2.3",
32-
"eve": "^0.63.0",
31+
"eve": "^1.0.0",
3332
"zod": "4.6.6"
3433
},
3534
"devDependencies": {
@@ -46,14 +45,14 @@
4645
"optional": true,
4746
"optionalVariants": [
4847
{
49-
"build-command": "pnpm test:build-latest",
50-
"assert-command": "pnpm test:assert-latest",
51-
"label": "node-eve (latest)"
48+
"build-command": "pnpm test:build-0.x",
49+
"assert-command": "pnpm test:assert",
50+
"label": "node-eve (0.x)"
5251
},
5352
{
5453
"build-command": "pnpm test:build-content-off",
5554
"assert-command": "pnpm test:assert-content-off",
56-
"label": "node-eve (content off, latest)"
55+
"label": "node-eve (content off)"
5756
},
5857
{
5958
"build-command": "pnpm test:build-orchestrion",

‎dev-packages/e2e-tests/test-applications/node-eve/tests/eve.test.ts‎

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {
1414
} from '@sentry/conventions/attributes';
1515
import { GEN_AI_DECIDE, GEN_AI_EXECUTE_TOOL, GEN_AI_INVOKE_AGENT } from '@sentry/conventions/op';
1616
import { collectStreamedSpans, getSpanOp, waitForError } from '@sentry-internal/test-utils';
17-
import { runAgentTurn } from './utils';
17+
import { IS_EVE_0X, runAgentTurn } from './utils';
1818

1919
const APP = 'node-eve';
2020

@@ -110,9 +110,12 @@ test('captures Vercel AI agent spans (invoke_agent, generate_content, execute_to
110110
}
111111
});
112112

113-
// `on`: eve >= 1.0.0-rc.10 takes `Sentry.eveInstrumentation()`'s trace policy, so content reaches `ai`'s channel.
114-
// `off`: Sentry's `dataCollection.genAI` turns content off.
115-
const genAIContent = process.env.SENTRY_GENAI_CONTENT;
113+
// eve >= 1.0.0-rc.10 takes `Sentry.eveInstrumentation()`'s trace policy, so content reaches `ai`'s channel and only
114+
// Sentry's `dataCollection.genAI` (`SENTRY_GENAI_CONTENT=off`) turns it off. eve 0.x ignores the trace policy and
115+
// withholds content in production.
116+
const genAIContentOff = process.env.SENTRY_GENAI_CONTENT === 'off';
117+
const expectContent = !genAIContentOff && !IS_EVE_0X;
118+
const expectNoContent = genAIContentOff || (IS_EVE_0X && process.env.TEST_ENV === 'production');
116119

117120
async function runWeatherTurn(baseURL: string) {
118121
const traceSpansPromise = collectStreamedSpans(APP, spansOfTrace =>
@@ -128,7 +131,7 @@ async function runWeatherTurn(baseURL: string) {
128131
}
129132

130133
test('records input and output messages and tool data when content is allowed', async ({ baseURL }) => {
131-
test.skip(genAIContent !== 'on', 'needs SENTRY_GENAI_CONTENT=on');
134+
test.skip(!expectContent, 'needs gen_ai content');
132135

133136
const { invokeAgent, executeTool } = await runWeatherTurn(baseURL!);
134137

@@ -140,11 +143,7 @@ test('records input and output messages and tool data when content is allowed',
140143
});
141144

142145
test('records usage but no messages when content is not allowed', async ({ baseURL }) => {
143-
// eve allows content in development, so without Sentry's opt-out only production shows the default.
144-
test.skip(
145-
genAIContent === 'on' || (genAIContent !== 'off' && process.env.TEST_ENV !== 'production'),
146-
'only without content',
147-
);
146+
test.skip(!expectNoContent, 'only without content');
148147

149148
const { invokeAgent } = await runWeatherTurn(baseURL!);
150149

@@ -185,7 +184,7 @@ test('captures errors thrown inside an eve tool', async ({ baseURL }) => {
185184

186185
test('captures a gen_ai.decide span for a Jev call inside an eve tool', async ({ baseURL }) => {
187186
// `ai` keeps no usage or input on decide spans for calls with recording off.
188-
test.skip(genAIContent === 'off', 'needs gen_ai content');
187+
test.skip(genAIContentOff, 'needs gen_ai content');
189188

190189
const traceSpansPromise = collectStreamedSpans(APP, spansOfTrace =>
191190
[GEN_AI_EXECUTE_TOOL, GEN_AI_DECIDE].every(op => spansOfTrace.some(span => getSpanOp(span) === op)),

‎dev-packages/e2e-tests/test-applications/node-eve/tests/utils.ts‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
import { expect } from '@playwright/test';
2+
import { createRequire } from 'node:module';
3+
4+
const { version: eveVersion } = createRequire(import.meta.url)('eve/package.json') as { version: string };
5+
6+
/** The `node-eve (0.x)` variant installs eve 0.x, which ignores the trace policy. */
7+
export const IS_EVE_0X = eveVersion.startsWith('0.');
28

39
/**
410
* Drive one agent turn through eve's default HTTP channel and wait for it to

0 commit comments

Comments
 (0)