From 99728d8f18022f9a9d14abea61656093ccd3d50b Mon Sep 17 00:00:00 2001 From: James Allen Date: Tue, 19 Jun 2018 13:55:01 +0100 Subject: [PATCH] Bail out with exit code on acceptance test failure --- services/web/Makefile | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/services/web/Makefile b/services/web/Makefile index 474155a478..26534b8612 100644 --- a/services/web/Makefile +++ b/services/web/Makefile @@ -196,8 +196,11 @@ test_frontend: test_clean # stop service test_acceptance: test_acceptance_app test_acceptance_modules -test_acceptance_app: test_acceptance_app_start_service test_acceptance_app_run - $(MAKE) test_acceptance_app_stop_service +test_acceptance_app: + @set -e; \ + $(MAKE) test_acceptance_app_start_service; \ + $(MAKE) test_acceptance_app_run; \ + $(MAKE) test_acceptance_app_stop_service; test_acceptance_app_start_service: test_clean # stop service and clear dbs $(MAKE) compile @@ -208,10 +211,12 @@ test_acceptance_app_stop_service: test_acceptance_app_run: @docker-compose ${DOCKER_COMPOSE_FLAGS} exec -T test_acceptance npm -q run test:acceptance -- ${MOCHA_ARGS}; \ - if [ $$? -eq 137 ]; then \ - echo "\nOh dear, it looks like the web process crashed! To see why, run:\n\n\tdocker-compose logs test_acceptance\n"; \ - exit 1; \ - fi + result=$$?; \ + if [ $$result -eq 137 ]; then \ + docker-compose logs --tail=50 test_acceptance; \ + echo "\nOh dear, it looks like the web process crashed! Some logs are above, but to see them all, run:\n\n\tdocker-compose logs test_acceptance\n"; \ + fi; \ + exit $$result test_acceptance_modules: @set -e; \