Skip to content

Commit 4abc03f

Browse files
committed
removed s3 and kinesis tests
1 parent 6db2a9b commit 4abc03f

File tree

3 files changed

+4
-163
lines changed

3 files changed

+4
-163
lines changed

aws-distro-opentelemetry-node-autoinstrumentation/test/patches/aws/services/kinesis.test.ts

Lines changed: 0 additions & 59 deletions
This file was deleted.

aws-distro-opentelemetry-node-autoinstrumentation/test/patches/aws/services/s3.test.ts

Lines changed: 0 additions & 59 deletions
This file was deleted.

aws-distro-opentelemetry-node-autoinstrumentation/test/patches/instrumentation-patch.test.ts

Lines changed: 4 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,6 @@ import nock = require('nock');
2828
import { ReadableSpan } from '@opentelemetry/sdk-trace-base';
2929
import { getTestSpans, registerInstrumentationTesting } from '@opentelemetry/contrib-test-utils';
3030
import { AwsSdkInstrumentationExtended } from '../../src/patches/extended-instrumentations/aws-sdk-instrumentation-extended';
31-
32-
const _STREAM_NAME: string = 'streamName';
33-
const _BUCKET_NAME: string = 'bucketName';
3431
const _QUEUE_NAME: string = 'queueName';
3532
const _ACTIVITY_ARN: string = 'arn:aws:states:us-east-1:123456789123:activity:testActivity';
3633
const _STATE_MACHINE_ARN: string = 'arn:aws:states:us-east-1:123456789123:stateMachine:testStateMachine';
@@ -69,13 +66,13 @@ describe('InstrumentationPatchTest', () => {
6966
expect(services.has('SQS')).toBeTruthy();
7067
expect(services.has('SNS')).toBeTruthy();
7168
expect(services.has('Lambda')).toBeTruthy();
69+
expect(services.has('S3')).toBeTruthy();
70+
expect(services.has('Kinesis')).toBeTruthy();
7271

7372
expect(services.has('DynamoDB')).toBeTruthy();
7473
// From patching but shouldn't be applied
7574
expect(services.get('SecretsManager')).toBeFalsy();
7675
expect(services.get('SFN')).toBeFalsy();
77-
expect(services.has('S3')).toBeFalsy();
78-
expect(services.has('Kinesis')).toBeFalsy();
7976
expect(services.get('SNS')._requestPreSpanHook).toBeFalsy();
8077
expect(services.get('SNS').requestPreSpanHook).toBeTruthy();
8178
expect(services.get('Lambda')._requestPreSpanHook).toBeFalsy();
@@ -100,8 +97,8 @@ describe('InstrumentationPatchTest', () => {
10097
expect(services.has('SNS')).toBeTruthy();
10198
expect(services.has('DynamoDB')).toBeTruthy();
10299
expect(services.has('Lambda')).toBeTruthy();
103-
expect(services.has('S3')).toBeTruthy();
104-
expect(services.has('Kinesis')).toBeTruthy();
100+
expect(services.has('S3')).toBeFalsy();
101+
expect(services.has('Kinesis')).toBeFalsy();
105102

106103
// From patching
107104
expect(services.has('SecretsManager')).toBeTruthy();
@@ -173,20 +170,6 @@ describe('InstrumentationPatchTest', () => {
173170
expect(() => doExtractBedrockAttributes(services, 'Bedrock')).toThrow();
174171
});
175172

176-
it('S3 with patching', () => {
177-
const patchedAwsSdkInstrumentation: AwsInstrumentation = extractAwsSdkInstrumentation(PATCHED_INSTRUMENTATIONS);
178-
const services: Map<string, any> = extractServicesFromAwsSdkInstrumentation(patchedAwsSdkInstrumentation);
179-
const s3Attributes: Attributes = doExtractS3Attributes(services);
180-
expect(s3Attributes[AWS_ATTRIBUTE_KEYS.AWS_S3_BUCKET]).toEqual(_BUCKET_NAME);
181-
});
182-
183-
it('Kinesis with patching', () => {
184-
const patchedAwsSdkInstrumentation: AwsInstrumentation = extractAwsSdkInstrumentation(PATCHED_INSTRUMENTATIONS);
185-
const services: Map<string, any> = extractServicesFromAwsSdkInstrumentation(patchedAwsSdkInstrumentation);
186-
const kinesisAttributes: Attributes = doExtractKinesisAttributes(services);
187-
expect(kinesisAttributes[AWS_ATTRIBUTE_KEYS.AWS_KINESIS_STREAM_NAME]).toEqual(_STREAM_NAME);
188-
});
189-
190173
it('SNS with patching', () => {
191174
const patchedAwsSdkInstrumentation: AwsInstrumentation = extractAwsSdkInstrumentation(PATCHED_INSTRUMENTATIONS);
192175
const services: Map<string, any> = extractServicesFromAwsSdkInstrumentation(patchedAwsSdkInstrumentation);
@@ -356,30 +339,6 @@ describe('InstrumentationPatchTest', () => {
356339
return services;
357340
}
358341

359-
function doExtractKinesisAttributes(services: Map<string, ServiceExtension>): Attributes {
360-
const serviceName: string = 'Kinesis';
361-
const params: NormalizedRequest = {
362-
serviceName: serviceName,
363-
commandName: 'mockCommandName',
364-
commandInput: {
365-
StreamName: _STREAM_NAME,
366-
},
367-
};
368-
return doExtractAttributes(services, serviceName, params);
369-
}
370-
371-
function doExtractS3Attributes(services: Map<string, ServiceExtension>): Attributes {
372-
const serviceName: string = 'S3';
373-
const params: NormalizedRequest = {
374-
serviceName: serviceName,
375-
commandName: 'mockCommandName',
376-
commandInput: {
377-
Bucket: _BUCKET_NAME,
378-
},
379-
};
380-
return doExtractAttributes(services, serviceName, params);
381-
}
382-
383342
function doExtractSqsAttributes(
384343
services: Map<string, ServiceExtension>,
385344
includeQueueName: boolean = false

0 commit comments

Comments
 (0)