Skip to content

Commit 2be85c6

Browse files
[integration-test] Fixed an incorrect assumption (#988)
SVLS-8232 ## Overview - corrected the test assumption regarding the span length - minor test case refactor. ## Testing ``` npm test -- lmi.test.ts ... Test Suites: 1 passed, 1 total Tests: 4 skipped, 24 passed, 28 total Snapshots: 0 total Time: 256.65 s ```
1 parent 02891bc commit 2be85c6

1 file changed

Lines changed: 8 additions & 11 deletions

File tree

integration-tests/tests/lmi.test.ts

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -46,21 +46,18 @@ describe('LMI Integration Tests', () => {
4646
expect(results[runtime].traces?.length).toEqual(1);
4747
});
4848

49-
// SVLS-8232
50-
test.skip('trace should have exactly one span', () => {
49+
50+
it('trace should have exactly one span with operation_name=aws.lambda', () => {
5151
const trace = results[runtime].traces![0];
52-
const awsLambdaSpan = trace.spans.find((span: any) =>
53-
span.attributes.operation_name === 'aws.lambda'
54-
);
5552
expect(trace.spans).toBeDefined();
56-
expect(trace.spans.length).toEqual(1);
57-
});
58-
it('trace should have aws.lambda span', () => {
59-
const trace = results[runtime].traces![0];
60-
const awsLambdaSpan = trace.spans.find((span: any) =>
53+
54+
// Filter spans with operation_name='aws.lambda'
55+
const awsLambdaSpans = trace.spans.filter((span: any) =>
6156
span.attributes.operation_name === 'aws.lambda'
6257
);
63-
expect(awsLambdaSpan).toBeDefined();
58+
expect(awsLambdaSpans).toBeDefined();
59+
// Verify exactly one span has operation_name='aws.lambda'
60+
expect(awsLambdaSpans.length).toEqual(1);
6461
});
6562
it('aws.lambda.span should have init_type set to lambda-managed-instances', () => {
6663
const trace = results[runtime].traces![0];

0 commit comments

Comments
 (0)