@bitdiver/runner-server
Advanced tools
Comparing version 1.1.11 to 1.2.0
@@ -7,2 +7,6 @@ 'use strict'; | ||
var _extends2 = require('babel-runtime/helpers/extends'); | ||
var _extends3 = _interopRequireDefault(_extends2); | ||
var _map = require('babel-runtime/core-js/map'); | ||
@@ -134,3 +138,4 @@ | ||
async _doRunBatch(opts = {}) { | ||
await this._logStartRun(); | ||
const stepCount = (0, _keys2.default)(this.steps).length; | ||
await this._logStartRun({ testCaseCount: this.testcases.length, stepCount }); | ||
@@ -147,4 +152,2 @@ const testMode = opts.testMode ? opts.testMode : false; | ||
const stepCount = (0, _keys2.default)(this.steps).length; | ||
// first iterate the steps and then the testscases | ||
@@ -240,6 +243,36 @@ for (let i = 0; i < stepIds.length; i++) { | ||
await this._logEndRun(); | ||
await this._logEndRun(this._getRunStatus()); | ||
} | ||
/** | ||
* Computes the status of this run and returns an object with the detail information | ||
* @return status {object} An object with the status summary of this run | ||
*/ | ||
_getRunStatus() { | ||
const testCaseCount = this.testcases.length; | ||
const stepCount = (0, _keys2.default)(this.steps).length; | ||
let fail = 0; | ||
let unknown = 0; | ||
let warn = 0; | ||
let pass = 0; | ||
for (const tcEnvId of this.environmentTestcaseIds) { | ||
const tcEnv = this.environmentTestcaseMap.get(tcEnvId); | ||
if (tcEnv.status === _model.STATUS_WARNING) { | ||
warn++; | ||
} else if (tcEnv.status === _model.STATUS_ERROR) { | ||
fail++; | ||
} else if (tcEnv.status === _model.STATUS_FATAL) { | ||
fail++; | ||
} else if (tcEnv.status === _model.STATUS_OK) { | ||
pass++; | ||
} else if (tcEnv.status === _model.STATUS_UNKNOWN) { | ||
unknown++; | ||
} | ||
} | ||
return { testCaseCount, stepCount, status: { fail, unknown, warn, pass } }; | ||
} | ||
/** | ||
* ends all the testcases and writes the status to the logger | ||
@@ -253,3 +286,4 @@ */ | ||
for (const environmentTestcase of this.environmentTestcaseMap.values()) { | ||
if (this.environmentRun.status > _model.STATUS_ERROR) { | ||
if (this.environmentRun.status === _model.STATUS_FATAL && environmentTestcase.status < _model.STATUS_ERROR) { | ||
// The run aborted due to some error end the testcase was not yet finished | ||
environmentTestcase.status = _model.STATUS_UNKNOWN; | ||
@@ -406,7 +440,7 @@ } | ||
*/ | ||
_logStartRun() { | ||
const data = { | ||
_logStartRun(opts = {}) { | ||
const data = (0, _extends3.default)({ | ||
message: 'Start Run', | ||
suite: this.name | ||
}; | ||
}, opts); | ||
return (0, _model.generateLogs)(this.environmentRun, undefined, this.logAdapter, data, _model.LEVEL_INFO); | ||
@@ -419,8 +453,8 @@ } | ||
*/ | ||
_logEndRun() { | ||
const data = { | ||
_logEndRun(opts = {}) { | ||
const data = (0, _extends3.default)({ | ||
message: 'Stop Run', | ||
suite: this.name, | ||
status: this.environmentRun.status | ||
}; | ||
}, opts); | ||
return (0, _model.generateLogs)(this.environmentRun, undefined, this.logAdapter, data, _model.LEVEL_INFO); | ||
@@ -427,0 +461,0 @@ } |
{ | ||
"name": "@bitdiver/runner-server", | ||
"version": "1.1.11", | ||
"version": "1.2.0", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
73678
2428