2016-05-20 22:37:10 +03:00
|
|
|
#!/usr/bin/env node
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
require('shelljs/global');
|
|
|
|
set('-e');
|
|
|
|
|
2016-08-01 07:04:35 +03:00
|
|
|
function isPR() {
|
|
|
|
return process.env.TRAVIS_PULL_REQUEST && process.env.TRAVIS_PULL_REQUEST !== 'false';
|
|
|
|
}
|
|
|
|
|
2017-05-08 11:24:25 +03:00
|
|
|
function isCI() {
|
|
|
|
return !!process.env.CI;
|
|
|
|
}
|
|
|
|
|
2016-05-20 22:37:10 +03:00
|
|
|
if (process.env.JOB === 'e2e-guru') {
|
2016-08-01 07:04:35 +03:00
|
|
|
if (isPR()) {
|
|
|
|
console.log('Skiping E2E tests on PR');
|
|
|
|
return;
|
|
|
|
}
|
2016-05-20 22:37:10 +03:00
|
|
|
exec('npm run e2e');
|
|
|
|
} else {
|
|
|
|
exec('npm run unit');
|
2016-08-01 07:04:35 +03:00
|
|
|
if (isPR()) {
|
|
|
|
console.log('Skiping E2E tests on PR');
|
|
|
|
return;
|
|
|
|
}
|
2017-05-08 11:24:25 +03:00
|
|
|
if (!isCI()) {
|
|
|
|
console.log('Skiping E2E tests locally. Use `npm run e2e` to run');
|
|
|
|
return;
|
|
|
|
}
|
2016-05-20 22:37:10 +03:00
|
|
|
console.log('Starting Basic E2E');
|
|
|
|
exec('npm run e2e');
|
|
|
|
}
|