Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/optional-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@ jobs:
E2E_OPENROUTER_API_KEY: ${{ secrets.E2E_OPENROUTER_API_KEY }}
# Only this app talks to OpenAI directly (OpenRouter has no Decisions route), so only it gets the key.
E2E_OPENAI_DECISIONS_API_KEY:
${{ matrix.test-application == 'node-openai-decisions-send-to-sentry' && secrets.E2E_OPENAI_DECISIONS_API_KEY ||
'' }}
${{ matrix.test-application == 'node-openai-decisions' && secrets.E2E_OPENAI_DECISIONS_API_KEY || '' }}
# Used by test apps that deploy a real Cloudflare Worker, e.g. cloudflare-workers-send-to-sentry
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
Expand Down
2 changes: 1 addition & 1 deletion dev-packages/e2e-tests/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ E2E_TEST_SENTRY_PROJECT=
E2E_OPENROUTER_API_KEY=

# An OpenAI API key for the Decisions API (OpenRouter has no Decisions route).
# Only needed to run node-openai-decisions-send-to-sentry locally.
# Only needed to run node-openai-decisions locally.
E2E_OPENAI_DECISIONS_API_KEY=

# Cloudflare credentials for E2E tests that deploy a real Worker (e.g. cloudflare-workers-send-to-sentry).
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "node-openai-decisions-send-to-sentry",
"description": "The OpenAI Decisions API as a user runs it: a plain Sentry.init on an express app, real decisions requests against OpenAI through the openai client and the Vercel AI SDK, and the gen_ai.decide spans read back from a real Sentry project",
"name": "node-openai-decisions",
"description": "The OpenAI Decisions API as a user runs it: real decisions requests against OpenAI through the openai client and the Vercel AI SDK, and the gen_ai.decide spans they record",
"version": "1.0.0",
"private": true,
"type": "module",
Expand All @@ -27,15 +27,14 @@
"@sentry/conventions": "0.30.0",
"@types/express": "^4.17.21",
"@types/node": "^24.0.0",
"sentry": "~0.44.1",
"typescript": "~5.9.0"
},
"sentryTest": {
"optional": true,
"optionalVariants": [
{
"build-command": "pnpm test:build-latest",
"label": "node-openai-decisions-send-to-sentry (latest)"
"label": "node-openai-decisions (latest)"
}
]
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { getPlaywrightConfig } from '@sentry-internal/test-utils';

const config = getPlaywrightConfig(
{ startCommand: 'pnpm start' },
// Each test makes a real Decisions API call, which does not reliably fit the default 30s timeout.
{ timeout: 90_000 },
);

export default config;
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ const RED_PIXEL =

const app = express();

// Each route makes one `decisions.create` call and answers with the trace id, so the test can find
// the request's spans in Sentry.
// Each route makes one decisions call and answers with the trace id, so the test can check it picked the
// spans of its own request.

app.get('/decide', async (_req, res, next) => {
try {
Expand Down Expand Up @@ -107,5 +107,5 @@ app.use((error: Error, _req: express.Request, res: express.Response, _next: expr
const port = Number(process.env.PORT ?? 3030);
app.listen(port, () => {
// eslint-disable-next-line no-console
console.log(`node-openai-decisions-send-to-sentry listening on port ${port}`);
console.log(`node-openai-decisions listening on port ${port}`);
});
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import * as Sentry from '@sentry/node';

Sentry.init({
dsn: process.env.E2E_TEST_DSN,
environment: 'qa', // dynamic sampling bias to keep transactions
environment: 'qa',
tunnel: 'http://localhost:3031/',
tracesSampleRate: 1,
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { startEventProxyServer } from '@sentry-internal/test-utils';

startEventProxyServer({
port: 3031,
proxyServerName: 'node-openai-decisions',
});
Loading
Loading