Skip to content

Commit

Permalink
why does our test suite suck so much
Browse files Browse the repository at this point in the history
  • Loading branch information
tlhunter committed Jul 10, 2024
1 parent ad39514 commit bbdd8a0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
19 changes: 11 additions & 8 deletions packages/datadog-plugin-aws-sdk/test/sns.spec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
/* eslint-disable max-len */
'use strict'

process.env.DD_TRACE_CLOUD_REQUEST_PAYLOAD_TAGGING = '$.MessageAttributes.foo,$.MessageAttributes.redacted.StringValue.foo'
process.env.DD_TRACE_CLOUD_RESPONSE_PAYLOAD_TAGGING = '$.MessageId,$.Attributes.DisplayName'

const sinon = require('sinon')

Check failure on line 7 in packages/datadog-plugin-aws-sdk/test/sns.spec.js

View workflow job for this annotation

GitHub Actions / lint

'sinon' is assigned a value but never used
const semver = require('semver')
const agent = require('../../dd-trace/test/plugins/agent')
Expand Down Expand Up @@ -86,9 +89,9 @@ describe('Sns', function () {

describe('with payload tagging', () => {
before(() => {
console.log('SET ENV VARS')
process.env.DD_TRACE_CLOUD_REQUEST_PAYLOAD_TAGGING = '$.MessageAttributes.foo,$.MessageAttributes.redacted.StringValue.foo'
process.env.DD_TRACE_CLOUD_RESPONSE_PAYLOAD_TAGGING = '$.MessageId,$.Attributes.DisplayName'
// console.log('SET ENV VARS')
// process.env.DD_TRACE_CLOUD_REQUEST_PAYLOAD_TAGGING = '$.MessageAttributes.foo,$.MessageAttributes.redacted.StringValue.foo'
// process.env.DD_TRACE_CLOUD_RESPONSE_PAYLOAD_TAGGING = '$.MessageId,$.Attributes.DisplayName'
return agent.load('aws-sdk', {})
})

Expand All @@ -115,11 +118,11 @@ describe('Sns', function () {
return agent.close({ ritmReset: false, wipe: true })
})

after(() => {
console.log('REMOVE ENV VARS')
delete process.env.DD_TRACE_CLOUD_REQUEST_PAYLOAD_TAGGING
delete process.env.DD_TRACE_CLOUD_RESPONSE_PAYLOAD_TAGGING
})
// after(() => {
// console.log('REMOVE ENV VARS')
// delete process.env.DD_TRACE_CLOUD_REQUEST_PAYLOAD_TAGGING
// delete process.env.DD_TRACE_CLOUD_RESPONSE_PAYLOAD_TAGGING
// })

afterEach(() => {
return agent.reload('aws-sdk')
Expand Down
2 changes: 1 addition & 1 deletion packages/dd-trace/src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -366,14 +366,14 @@ class Config {
options.cloudPayloadTagging?.request, // array
''
))
console.log('DD_TRACE_CLOUD_REQUEST_PAYLOAD_TAGGING', DD_TRACE_CLOUD_REQUEST_PAYLOAD_TAGGING)

const DD_TRACE_CLOUD_RESPONSE_PAYLOAD_TAGGING = splitJSONPathRules(
coalesce(
process.env.DD_TRACE_CLOUD_RESPONSE_PAYLOAD_TAGGING,
options.cloudPayloadTagging?.response,
''
))
console.log('OPTIONS', options)
console.log('DD_TRACE_CLOUD_RESPONSE_PAYLOAD_TAGGING', DD_TRACE_CLOUD_RESPONSE_PAYLOAD_TAGGING)

const DD_TRACE_CLOUD_PAYLOAD_TAGGING_MAX_DEPTH = coalesce(
Expand Down

0 comments on commit bbdd8a0

Please sign in to comment.