Skip to content

test(eve): Add e2e test for node-eve - #24228

Open
mydea wants to merge 7 commits into
developfrom
feat/e2e-eve-agent
Open

test(eve): Add e2e test for node-eve#24228
mydea wants to merge 7 commits into
developfrom
feat/e2e-eve-agent

Conversation

@mydea

@mydea mydea commented Sep 9, 2026

Copy link
Copy Markdown
Member

Adds an e2e test app node-eve that runs three optional scenarios:

  1. Plain eve setup - instruments ai calls
  2. Setup with orchestrion (needs --import @sentry/node/import) - instruments other orchestrion libraries too
  3. With latest versions of eve and ai to ensure this remains compatible

The setup:

1. Plain eve setup

// agent/instrumentation.ts
import * as Sentry from '@sentry/node';

Sentry.init({
  dsn: process.env.E2E_TEST_DSN,
  tracesSampleRate: 1.0,
});

This is enough to get basic tracing for ai itself + http/fetch as well as error monitoring working. Nothing else needs to be configured.

2. With orchestrion

When using orchestrion (e.g. you want instrumentation of other dependencies, e.g. mysql or pg or whatever), you need these additional steps:

a. Run eve with NODE_OPTIONS='--import=@sentry/node/import' to ensure orchestrion is preloaded
b. Add packages you want to instrument to externalDependencies:

// agent/agent.ts
import { defineAgent } from 'eve';

export default defineAgent({
  build: {
    externalDependencies: ['pg', 'mysql']
  },
});

In a follow up, we'll try to provide a helper to simplify this.

ref #24015

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Comment thread dev-packages/e2e-tests/test-applications/node-eve/tests/eve.test.ts
Comment thread dev-packages/e2e-tests/test-applications/node-eve/playwright.config.mjs Outdated
@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

⚠️ Warning: Base artifact is not the latest one, because the latest workflow run is not done yet. This may lead to incorrect results. Try to re-run all tests to get up to date results.

Path Size % Change Change
@sentry/browser 28.81 kB - -
@sentry/browser - with treeshaking flags 27.12 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 27.01 kB - -
@sentry/browser (incl. Tracing) 49.22 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 49.22 kB - -
@sentry/browser (incl. Tracing, Profiling) 52.15 kB - -
@sentry/browser (incl. Tracing, Replay) 88.76 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 77.94 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 93.44 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 106.38 kB - -
@sentry/browser (incl. Feedback) 46.3 kB - -
@sentry/browser (incl. sendFeedback) 33.87 kB - -
@sentry/browser (incl. FeedbackAsync) 38.99 kB - -
@sentry/browser (incl. Metrics) 29.84 kB - -
@sentry/browser (incl. Logs) 30.1 kB - -
@sentry/browser (incl. Metrics & Logs) 30.78 kB - -
@sentry/react 30.57 kB - -
@sentry/react (incl. Tracing) 51.57 kB - -
@sentry/vue 36.07 kB - -
@sentry/vue (incl. Tracing) 51.49 kB - -
@sentry/svelte 28.85 kB - -
CDN Bundle 30.56 kB - -
CDN Bundle (incl. Tracing) 49.76 kB - -
CDN Bundle (incl. Logs, Metrics) 32.83 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 51.7 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 73.48 kB - -
CDN Bundle (incl. Tracing, Replay) 87.28 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 89.2 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 93.21 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 95.22 kB - -
CDN Bundle - uncompressed 90.47 kB - -
CDN Bundle (incl. Tracing) - uncompressed 148.17 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 97.04 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 154.13 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 226.3 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 267.76 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 273.71 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 281.46 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 287.4 kB - -
@sentry/nextjs (client) 54.03 kB - -
@sentry/sveltekit (client) 49.68 kB - -
@sentry/core/server 36.99 kB - -
@sentry/core/browser 13.55 kB - -
@sentry/node 127.86 kB +0.02% +21 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 81.61 kB - -
@sentry/node - without tracing 88.73 kB +0.03% +21 B 🔺
@sentry/node - without channel injection 107.11 kB +0.02% +21 B 🔺
@sentry/aws-serverless 97.12 kB +0.03% +26 B 🔺
@sentry/cloudflare (withSentry) - minified 201.98 kB - -
@sentry/cloudflare (withSentry) 502.68 kB - -

View base workflow run

mydea and others added 7 commits September 9, 2026 14:07
Registration-only orchestrion configs (native-channel libraries — ai v7,
ioredis, @redis/client, mysql2, mongoose) carry a custom transform wired into
the bundler plugins only. The runtime loader (`@sentry/server-runtime-injection`
`register`) has no custom transforms, so transforming these modules threw
`TypeError: transform is not a function`, which the diagnostics callback
misreported as the always-on "`@sentry/server-runtime-injection` was bundled
... loads uninstrumented" warning — even though the libraries are correctly
instrumented via their native channel (`setupOnce` / `waitForTracingChannelBinding`).

Exclude registration-only configs from the runtime instrumentation set
(`SENTRY_RUNTIME_INSTRUMENTATIONS`). This is lossless: at runtime the snippet
would only trigger a no-op subscription to `orchestrion:*` channels these
versions never publish.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@mydea
mydea force-pushed the feat/e2e-eve-agent branch from f011d0e to 157f3bb Compare September 9, 2026 12:07

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 157f3bb. Configure here.

const { sessionId } = (await createRes.json()) as { sessionId: string };

const controller = new AbortController();
const timer = setTimeout(() => controller.abort(), 25_000);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stream abort undercuts test timeout

Medium Severity

runAgentTurn aborts the session stream after 25s, which is tighter than the 90s Playwright timeout added because a slow OpenRouter tool-calling turn does not fit in 30s. A slow two-call turn can hit this abort and fail even though the suite still has time left. Flagged because the review rules call out timeout-based e2e flakes.

Fix in Cursor Fix in Web

Triggered by project rule: PR Review Guidelines for Cursor Bot

Reviewed by Cursor Bugbot for commit 157f3bb. Configure here.

// e2e test needs only a single OpenRouter key. eve resolves this authored
// `LanguageModel` at runtime.
const openrouter = createOpenRouter({
apiKey: process.env.E2E_OPENROUTER_API_KEY,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

super-l: Might be worth throwing if the key is absent

// loader instruments regardless (so the "bundled ... uninstrumented"
// warning is a false positive), and externalizing it makes eve's dev
// host fail to resolve its `/register` subpath (`eve dev` only).
externalDependencies: ['dataloader'],

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

q: Do we expect users to do this too?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah just saw the comment in the pr descr 👍


// clean up (although this is tmp, still nice to do)
await rm(tmpDirPath, { recursive: true });
await rm(tmpDirPath, { recursive: true, force: true, maxRetries: 5, retryDelay: 300 });

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this related?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants