Transpile UI func tests once

It makes no sense to transpile tests for every test suite,
so this commit makes transpilation run only once, after UI
build. Also, --no-ui-compression falg renamed to
--no-ui-build - build process now is obligatory and it's not
just a compressions, but a bunch of more complex processes.

Change-Id: If184038c832585396c630d3359c6f4309f3d8eba
This commit is contained in:
Vitaly Kramskikh 2016-04-18 13:08:19 +03:00
parent 0c4900946f
commit 6c116ee494
2 changed files with 14 additions and 13 deletions

View File

@ -162,10 +162,11 @@ gulp.task('intern:run', runIntern(
));
gulp.task('functional-tests', function(cb) {
runSequence('selenium', 'intern:transpile', 'intern:run', function(err) {
var tasks = ['selenium', argv.transpile === false ? null : 'intern:transpile', 'intern:run'];
runSequence.apply(this, _.compact(tasks).concat(function(err) {
shutdownSelenium();
cb(err);
});
}));
});
gulp.task('jison', function() {

View File

@ -21,12 +21,12 @@ function usage {
echo "Run Fuel UI functional tests"
echo ""
echo " -h, --help Print this usage message"
echo " --no-ui-compression Skip UI compression"
echo " --no-ui-build Skip UI build"
echo " --no-nailgun-start Skip Nailgun start"
exit
}
no_ui_compression=0
no_ui_build=0
no_nailgun_start=0
tests=
@ -34,7 +34,7 @@ function process_options {
for arg in $@; do
case "$arg" in
-h|--help) usage;;
--no-ui-compression) no_ui_compression=1;;
--no-ui-build) no_ui_build=1;;
--no-nailgun-start) no_nailgun_start=1;;
-*);;
*) tests="$tests $arg"
@ -84,20 +84,20 @@ function run_ui_func_tests {
TESTS=$@
fi
if [ $no_ui_compression -ne 1 ]; then
echo "Compressing UI... "
if [ $no_ui_build -ne 1 ]; then
echo "Building UI..."
${GULP} build --no-sourcemaps --extra-entries=sinon --static-dir=$NAILGUN_STATIC
if [ $? -ne 0 ]; then
return 1
fi
else
echo "Using compressed UI from $NAILGUN_STATIC"
echo "Using pre-built UI from $NAILGUN_STATIC"
if [ ! -f "$NAILGUN_STATIC/index.html" ]; then
echo "Cannot find compressed UI. Don't use --no-ui-compression key"
echo "Cannot find pre-built UI. Don't use --no-ui-build key"
return 1
fi
fi
echo "Building tests..."
${GULP} intern:transpile
if [ $no_nailgun_start -ne 1 ]; then
pushd "$FUEL_WEB_ROOT" > /dev/null
tox -e stop
@ -119,7 +119,7 @@ function run_ui_func_tests {
SERVER_PORT=$NAILGUN_PORT \
ARTIFACTS=$ARTIFACTS \
${GULP} functional-tests --suites=$testcase || result=1
${GULP} functional-tests --no-transpile --suites=$testcase || result=1
if [ $no_nailgun_start -ne 1 ]; then
pushd "$FUEL_WEB_ROOT" > /dev/null