Skip to content

Commit

Permalink
reduce scope of skipped tests down to just the part of client-sqs ins…
Browse files Browse the repository at this point in the history
…trumentation that is failing: passing span context to the receiveMessage promise handler
  • Loading branch information
trentm committed Dec 5, 2023
1 parent 2053da0 commit 82aae5b
Showing 1 changed file with 22 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ describe('instrumentation-aws-sdk-v3', () => {
});
});

describe.skip('custom service behavior', () => {
describe('custom service behavior', () => {
describe('SQS', () => {
const sqsClient = new SQS({ region });

Expand Down Expand Up @@ -384,7 +384,7 @@ describe('instrumentation-aws-sdk-v3', () => {
);
});

it('sqs receive add messaging attributes and context', done => {
it('sqs receive add messaging attributes', done => {
nock(`https://sqs.${region}.amazonaws.com/`)
.post('/')
.reply(
Expand Down Expand Up @@ -412,17 +412,34 @@ describe('instrumentation-aws-sdk-v3', () => {
'SQS'
);
expect(span.attributes[AttributeNames.AWS_REGION]).toEqual(region);
expect(span.attributes[SemanticAttributes.HTTP_STATUS_CODE]).toEqual(
200
);
done();
});
});

it.skip('sqs receive context', done => {
nock(`https://sqs.${region}.amazonaws.com/`)
.post('/')
.reply(
200,
fs.readFileSync('./test/mock-responses/sqs-receive.xml', 'utf8')
);

const params = {
QueueUrl:
'https://sqs.us-east-1.amazonaws.com/731241200085/otel-demo-aws-sdk',
MaxNumberOfMessages: 3,
};
sqsClient.receiveMessage(params).then(res => {
const receiveCallbackSpan = trace.getSpan(context.active());
expect(receiveCallbackSpan).toBeDefined();
const attributes = (receiveCallbackSpan as unknown as ReadableSpan)
.attributes;
expect(attributes[SemanticAttributes.MESSAGING_OPERATION]).toMatch(
MessagingOperationValues.RECEIVE
);
expect(span.attributes[SemanticAttributes.HTTP_STATUS_CODE]).toEqual(
200
);
done();
});
});
Expand Down

0 comments on commit 82aae5b

Please sign in to comment.