diff --git a/.gitignore b/.gitignore index d9897d5093..2861593388 100644 --- a/.gitignore +++ b/.gitignore @@ -52,6 +52,8 @@ docs/.sass-cache/ client/upload/ +test/*/report + migration-*.sql yarn-error.log *.log diff --git a/package.json b/package.json index ef636a8785..3eb2ee50f0 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,7 @@ "test:ends": "cross-env SUITE=\"end-to-end\" ./sh/test.sh", "test:client-unit": "cross-env SUITE=\"client-unit\" ./sh/test.sh", "test:server-unit": "cross-env SUITE=\"server-unit\" ./sh/test.sh", + "test:show-results": "./sh/show-test-results.sh", "build": "cross-env ./node_modules/.bin/gulp build", "build:db": "cross-env ./sh/build-database.sh", "build:clean": "cross-env ./sh/build-init-database.sh", diff --git a/sh/integration-stock-tests.sh b/sh/integration-stock-tests.sh index 7b9ffbdd80..584ff6bc4c 100755 --- a/sh/integration-stock-tests.sh +++ b/sh/integration-stock-tests.sh @@ -11,6 +11,6 @@ echo "[test] Spawning server process..." echo "[test] running tests using mocha" # run the tests -./node_modules/.bin/mocha --recursive --bail --exit ./test/integration-stock/ +./node_modules/.bin/mocha --recursive --bail --exit ./test/integration-stock/ 2>&1 | tee ./test/integration-stock/report echo "[/test]" diff --git a/sh/integration-tests.sh b/sh/integration-tests.sh index e949c54b6a..c0d0e08809 100755 --- a/sh/integration-tests.sh +++ b/sh/integration-tests.sh @@ -13,6 +13,6 @@ echo "[test] building the server..." echo "[test] running tests using mocha" # run the tests -./node_modules/.bin/mocha --recursive --bail --exit --timeout 20000 ./test/integration/ +./node_modules/.bin/mocha --recursive --bail --exit --timeout 20000 ./test/integration/ 2>&1 | tee ./test/integration/report echo "[/test]" diff --git a/sh/show-test-results.sh b/sh/show-test-results.sh new file mode 100755 index 0000000000..40f545df97 --- /dev/null +++ b/sh/show-test-results.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +echo "TEST RESULTS SUMMARY" +echo +echo "Client Unit Tests" +echo " " `grep "TOTAL" ./test/client-unit/report` +echo +echo "Client Unit Tests" +echo " " `grep 'passing' ./test/server-unit/report` +echo " " `grep 'failing' ./test/server-unit/report` +echo +echo "Integration Tests" +echo " " `grep passing ./test/integration/report` +echo " " `egrep -e '(failing|pending)' ./test/integration/report` +echo +echo "Stock Integration Tests" +echo " " `grep passing ./test/integration-stock/report` +echo " " `egrep -e '(failing|pending)' ./test/integration-stock/report` +echo diff --git a/sh/test.sh b/sh/test.sh index e12a0268fe..a63f748d1b 100755 --- a/sh/test.sh +++ b/sh/test.sh @@ -29,7 +29,7 @@ SUITE=${SUITE:-"ALL"} # run karma (client unit) tests if [ $SUITE = "client-unit" ] || [ $SUITE = "ALL" ] ; then startfold "Running Client Unit Tests..." "test-client-unit"; - ./node_modules/.bin/karma start --single-run --no-auto-watch karma.conf.js + ./node_modules/.bin/karma start --single-run --no-auto-watch karma.conf.js 2>&1 | tee ./test/client-unit/report endfold "test-client-unit" ; fi @@ -43,7 +43,7 @@ fi # run server-unit test if [ $SUITE = "server-unit" ] || [ $SUITE = "ALL" ] ; then startfold "Running server Unit Tests ......" "server-unit" - ./node_modules/.bin/mocha --recursive --exit test/server-unit + ./node_modules/.bin/mocha --recursive --exit test/server-unit 2>&1 | tee ./test/server-unit/report endfold "server-unit" ; fi @@ -60,4 +60,7 @@ fi # endfold "test-end-to-end" ; # fi +# Show summary of results +./sh/show-test-results.sh + exit 0;