diff --git a/lib/xmlReader.js b/lib/xmlReader.js index e382a12a..4407b245 100644 --- a/lib/xmlReader.js +++ b/lib/xmlReader.js @@ -109,7 +109,7 @@ class XmlReader { } processJUnit(jsonSuite) { - const { testsuite, name, tests, failures, errors, time } = jsonSuite; + const { testsuite, name, tests, failures, errors } = jsonSuite; reduceOptions.preferClassname = this.stats.language === 'python'; const resultTests = processTestSuite(testsuite); @@ -117,6 +117,8 @@ class XmlReader { const hasFailures = resultTests.filter(t => t.status === 'failed').length > 0; const status = failures > 0 || errors > 0 || hasFailures ? 'failed' : 'passed'; + const time = testsuite.time || 0; + // debug('time', jsonSuite, time) if (time) { if (!this.stats.duration) this.stats.duration = 0; this.stats.duration += parseFloat(time); @@ -419,19 +421,18 @@ class XmlReader { this.formatErrors(); this.formatTests(); - debug('Uploading data', { - ...this.stats, - tests: this.tests, - }); const dataString = { ...this.stats, detach: this.requestParams.detach, api_key: this.requestParams.apiKey, status: 'finished', + duration: this.stats.duration, tests: this.tests, }; + debug('Uploading data', dataString); + return Promise.all(this.pipes.map(p => p.finishRun(dataString))); }