Move running projects tests into Grunt task (#16946) (#17063)

This commit is contained in:
Kim Joar Bekkelund 2018-03-09 16:00:49 +01:00 committed by GitHub
parent 939222e53a
commit d346ebae54
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 29 additions and 2 deletions

View file

@ -34,6 +34,7 @@ module.exports = function (grunt) {
'test:server',
'test:jest',
'test:jest_integration',
'test:projects',
'test:browser-ci',
'test:api',
'verifyTranslations',

View file

@ -43,6 +43,7 @@ module.exports = function (grunt) {
'test:ui',
'test:jest',
'test:jest_integration',
'test:projects',
'test:browser',
'test:api'
]);
@ -106,4 +107,31 @@ module.exports = function (grunt) {
});
grunt.registerTask('quick-test', ['test:quick']); // historical alias
grunt.registerTask('test:projects', function () {
const done = this.async();
runProjectsTests().then(done, done);
});
function runProjectsTests() {
const serverCmd = {
cmd: 'yarn',
args: ['kbn', 'run', 'test', '--skip-kibana', '--skip-kibana-extra'],
opts: { stdio: 'inherit' }
};
return new Promise((resolve, reject) => {
grunt.util.spawn(serverCmd, (error, result, code) => {
if (error || code !== 0) {
const error = new Error(`projects tests exited with code ${code}`);
grunt.fail.fatal(error);
reject(error);
return;
}
grunt.log.writeln(result);
resolve();
});
});
}
};

View file

@ -3,6 +3,4 @@
set -e
source "$(dirname $0)/../../src/dev/ci_setup/setup.sh"
yarn kbn run test --skip-kibana --skip-kibana-extra
xvfb-run "$(yarn bin)/grunt" jenkins:unit;