mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
* [precommitHook] move to dev script * [eslint] fix lint error * [dev/eslint] do simply boolean checks first * [dev] use shared REPO_ROOT constant * [dev/File] precompute relative/ext of path * [dev/eslint] fix relative import * [dev/eslint] fix typos * [grunt] remove unused run:eslintStaged config * [dev/run] only create log if we are going to use it * [dev/run/isFailError] ensure return value is Boolean * [dev/precommitHook] use less intermediate vars
36 lines
900 B
JavaScript
36 lines
900 B
JavaScript
import { createFunctionalTestRunner } from '../src/functional_test_runner';
|
|
import { createToolingLog } from '../src/dev';
|
|
|
|
export default function (grunt) {
|
|
grunt.registerMultiTask('functional_test_runner', 'run tests with the functional test runner', function () {
|
|
const {
|
|
logLevel,
|
|
configFile,
|
|
configOverrides
|
|
} = this.options();
|
|
|
|
const log = createToolingLog(logLevel);
|
|
log.pipe(process.stdout);
|
|
|
|
const functionalTestRunner = createFunctionalTestRunner({
|
|
log,
|
|
configFile,
|
|
configOverrides
|
|
});
|
|
|
|
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);
|
|
});
|
|
});
|
|
}
|