From 7d8d26baed3ae031053845f1bb622e9619454894 Mon Sep 17 00:00:00 2001 From: "eric.navarro" Date: Fri, 7 Jul 2023 12:26:16 +0200 Subject: [PATCH] Add tag to test suite --- packages/dd-trace/src/plugins/util/test.js | 4 ++-- packages/dd-trace/test/plugins/util/test.spec.js | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/dd-trace/src/plugins/util/test.js b/packages/dd-trace/src/plugins/util/test.js index c76d0b5ad2f..62d8de4aed6 100644 --- a/packages/dd-trace/src/plugins/util/test.js +++ b/packages/dd-trace/src/plugins/util/test.js @@ -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 @@ -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) { diff --git a/packages/dd-trace/test/plugins/util/test.spec.js b/packages/dd-trace/test/plugins/util/test.spec.js index 304650d5fff..06e3d29fa55 100644 --- a/packages/dd-trace/test/plugins/util/test.spec.js +++ b/packages/dd-trace/test/plugins/util/test.spec.js @@ -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') @@ -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', () => { @@ -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)) }) }) })