mirror of
https://github.com/elastic/kibana.git
synced 2025-04-25 02:09:32 -04:00
* [utils/streams] add createMapStream()
* [utils/toolingLog] make tooling log operate in object mode
* [ci/ftr] log the time before each log message
(cherry picked from commit 31fed421ff
)
38 lines
983 B
JavaScript
38 lines
983 B
JavaScript
import { resolve } from 'path';
|
|
|
|
import moment from 'moment';
|
|
|
|
import { createFunctionalTestRunner } from '../src/functional_test_runner';
|
|
import { createToolingLog, createMapStream } from '../src/utils';
|
|
|
|
export default function (grunt) {
|
|
grunt.registerTask('functionalTestRunner', function () {
|
|
const log = createToolingLog('debug');
|
|
|
|
log
|
|
.pipe(createMapStream(line => {
|
|
return `${moment().format('hh:mm:ss.SSS')} ${line}`;
|
|
}))
|
|
.pipe(process.stdout);
|
|
|
|
const functionalTestRunner = createFunctionalTestRunner({
|
|
log,
|
|
configFile: resolve(__dirname, '../test/functional/config.js'),
|
|
});
|
|
|
|
const callback = this.async();
|
|
functionalTestRunner.run()
|
|
.then(failureCount => {
|
|
if (failureCount) {
|
|
grunt.fail.warn(`${failureCount} test failures`);
|
|
return;
|
|
}
|
|
|
|
callback();
|
|
})
|
|
.catch(err => {
|
|
grunt.fail.warn(err.stack);
|
|
callback(err);
|
|
});
|
|
});
|
|
}
|