Skip to content

Commit

Permalink
Add tag to test suite
Browse files Browse the repository at this point in the history
  • Loading branch information
ericlaz committed Jul 7, 2023
1 parent d1c3bc0 commit 7d8d26b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions packages/dd-trace/src/plugins/util/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ module.exports = {
fromCoverageMapToCoverage,
getTestLineStart,
getCallSites,
removeInvalidGitMetadata
removeInvalidMetadata
}

// Returns pkg manager and its version, separated by '-', e.g. npm-8.15.0 or yarn-1.22.19
Expand Down Expand Up @@ -192,7 +192,7 @@ function getTestEnvironmentMetadata (testFramework, config) {
if (config && config.service) {
metadata['service.name'] = config.service
}
return removeInvalidGitMetadata(metadata)
return removeInvalidMetadata(metadata)
}

function getTestParametersString (parametersByTestName, testName) {
Expand Down
8 changes: 4 additions & 4 deletions packages/dd-trace/test/plugins/util/test.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const {
getCoveredFilenamesFromCoverage,
mergeCoverage,
resetCoverage,
removeInvalidGitMetadata
removeInvalidMetadata
} = require('../../../src/plugins/util/test')

const { GIT_REPOSITORY_URL, GIT_COMMIT_SHA, CI_PIPELINE_URL } = require('../../../src/plugins/util/tags')
Expand Down Expand Up @@ -190,10 +190,10 @@ describe('metadata validation', () => {
[CI_PIPELINE_URL]: 'www.datadog.com5',
[GIT_COMMIT_SHA]: 'abc123'
}
const invalidMetadata5 = { GIT_REPOSITORY_URL: '', CI_PIPELINE_URL: '', GIT_COMMIT_SHA: '' }
const invalidMetadata5 = { [GIT_REPOSITORY_URL]: '', [CI_PIPELINE_URL]: '', [GIT_COMMIT_SHA]: '' }
const invalidMetadatas = [invalidMetadata1, invalidMetadata2, invalidMetadata3, invalidMetadata4, invalidMetadata5]
invalidMetadatas.forEach((invalidMetadata) => {
expect(JSON.stringify(removeInvalidGitMetadata(invalidMetadata))).to.equal(JSON.stringify({}))
expect(JSON.stringify(removeInvalidMetadata(invalidMetadata))).to.equal(JSON.stringify({}))
})
})
it('should keep valid metadata', () => {
Expand All @@ -214,7 +214,7 @@ describe('metadata validation', () => {
}
const validMetadatas = [validMetadata1, validMetadata2, validMetadata3]
validMetadatas.forEach((validMetadata) => {
expect(JSON.stringify(removeInvalidGitMetadata(validMetadata))).to.be.equal(JSON.stringify(validMetadata))
expect(JSON.stringify(removeInvalidMetadata(validMetadata))).to.be.equal(JSON.stringify(validMetadata))
})
})
})

0 comments on commit 7d8d26b

Please sign in to comment.