From: Kevin Silva Date: Thu, 26 Oct 2023 10:42:36 +0000 (+0200) Subject: [NO-JIRA] Improved datadog frontend log X-Git-Tag: 10.3.0.82913~81 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=b2a39aad5723dff2318964b4a0d1f23e0cdf07c6;p=sonarqube.git [NO-JIRA] Improved datadog frontend log --- diff --git a/server/sonar-web/config/jest/DataDogReporter.js b/server/sonar-web/config/jest/DataDogReporter.js index 08ac6c8dc83..2e95b49e93f 100644 --- a/server/sonar-web/config/jest/DataDogReporter.js +++ b/server/sonar-web/config/jest/DataDogReporter.js @@ -42,10 +42,16 @@ module.exports = class ElasticSearchReporter { collectTestData(testClassResults) { const commit = process.env.GIT_SHA1; + const branchName = process.env.GITHUB_BRANCH; const build = process.env.BUILD_NUMBER; const data = testClassResults.reduce((flattenedTestResults, testClassResult) => { - const formattedTestResults = this.formatTestResults(testClassResult, commit, build); + const formattedTestResults = this.formatTestResults( + testClassResult, + commit, + build, + branchName, + ); return flattenedTestResults.concat(formattedTestResults); }, []); @@ -53,7 +59,7 @@ module.exports = class ElasticSearchReporter { this.writeToFile(data); } - formatTestResults(testClassResult, commit, build) { + formatTestResults(testClassResult, commit, build, branchName) { const timestamp = new Date(testClassResult.perfStats.start).toISOString(); const testClass = this.stripFilePath(testClassResult.testFilePath); @@ -61,6 +67,7 @@ module.exports = class ElasticSearchReporter { .filter((test) => test.status === 'failed') .map((testResult) => ({ commit, + branchName, build, category: ES_ITEM_CATEGORY, timestamp,