From 6deed4bb62f861125180feb050fdce512c020927 Mon Sep 17 00:00:00 2001 From: "mathieu.brunot" Date: Mon, 27 Jul 2020 14:33:15 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=9A=20Allow=20tests=20on=20all=20sites?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: mathieu.brunot --- .travis/docker_test.sh | 46 +++++++++++++++++++++++++----------------- 1 file changed, 28 insertions(+), 18 deletions(-) diff --git a/.travis/docker_test.sh b/.travis/docker_test.sh index 7180eb3..a1e017b 100644 --- a/.travis/docker_test.sh +++ b/.travis/docker_test.sh @@ -51,8 +51,6 @@ echo 'Docker tests successful' FRAPPE_APP_TO_TEST=recod_erpnext_design -echo "Preparing Frappe application '${FRAPPE_APP_TO_TEST}' tests..." - ################################################################################ # Frappe Unit tests # https://frappe.io/docs/user/en/guides/automated-testing/unit-testing @@ -60,24 +58,36 @@ echo "Preparing Frappe application '${FRAPPE_APP_TO_TEST}' tests..." FRAPPE_APP_UNIT_TEST_REPORT="$(pwd)/sites/.${FRAPPE_APP_TO_TEST}_unit_tests.xml" FRAPPE_APP_UNIT_TEST_PROFILE="$(pwd)/sites/.${FRAPPE_APP_TO_TEST}_unit_tests.prof" -#bench run-tests --help +if [ -n "${FRAPPE_APP_TO_TEST}" ]; then -echo "Executing Unit Tests of '${FRAPPE_APP_TO_TEST}' app..." -if [ "${TEST_VERSION}" = "10" ]; then - bench run-tests \ - --app "${FRAPPE_APP_TO_TEST}" \ - --junit-xml-output "${FRAPPE_APP_UNIT_TEST_REPORT}" \ - --profile > "${FRAPPE_APP_UNIT_TEST_PROFILE}" -else - bench run-tests \ - --app "${FRAPPE_APP_TO_TEST}" \ - --coverage \ - --junit-xml-output "${FRAPPE_APP_UNIT_TEST_REPORT}" \ - --profile > "${FRAPPE_APP_UNIT_TEST_PROFILE}" + echo "Preparing Frappe application '${FRAPPE_APP_TO_TEST}' tests..." + + bench set-config allow_tests true -g + + bench doctor + bench enable-scheduler + bench doctor + + #bench run-tests --help + + echo "Executing Unit Tests of '${FRAPPE_APP_TO_TEST}' app..." + if [ "${TEST_VERSION}" = "10" ]; then + bench run-tests \ + --app "${FRAPPE_APP_TO_TEST}" \ + --junit-xml-output "${FRAPPE_APP_UNIT_TEST_REPORT}" \ + --profile > "${FRAPPE_APP_UNIT_TEST_PROFILE}" + else + bench run-tests \ + --app "${FRAPPE_APP_TO_TEST}" \ + --coverage \ + --junit-xml-output "${FRAPPE_APP_UNIT_TEST_REPORT}" \ + --profile > "${FRAPPE_APP_UNIT_TEST_PROFILE}" + + # TODO When frappe supports coverage report in XML format + # https://github.com/frappe/frappe/issues/9696 + # --coverage-report=xml + fi - # TODO When frappe supports coverage report in XML format - # https://github.com/frappe/frappe/issues/9696 - # --coverage-report=xml fi ## Check result of tests