diff --git a/.travis.yml b/.travis.yml index cdd210c46..b9194064c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -79,6 +79,8 @@ script: - sudo mkdir -p /harbor - sudo mv ./VERSION /harbor/VERSION - sudo service mysql stop + - sudo make run_clarity_ut CLARITYIMAGE=vmware/harbor-clarity-ui-builder:1.1.1 + - cat ./src/ui_ng/lib/npm-ut-test-results - sudo ./tests/testprepare.sh - sudo docker-compose -f ./make/docker-compose.test.yml up -d - go list ./... | grep -v -E 'vendor|tests' | xargs -L1 fgt golint diff --git a/Makefile b/Makefile index 189878154..eb5039adf 100644 --- a/Makefile +++ b/Makefile @@ -385,6 +385,10 @@ refresh_clarity_builder: $(DOCKERRMIMAGE) $(REGISTRYSERVER)$(DOCKERIMAGENAME_ADMINSERVER):$(NEWCLARITYVERSION); \ fi +run_clarity_ut: + @echo "run clarity ut ..." + @$(DOCKERCMD) run --rm -v $(UINGPATH)/lib:$(CLARITYSEEDPATH)/lib -v $(BUILDPATH)/tests:$(CLARITYSEEDPATH)/tests $(CLARITYIMAGE) $(SHELL) $(CLARITYSEEDPATH)/tests/run-clarity-ut.sh + pushimage: @echo "pushing harbor images ..." @$(DOCKERTAG) $(DOCKERIMAGENAME_ADMINSERVER):$(VERSIONTAG) $(REGISTRYSERVER)$(DOCKERIMAGENAME_ADMINSERVER):$(VERSIONTAG) diff --git a/tests/run-clarity-ut.sh b/tests/run-clarity-ut.sh new file mode 100644 index 000000000..878e9656c --- /dev/null +++ b/tests/run-clarity-ut.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +set -e + +cp -r /harbor_ui/lib/* /harbor_ui + +npm install +npm run test > lib/npm-ut-test-results + +