Skip to content

Commit aa191b1

Browse files
Lms24claude
andauthored
test(e2e): Fix node-firebase span name expectations for span streaming (#24225)
#24069 made firebase `function.gcp` span names low cardinality but only updated the unit tests because the E2E tests were skipped. Meanwhile, we also unskipped the E2E tests in #24164, causing the test to fail. Yet another reason for merge queues. - With span streaming (the v11 default) the span is named after the function, not `firebase.function.<trigger>` — expectations updated accordingly. - Also asserts the new `gcp.function.context.type` attribute, which now carries the old name and drives the span description. Refs #24069 Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent 3a9c24d commit aa191b1

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
test('should create one segment for an HTTP function', async () => {
1010
const spansPromise = collectStreamedSpansUntilSegment(
1111
'node-firebase',
12-
span => span.name === 'firebase.function.http.request' && span.attributes['faas.name']?.value === 'helloWorld',
12+
span => span.name === 'helloWorld' && span.attributes['faas.name']?.value === 'helloWorld',
1313
);
1414

1515
const response = await fetch('http://localhost:5001/demo-functions/default/helloWorld');
@@ -20,7 +20,7 @@ test('should create one segment for an HTTP function', async () => {
2020
const span = spans[0]!;
2121
expect(getSpanOp(span)).toBe('function.gcp');
2222
expect(span).toMatchObject({
23-
name: 'firebase.function.http.request',
23+
name: 'helloWorld',
2424
status: 'ok',
2525
span_id: expect.any(String),
2626
trace_id: expect.any(String),
@@ -29,6 +29,7 @@ test('should create one segment for an HTTP function', async () => {
2929
'faas.name': { value: 'helloWorld', type: 'string' },
3030
'faas.provider': { value: 'firebase', type: 'string' },
3131
'faas.trigger': { value: 'http.request', type: 'string' },
32+
'gcp.function.context.type': { value: 'firebase.function.http.request', type: 'string' },
3233
'sentry.kind': { value: 'server', type: 'string' },
3334
'sentry.origin': { value: 'auto.firebase.functions', type: 'string' },
3435
'sentry.sample_rate': { value: expect.any(Number), type: 'integer' },
@@ -45,9 +46,7 @@ test('should send failed span when the function fails', async () => {
4546
const spanPromise = waitForStreamedSpan(
4647
'node-firebase',
4748
span =>
48-
span.is_segment &&
49-
span.name === 'firebase.function.http.request' &&
50-
span.attributes['faas.name']?.value === 'unhandeledError',
49+
span.is_segment && span.name === 'unhandeledError' && span.attributes['faas.name']?.value === 'unhandeledError',
5150
);
5251

5352
await fetch('http://localhost:5001/demo-functions/default/unhandeledError');
@@ -85,7 +84,7 @@ test('should create a document and trigger onDocumentCreated and another with au
8584
expect(spans).toHaveLength(1);
8685
const segment = spans[0]!;
8786
expect(segment).toMatchObject({
88-
name: `firebase.function.${trigger}`,
87+
name,
8988
status: 'ok',
9089
span_id: expect.any(String),
9190
trace_id: expect.any(String),
@@ -94,6 +93,7 @@ test('should create a document and trigger onDocumentCreated and another with au
9493
'faas.name': { value: name, type: 'string' },
9594
'faas.provider': { value: 'firebase', type: 'string' },
9695
'faas.trigger': { value: trigger, type: 'string' },
96+
'gcp.function.context.type': { value: `firebase.function.${trigger}`, type: 'string' },
9797
'sentry.kind': { value: 'server', type: 'string' },
9898
'sentry.op': { value: 'function.gcp', type: 'string' },
9999
'sentry.origin': { value: 'auto.firebase.functions', type: 'string' },

0 commit comments

Comments
 (0)