|
@ -3,6 +3,8 @@ |
|
|
const Gunner = require('../gunner'); |
|
|
const Gunner = require('../gunner'); |
|
|
Promise.object = require('@codefeathers/promise.object'); |
|
|
Promise.object = require('@codefeathers/promise.object'); |
|
|
|
|
|
|
|
|
|
|
|
const { performance } = require('perf_hooks'); |
|
|
|
|
|
|
|
|
const { last, pipe, pick, assignToObject } = require('../util'); |
|
|
const { last, pipe, pick, assignToObject } = require('../util'); |
|
|
|
|
|
|
|
|
const buildTestQueue = require('./buildTestQueue'); |
|
|
const buildTestQueue = require('./buildTestQueue'); |
|
@ -50,12 +52,13 @@ const reduceQueue = |
|
|
}) |
|
|
}) |
|
|
.then(result => { |
|
|
.then(result => { |
|
|
|
|
|
|
|
|
const { status } = result; |
|
|
const { status, duration } = result; |
|
|
|
|
|
|
|
|
if (item.type === '@test') { |
|
|
if (item.type === '@test') { |
|
|
|
|
|
|
|
|
const resultObject = { |
|
|
const resultObject = { |
|
|
status, |
|
|
status, |
|
|
|
|
|
duration, |
|
|
description: item.unit.description, |
|
|
description: item.unit.description, |
|
|
...((status === 'notOk' || status === 'skip') |
|
|
...((status === 'notOk' || status === 'skip') |
|
|
&& {reason : result.error |
|
|
&& {reason : result.error |
|
@ -113,11 +116,16 @@ const reduceQueue = |
|
|
*/ |
|
|
*/ |
|
|
const testrunner = (instance) => { |
|
|
const testrunner = (instance) => { |
|
|
|
|
|
|
|
|
|
|
|
const perf = { start: performance.now() }; |
|
|
|
|
|
|
|
|
return Promise.object(pipe( |
|
|
return Promise.object(pipe( |
|
|
buildTestQueue, |
|
|
buildTestQueue, |
|
|
reduceQueue, |
|
|
reduceQueue, |
|
|
pick('results'), |
|
|
pick('results'), |
|
|
)(instance)); |
|
|
)(instance)).then(results => { |
|
|
|
|
|
results.duration = performance.now() - perf.start; |
|
|
|
|
|
return results; |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|