From 70961ca02ca943e85698595d4e0263c94f411d7f Mon Sep 17 00:00:00 2001 From: Meina Zhou Date: Wed, 11 Sep 2019 14:54:43 +0800 Subject: [PATCH] upgrade node js version in ci and split the job to run frontend ut Signed-off-by: Meina Zhou --- .travis.yml | 4 ++++ tests/travis/ui_ut_run.sh | 7 +++++++ tests/travis/ut_install.sh | 6 ------ tests/travis/ut_run.sh | 1 - 4 files changed, 11 insertions(+), 7 deletions(-) create mode 100644 tests/travis/ui_ut_run.sh diff --git a/.travis.yml b/.travis.yml index be4508a97..9b3429fe8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,6 +20,9 @@ matrix: - go: 1.12.5 env: - OFFLINE=true + - node_js: 10.16.2 + env: + - UI_UT=true env: global: - POSTGRESQL_HOST: localhost @@ -64,3 +67,4 @@ script: - if [ "$APITEST_DB" == true ]; then bash ./tests/travis/api_run.sh DB $IP; fi - if [ "$APITEST_LDAP" == true ]; then bash ./tests/travis/api_run.sh LDAP $IP; fi - if [ "$OFFLINE" == true ]; then bash ./tests/travis/distro_installer.sh; fi +- if [ "$UI_UT" == true ]; then bash ./tests/travis/ui_ut_run.sh ; fi diff --git a/tests/travis/ui_ut_run.sh b/tests/travis/ui_ut_run.sh new file mode 100644 index 000000000..e44dd3f06 --- /dev/null +++ b/tests/travis/ui_ut_run.sh @@ -0,0 +1,7 @@ +cd ./src/portal +npm install -g -q --no-progress angular-cli +npm install -g -q --no-progress karma +npm install -q --no-progress +npm run build_lib && npm run link_lib && cd ../.. + +cd ./src/portal && npm run lint && npm run lint:lib && npm run test && cd - \ No newline at end of file diff --git a/tests/travis/ut_install.sh b/tests/travis/ut_install.sh index bed85e341..dfaddb49b 100644 --- a/tests/travis/ut_install.sh +++ b/tests/travis/ut_install.sh @@ -2,12 +2,6 @@ set -e -cd ./src/portal -npm install -g -q --no-progress angular-cli -npm install -g -q --no-progress karma -npm install -q --no-progress -npm run build_lib && npm run link_lib && cd ../.. - sudo apt-get update && sudo apt-get install -y libldap2-dev go get -d github.com/docker/distribution go get -d github.com/docker/libtrust diff --git a/tests/travis/ut_run.sh b/tests/travis/ut_run.sh index c1086f330..7607edaf1 100755 --- a/tests/travis/ut_run.sh +++ b/tests/travis/ut_run.sh @@ -8,7 +8,6 @@ export CHROME_BIN=chromium-browser export DISPLAY=:99.0 sh -e /etc/init.d/xvfb start -cd ./src/portal && npm run lint && npm run lint:lib && npm run test && cd - sudo docker-compose -f ./make/docker-compose.test.yml up -d sleep 10 ./tests/pushimage.sh