Commit 91cbc192 by Ben Patterson

Merge pull request #4988 from edx/benp/all-tests-update

jenkins scripts: provide 'all' shard for bok-choy, use as default.
parents 8eeb091d e3b40a8c
...@@ -93,6 +93,13 @@ fi ...@@ -93,6 +93,13 @@ fi
# Activate the Python virtualenv # Activate the Python virtualenv
source $HOME/edx-venv/bin/activate source $HOME/edx-venv/bin/activate
# If the environment variable 'SHARD' is not set, default to 'all'.
# This could happen if you are trying to use this script from
# jenkins and do not define 'SHARD' in your multi-config project.
# Note that you will still need to pass a value for 'TEST_SUITE'
# or else no tests will be executed.
SHARD=${SHARD:="all"}
case "$TEST_SUITE" in case "$TEST_SUITE" in
"quality") "quality")
...@@ -117,24 +124,74 @@ END ...@@ -117,24 +124,74 @@ END
;; ;;
"lms-acceptance") "lms-acceptance")
case "$SHARD" in
"all")
paver test_acceptance -s lms --extra_args="-v 3"
;;
*)
paver test_acceptance -s lms --extra_args="-v 3 --tag shard_${SHARD}" paver test_acceptance -s lms --extra_args="-v 3 --tag shard_${SHARD}"
;; ;;
esac
;;
"cms-acceptance") "cms-acceptance")
case "$SHARD" in
"all")
paver test_acceptance -s cms --extra_args="-v 3"
;;
*)
paver test_acceptance -s cms --extra_args="-v 3 --tag shard_${SHARD}" paver test_acceptance -s cms --extra_args="-v 3 --tag shard_${SHARD}"
;; ;;
esac
;;
"bok-choy") "bok-choy")
case "$SHARD" in case "$SHARD" in
"all")
paver test_bokchoy
paver bokchoy_coverage
;;
"1") "1")
paver test_bokchoy --extra_args="-a shard_1" paver test_bokchoy --extra_args="-a shard_1"
paver bokchoy_coverage
;; ;;
"2") "2")
paver test_bokchoy --extra_args="-a '!shard_1'" paver test_bokchoy --extra_args="-a 'shard_2'"
paver bokchoy_coverage
;; ;;
esac
"3")
paver test_bokchoy --extra_args="-a shard_1=False,shard_2=False"
paver bokchoy_coverage paver bokchoy_coverage
;; ;;
# Default case because if we later define another bok-choy shard on Jenkins
# (e.g. Shard 4) in the multi-config project and expand this file
# with an additional case condition, old branches without that commit
# would not execute any tests on the worker assigned to that shard
# and thus their build would fail.
# This way they will just report 1 test executed and passed.
*)
# Need to create an empty test result so the post-build
# action doesn't fail the build.
# May be unnecessary if we changed the "Skip if there are no test files"
# option to True in the jenkins job definitions.
mkdir -p reports
cat > reports/bok_choy/xunit.xml <<END
<?xml version="1.0" encoding="UTF-8"?>
<testsuite name="nosetests" tests="1" errors="0" failures="0" skip="0">
<testcase classname="acceptance.tests" name="shard_placeholder" time="0.001"></testcase>
</testsuite>
END
;;
esac
;;
esac esac
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment