Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added ability to easily review summary of test results #6982

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ docs/.sass-cache/

client/upload/

test/*/report

migration-*.sql
yarn-error.log
*.log
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion sh/integration-stock-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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]"
2 changes: 1 addition & 1 deletion sh/integration-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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]"
19 changes: 19 additions & 0 deletions sh/show-test-results.sh
Original file line number Diff line number Diff line change
@@ -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
7 changes: 5 additions & 2 deletions sh/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand All @@ -60,4 +60,7 @@ fi
# endfold "test-end-to-end" ;
# fi

# Show summary of results
./sh/show-test-results.sh

exit 0;