Skip to content

Commit

Permalink
💚 Allow tests on all sites
Browse files Browse the repository at this point in the history
Signed-off-by: mathieu.brunot <mathieu.brunot@monogramm.io>
  • Loading branch information
madmath03 committed Jul 27, 2020
1 parent 884f7f8 commit 6deed4b
Showing 1 changed file with 28 additions and 18 deletions.
46 changes: 28 additions & 18 deletions .travis/docker_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,33 +51,43 @@ 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

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
Expand Down

0 comments on commit 6deed4b

Please sign in to comment.