Add --no-ui-compression key for run_tests.sh
Can be used to skip UI compression to speed up tests development Also fixed a bug with swallowing `gulp build` error Change-Id: I914771bda53017e052a8432ac0180d9c91fb145b
This commit is contained in:
parent
50bd5cf534
commit
01dcc5f25b
53
run_tests.sh
53
run_tests.sh
|
@ -42,6 +42,7 @@ function usage {
|
|||
echo " --ui-func Run UI functional tests"
|
||||
echo " --no-ui-func Don't run UI functional tests"
|
||||
echo " --ui-selenium Run UI functional selenium tests"
|
||||
echo " --no-ui-compression Skip UI compression"
|
||||
echo ""
|
||||
echo "Note: with no options specified, the script will try to run all available"
|
||||
echo " tests with all available checks."
|
||||
|
@ -71,8 +72,9 @@ function process_options {
|
|||
--ui-unit) ui_unit_tests=1;;
|
||||
--no-ui-unit) no_ui_unit_tests=1;;
|
||||
--ui-func) ui_func_tests=1;;
|
||||
--ui-selenium) ui_func_selenium_tests=1;;
|
||||
--no-ui-func) no_ui_func_tests=1;;
|
||||
--ui-selenium) ui_func_selenium_tests=1;;
|
||||
--no-ui-compression) no_ui_compression=1;;
|
||||
-t|--tests) certain_tests=1;;
|
||||
-*) testropts="$testropts $arg";;
|
||||
*) testrargs="$testrargs $arg"
|
||||
|
@ -130,6 +132,7 @@ extensions_tests=0
|
|||
no_extensions_tests=0
|
||||
certain_tests=0
|
||||
ui_func_selenium_tests=0
|
||||
no_ui_compression=0
|
||||
|
||||
function run_tests {
|
||||
run_cleanup
|
||||
|
@ -302,15 +305,23 @@ function run_ui_func_tests {
|
|||
|
||||
pushd $ROOT/nailgun >> /dev/null
|
||||
|
||||
# test compression
|
||||
echo -n "Compressing UI... "
|
||||
local output=$(${GULP} build --static-dir=$COMPRESSED_STATIC_DIR 2>&1)
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "$output"
|
||||
popd >> /dev/null
|
||||
exit 1
|
||||
if [ $no_ui_compression -ne 1 ]; then
|
||||
echo -n "Compressing UI... "
|
||||
local output
|
||||
output=$(${GULP} build --static-dir=$COMPRESSED_STATIC_DIR 2>&1)
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "$output"
|
||||
popd >> /dev/null
|
||||
return 1
|
||||
fi
|
||||
echo "done"
|
||||
else
|
||||
echo "Using compressed UI from $COMPRESSED_STATIC_DIR"
|
||||
if [ ! -f "$COMPRESSED_STATIC_DIR/index.html" ]; then
|
||||
echo "Cannot find compressed UI. Don't use --no-ui-compression key"
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
echo "done"
|
||||
|
||||
# run js testcases
|
||||
local server_log=`mktemp /tmp/test_nailgun_ui_server.XXXX`
|
||||
|
@ -362,15 +373,23 @@ function run_ui_func_selenium_tests {
|
|||
|
||||
pushd $ROOT/nailgun >> /dev/null
|
||||
|
||||
# test compression
|
||||
echo -n "Compressing UI... "
|
||||
local output=$(${GULP} build --static-dir=$COMPRESSED_STATIC_DIR 2>&1)
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "$output"
|
||||
popd >> /dev/null
|
||||
exit 1
|
||||
if [ $no_ui_compression -ne 1 ]; then
|
||||
echo -n "Compressing UI... "
|
||||
local output
|
||||
output=$(${GULP} build --static-dir=$COMPRESSED_STATIC_DIR 2>&1)
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "$output"
|
||||
popd >> /dev/null
|
||||
return 1
|
||||
fi
|
||||
echo "done"
|
||||
else
|
||||
echo "Using compressed UI from $COMPRESSED_STATIC_DIR"
|
||||
if [ ! -f "$COMPRESSED_STATIC_DIR/index.html" ]; then
|
||||
echo "Cannot find compressed UI. Don't use --no-ui-compression key"
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
echo "done"
|
||||
|
||||
# run js testcases
|
||||
local server_log=`mktemp /tmp/test_nailgun_ui_server.XXXX`
|
||||
|
|
Loading…
Reference in New Issue