Skip to content
Draft
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
47 changes: 44 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ concurrency:
cancel-in-progress: true

env:
HEAD_COMMIT: ${{ github.event.inputs.commit || github.sha }}
# Keep the SDK source fixed while benchmark commits change test-file boundaries.
HEAD_COMMIT: ${{ github.event.inputs.commit || github.event.pull_request.head.sha || github.sha }}

CACHED_DEPENDENCY_PATHS: |
${{ github.workspace }}/node_modules
Expand Down Expand Up @@ -575,7 +576,7 @@ jobs:
run: pnpm rebuild @sentry/node-cpu-profiler @sentry/node-native-stacktrace

- name: Run affected tests
run: pnpm run test:pr:node --base=${{ github.event.pull_request.base.sha }}
run: pnpm run test:ci:node
if: github.event_name == 'pull_request'
env:
NODE_VERSION: ${{ matrix.node }}
Expand Down Expand Up @@ -856,6 +857,16 @@ jobs:
working-directory: dev-packages/node-integration-tests
# Tedious runs in the dedicated SQL Server job because its database container requires x86.
run: pnpm run test --shard=${{ matrix.shard }}/${{ matrix.shards }} --exclude '**/tracing/tedious/**'
env:
INTEGRATION_TIMINGS: ${{ runner.temp }}/integration-timings.json
- name: Upload integration timings
if: always()
uses: actions/upload-artifact@v7
with:
name: timings-node-${{ matrix.node }}-${{ matrix.shard }}
path: ${{ runner.temp }}/integration-timings.json
if-no-files-found: error
retention-days: 7

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Timing uploads omit overwrite

Low Severity

The new timing uploads omit overwrite: true, which every other upload-artifact step in this workflow sets. if: always() already uploads after a failed attempt, so a job retry hits a duplicate-name error even if the tests then pass.

Additional Locations (2)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit db3629f. Configure here.


job_sql_server_integration_tests:
name: SQL Server Integration Tests (Node 24)
Expand Down Expand Up @@ -919,6 +930,16 @@ jobs:
- name: Run integration tests
working-directory: dev-packages/cloudflare-integration-tests
run: pnpm run test --shard=${{ matrix.shard }}/${{ matrix.shards }}
env:
INTEGRATION_TIMINGS: ${{ runner.temp }}/integration-timings.json
- name: Upload integration timings
if: always()
uses: actions/upload-artifact@v7
with:
name: timings-cloudflare-${{ matrix.shard }}
path: ${{ runner.temp }}/integration-timings.json
if-no-files-found: error
retention-days: 7
Comment thread
cursor[bot] marked this conversation as resolved.
Resolved

# Shows breakage from new wrangler and workerd releases early. It is not in `job_required_jobs_passed`, so it cannot
# block a PR, and like the optional E2E tests it does not run on release branches.
Expand Down Expand Up @@ -954,7 +975,7 @@ jobs:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
ref: ${{ github.sha }}
- name: Set up Node
uses: actions/setup-node@v7
with:
Expand Down Expand Up @@ -999,6 +1020,16 @@ jobs:
- name: Run integration tests
working-directory: dev-packages/bun-integration-tests
run: pnpm run test --shard=${{ matrix.shard }}/4
env:
INTEGRATION_TIMINGS: ${{ runner.temp }}/integration-timings.json
- name: Upload integration timings
if: always()
uses: actions/upload-artifact@v7
with:
name: timings-bun-${{ matrix.bun }}-${{ matrix.shard }}
path: ${{ runner.temp }}/integration-timings.json
if-no-files-found: error
retention-days: 7

job_deno_integration_tests:
name: Deno Integration Tests (${{ matrix.shard }}/4)
Expand Down Expand Up @@ -1039,6 +1070,16 @@ jobs:
working-directory: dev-packages/deno-integration-tests
# Tedious runs in the dedicated SQL Server job because its database container requires x86.
run: pnpm run test:node-suites --shard=${{ matrix.shard }}/4 --exclude '**/tracing/tedious/**'
env:
INTEGRATION_TIMINGS: ${{ runner.temp }}/integration-timings.json
- name: Upload integration timings
if: always()
uses: actions/upload-artifact@v7
with:
name: timings-deno-${{ matrix.shard }}
path: ${{ runner.temp }}/integration-timings.json
if-no-files-found: error
retention-days: 7

# GitHub Actions allows at most 256 jobs in one matrix, so the E2E tests are split into two jobs that share `env`
# and `steps`.
Expand Down
13 changes: 7 additions & 6 deletions dev-packages/bun-integration-tests/node-suites/excludes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export const NO_AUTO_INSTRUMENTATION = [
'suites/tracing/langchain/**',
'suites/tracing/langgraph/**',
'suites/tracing/lru-memoizer/test.ts',
'suites/tracing/mastra/test.ts',
'suites/tracing/mastra/**',
'suites/tracing/mcp-handler-exact-once/test.ts',
'suites/tracing/mcp-server/**',
'suites/tracing/mistral-v2/test.ts',
Expand All @@ -116,7 +116,7 @@ export const NO_AUTO_INSTRUMENTATION = [
'suites/tracing/mysql2-tracing-channel/test.ts',
'suites/tracing/mysql2/test.ts',
'suites/tracing/neon/test.ts',
'suites/tracing/openai/test.ts',
'suites/tracing/openai/v5/**',
'suites/tracing/openai/v6/test.ts',
'suites/tracing/openai/v7/test.ts',
'suites/tracing/orchestrion-lazy-registration/test.ts',
Expand Down Expand Up @@ -235,15 +235,16 @@ const BUN_BUILD_UNBUNDLEABLE_DEPENDENCY = ['suites/tracing/mistral/test.ts'];
// `@sentry/bun` the request body comes from `bunHttpServerIntegration`.
const BUN_BUILD_NOT_TRIAGED = [
'suites/express/sentry-trace/test.ts',
'suites/express/tracing/test.ts',
'suites/express/tracing/routing/test.ts',
'suites/express/tracing/request-data/test.ts',
'suites/express/with-http/**',
'suites/hono-sdk/test.ts',
'suites/pino/test.ts',
'suites/tracing/google-genai-v2/test.ts',
'suites/tracing/google-genai/test.ts',
'suites/tracing/langchain/v1/test.ts',
'suites/tracing/langchain/v1/**',
'suites/tracing/langgraph/v1/test.ts',
'suites/tracing/mastra/test.ts',
'suites/tracing/mastra/**',
'suites/tracing/mcp-handler-exact-once/test.ts',
'suites/tracing/mcp-server-streamed/test.ts',
'suites/tracing/mongodb-v4/test.ts',
Expand All @@ -260,7 +261,7 @@ const BUN_BUILD_NOT_TRIAGED = [
'suites/tracing/mysql/test.ts',
'suites/tracing/prisma-orm-v8/test.ts',
'suites/tracing/together-ai/test.ts',
'suites/tracing/vercelai/v6_v7/test.ts',
'suites/tracing/vercelai/v6_v7/**',
];

export const BUN_BUILD_EXCLUDE = [
Expand Down
6 changes: 5 additions & 1 deletion dev-packages/bun-integration-tests/vite.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ export default defineConfig({
reporters: process.env.DEBUG
? ['default', { summary: false }]
: process.env.GITHUB_ACTIONS
? ['dot', 'github-actions']
? [
'dot',
'github-actions',
...(process.env.INTEGRATION_TIMINGS ? ['../node-integration-tests/benchmark-reporter.ts'] : []),
]
: ['verbose'],
projects: [
{
Expand Down
6 changes: 5 additions & 1 deletion dev-packages/cloudflare-integration-tests/vite.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@ export default defineConfig({
reporters: process.env.DEBUG
? ['default', { summary: false }]
: process.env.GITHUB_ACTIONS
? ['dot', 'github-actions']
? [
'dot',
'github-actions',
...(process.env.INTEGRATION_TIMINGS ? ['../node-integration-tests/benchmark-reporter.ts'] : []),
]
: ['verbose'],
},
});
6 changes: 3 additions & 3 deletions dev-packages/deno-integration-tests/node-suites/excludes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const PRISMA_ESM_INTEROP = ['suites/tracing/prisma-orm-v5/test.ts', 'suites/trac
// which any module load hook breaks on Deno 2.8.3 (the CI version); it passes on Deno 2.9.0.
const REQUIRE_OF_ESM_ONLY_DEPENDENCY = [
'suites/tracing/graphql-tracing-channel/**',
'suites/tracing/mastra/test.ts',
'suites/tracing/mastra/**',
'suites/tracing/prisma-orm-v8/test.ts',
];

Expand All @@ -72,12 +72,12 @@ const NOT_TRIAGED = [
'suites/tracing/mongodb/test.ts',
'suites/tracing/mongoose-v5/test.ts',
'suites/tracing/mysql/test.ts',
'suites/tracing/openai/test.ts',
'suites/tracing/openai/v5/**',
'suites/tracing/openai/v7/test.ts',
'suites/tracing/orchestrion-lazy-registration/test.ts',
'suites/tracing/prisma-orm-v7/test.ts',
'suites/tracing/together-ai/test.ts',
'suites/tracing/vercelai/v6_v7/test.ts',
'suites/tracing/vercelai/v6_v7/**',
];

// Passes on Deno when run alone, but failed in about 1 of 3 full runs of this package.
Expand Down
6 changes: 5 additions & 1 deletion dev-packages/deno-integration-tests/vite.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ export default defineConfig({
reporters: process.env.DEBUG
? ['default', { summary: false }]
: process.env.GITHUB_ACTIONS
? ['dot', 'github-actions']
? [
'dot',
'github-actions',
...(process.env.INTEGRATION_TIMINGS ? ['../node-integration-tests/benchmark-reporter.ts'] : []),
]
: ['verbose'],
},
});
32 changes: 32 additions & 0 deletions dev-packages/node-integration-tests/benchmark-reporter.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { mkdirSync, writeFileSync } from 'node:fs';
import { dirname } from 'node:path';
import type { Reporter, TestModule } from 'vitest/node';

export default class BenchmarkReporter implements Reporter {
onTestRunEnd(modules: ReadonlyArray<TestModule>, errors: ReadonlyArray<unknown>, reason: string): void {
const path = process.env.INTEGRATION_TIMINGS;
if (!path) return;
mkdirSync(dirname(path), { recursive: true });
writeFileSync(
path,
JSON.stringify(
{
source: process.env.HEAD_COMMIT,
node: process.version,
reason,
errors: errors.length,
files: modules.map(module => ({
project: module.project.name,
file: module.relativeModuleId,
durationMs: module.diagnostic().duration,
collectMs: module.diagnostic().collectDuration,
state: module.state(),
tests: [...module.children.allTests()].map(test => ({ name: test.fullName, state: test.result().state })),
})),
},
null,
2,
),
);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { describe } from 'vitest';
import { registerExpressRequestDataTests } from '../suite';

describe('express tracing', registerExpressRequestDataTests);
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { describe } from 'vitest';
import { registerExpressRoutingTests } from '../suite';

describe('express tracing', registerExpressRoutingTests);
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@ function findExpressSpan(container: SerializedStreamedSpanContainer, type: strin
return container.items.find(item => item.attributes['express.type']?.value === type);
}

describe('express tracing', () => {
export function registerExpressRoutingTests(): void {
afterAll(() => {
cleanupChildProcesses();
});

createEsmAndCjsTests(__dirname, 'scenario.mjs', 'instrument.mjs', (createRunner, test) => {
test('should create and send segment spans for Express routes and spans for middlewares.', async () => {
const runner = createRunner()
Expand Down Expand Up @@ -63,7 +62,6 @@ describe('express tracing', () => {
runner.makeRequest('get', '/test/express');
await runner.completed();
});

test('names router and request handler spans after their route', async () => {
const runner = createRunner()
.expect({
Expand All @@ -90,7 +88,6 @@ describe('express tracing', () => {

await runner.completed();
});

test('should set a correct segment name for routes specified in RegEx', async () => {
const runner = createRunner()
.expect({
Expand All @@ -113,7 +110,6 @@ describe('express tracing', () => {
runner.makeRequest('get', '/test/regex');
await runner.completed();
});

test('nests a sub-router route handler span under the router span', async () => {
const runner = createRunner()
.expect({
Expand Down Expand Up @@ -141,7 +137,6 @@ describe('express tracing', () => {
runner.makeRequest('get', '/test/router/user/42');
await runner.completed();
});

test('keeps the parameter in a route mounted under a parameterized sub-router path', async () => {
const runner = createRunner()
.expect({
Expand All @@ -157,7 +152,6 @@ describe('express tracing', () => {
runner.makeRequest('get', '/test/version/v1/user');
await runner.completed();
});

test('handles root page correctly', async () => {
const runner = createRunner()
.expect({
Expand All @@ -182,9 +176,6 @@ describe('express tracing', () => {
runner.makeRequest('get', '/');
await runner.completed();
});

// With span streaming, child spans are sent as they end, before the response status code is
// known, so `ignoreStatusCodes` has no effect and these routes are captured like any other.
test.each([
{ status_code: 401, url: '/401', status_message: 'unauthenticated', name: 'GET /401', source: 'route' },
{ status_code: 402, url: '/402', status_message: 'invalid_argument', name: 'GET /402', source: 'route' },
Expand Down Expand Up @@ -231,7 +222,6 @@ describe('express tracing', () => {
await runner.completed();
},
);

test.each([['array1'], ['array5']])(
'should set a correct segment name for routes consisting of arrays of routes for %p',
async (segment: string) => {
Expand All @@ -257,7 +247,6 @@ describe('express tracing', () => {
await runner.completed();
},
);

test.each([
['arr/545'],
['arr/required'],
Expand Down Expand Up @@ -289,7 +278,14 @@ describe('express tracing', () => {
await runner.makeRequest('get', `/test/${segment}`);
await runner.completed();
});
});
}

export function registerExpressRequestDataTests(): void {
afterAll(() => {
cleanupChildProcesses();
});
createEsmAndCjsTests(__dirname, 'scenario.mjs', 'instrument.mjs', (createRunner, test) => {
describe('request data', () => {
test('correctly captures JSON request data', async () => {
const runner = createRunner()
Expand Down Expand Up @@ -427,4 +423,4 @@ describe('express tracing', () => {
});
});
});
});
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { describe } from 'vitest';
import { registerLangChainDecisionTests } from '../suite';

describe('LangChain integration (v1)', registerLangChainDecisionTests);
Loading
Loading