diff options
author | Jeremy Davis <jeremy.davis@sonarsource.com> | 2021-11-12 10:08:53 +0100 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2021-11-16 20:03:55 +0000 |
commit | ffb5545770465d58a6372f6bb22921e60b05223d (patch) | |
tree | 34baa15bc0d9418e342a865fb2280686e76dcdd9 /server | |
parent | 8871c8fed824a18fe93d9ad167275492426720fa (diff) | |
download | sonarqube-ffb5545770465d58a6372f6bb22921e60b05223d.tar.gz sonarqube-ffb5545770465d58a6372f6bb22921e60b05223d.zip |
SONAR-15635 Send frontend reports to Elastic instance
Diffstat (limited to 'server')
-rw-r--r-- | server/sonar-web/config/jest/ElasticSearchReporter.js | 38 |
1 files changed, 17 insertions, 21 deletions
diff --git a/server/sonar-web/config/jest/ElasticSearchReporter.js b/server/sonar-web/config/jest/ElasticSearchReporter.js index e0c8b571642..6610879ae0d 100644 --- a/server/sonar-web/config/jest/ElasticSearchReporter.js +++ b/server/sonar-web/config/jest/ElasticSearchReporter.js @@ -23,7 +23,7 @@ const fse = require('fs-extra'); const { tokenToString } = require('typescript'); -const ES_ITEM_CATEGORY = 'Validate-UT-Typescript'; +const ES_ITEM_CATEGORY = 'Validate-UT-Frontend'; const ES_ITEM_KIND = 'testcase'; const ES_ITEM_OPERATION = 'total'; const ES_ITEM_SUITE = 'Standalone'; @@ -64,30 +64,26 @@ module.exports = class ElasticSearchReporter { const testClass = this.stripFilePath(testClassResult.testFilePath); return testClassResult.testResults.map(testResult => ({ - fields: { - commit, - build, - category: ES_ITEM_CATEGORY, - kind: ES_ITEM_KIND, - operation: ES_ITEM_OPERATION, - suite: ES_ITEM_SUITE, - measureClass: '', - measureMethod: '', - timestamp, - testClass, - testMethod: testResult.fullName, - duration: testResult.duration - } + commit, + build, + category: ES_ITEM_CATEGORY, + kind: ES_ITEM_KIND, + operation: ES_ITEM_OPERATION, + suite: ES_ITEM_SUITE, + measureClass: '', + measureMethod: '', + timestamp, + testClass, + testMethod: testResult.fullName, + duration: testResult.duration })); } onRunComplete(contexts, { testResults }) { - if (process.env.CIRRUS_BRANCH === 'branch-nightly-build') { - if (!this.outputFilepath) { - throw new Error('option `outputFilepath` is undefined'); - } - - this.collectTestData(testResults); + if (!this.outputFilepath) { + throw new Error('option `outputFilepath` is undefined'); } + + this.collectTestData(testResults); } }; |