Commit aee3281d by Christine Lytwynec

clean up all-tests.sh script

parent b328a2e8
...@@ -15,27 +15,27 @@ set -e ...@@ -15,27 +15,27 @@ set -e
# Possible values are: # Possible values are:
# #
# - "quality": Run the quality (pep8/pylint) checks # - "quality": Run the quality (pep8/pylint) checks
# - "unit": Run the JavaScript and Python unit tests # - "lms-unit": Run the LMS Python unit tests
# (also tests building the Sphinx documentation, # - "cms-unit": Run the CMS Python unit tests
# because we couldn't think of a better place to put it) # - "commonlib-js-unit": Run the JavaScript tests and the Python unit
# tests from the common/lib directory
# - "lms-acceptance": Run the acceptance (Selenium) tests for the LMS # - "lms-acceptance": Run the acceptance (Selenium) tests for the LMS
# - "cms-acceptance": Run the acceptance (Selenium) tests for Studio # - "cms-acceptance": Run the acceptance (Selenium) tests for Studio
# - "bok-choy": Run acceptance tests that use the bok-choy framework # - "bok-choy": Run acceptance tests that use the bok-choy framework
# #
# `SHARD` is a number (1, 2, or 3) indicating which subset of the tests # `SHARD` is a number indicating which subset of the tests to build.
# to build. Currently, "lms-acceptance" and "bok-choy" each have two
# shards (1 and 2), "cms-acceptance" has three shards (1, 2, and 3),
# and all the other test suites have one shard.
# #
# For the "bok-choy", the tests are put into shard groups using the nose # For "bok-choy" and "lms-unit", the tests are put into shard groups
# 'attr' decorator (e.g. "@attr('shard_1')"). Currently, anything with # using the nose'attr' decorator (e.g. "@attr('shard_1')"). Anything with
# the 'shard_1' attribute will run in the first shard. All other bok-choy # the 'shard_n' attribute will run in the nth shard. If there isn't a
# tests will run in shard 2. # shard explicitly assigned, the test will run in the last shard (the one
# with the highest number).
# #
# For the lettuce acceptance tests, ("lms-" and "cms-acceptance") they # For the lettuce acceptance tests, ("lms-" and "cms-acceptance") they
# are decorated with "@shard_{}" (e.g. @shard_1 for the first shard). # are decorated with "@shard_{}" (e.g. @shard_1 for the first shard).
# The lettuce tests must have a shard specified to be run in jenkins, # The lettuce tests must have a shard specified to be run in jenkins,
# as there is no shard that runs unspecified tests. # as there is no shard that runs unspecified tests. (NOTE: We no longer
# have multiple shards for lettuce tests)
# #
# #
# Jenkins configuration: # Jenkins configuration:
...@@ -95,126 +95,69 @@ END ...@@ -95,126 +95,69 @@ END
exit $EXIT exit $EXIT
;; ;;
# TODO: Remove the "unit" TEST_SUITE in favor of "lms-unit", etc.
# For now it is left in here so that there is not a time limit on how fast
# we need to update the groovy script in the jenkins config after merging
# the changes needed to shard out the unit tests.
"unit")
case "$SHARD" in
"lms")
SHARD=1 paver test_system -s lms --extra_args="--with-flaky" --cov_args="-p" || { EXIT=1; }
;;
"cms-js-commonlib")
SHARD=1 paver test_system -s cms --extra_args="--with-flaky" --cov_args="-p" || { EXIT=1; }
SHARD=1 paver test_js --coverage --skip_clean || { EXIT=1; }
SHARD=1 paver test_lib --skip_clean --extra_args="--with-flaky" --cov_args="-p" || { EXIT=1; }
;;
*)
paver test --extra_args="--with-flaky"
paver coverage
;;
esac
exit $EXIT
;;
"lms-unit") "lms-unit")
case "$SHARD" in case "$SHARD" in
"1") "1")
paver test_system -s lms --extra_args="--attr='shard_1' --with-flaky" --cov_args="-p" || { EXIT=1; } paver test_system -s lms --extra_args="--attr='shard_1' --with-flaky" --cov_args="-p"
;; ;;
"2") "2")
paver test_system -s lms --extra_args="--attr='shard_1=False' --with-flaky" --cov_args="-p" || { EXIT=1; } paver test_system -s lms --extra_args="--attr='shard_1=False' --with-flaky" --cov_args="-p"
;; ;;
*) *)
paver test_system -s lms --extra_args="--with-flaky" --cov_args="-p" || { EXIT=1; } paver test_system -s lms --extra_args="--with-flaky" --cov_args="-p"
;; ;;
esac esac
exit $EXIT
;; ;;
"cms-unit") "cms-unit")
paver test_system -s cms --extra_args="--with-flaky" --cov_args="-p" || { EXIT=1; } paver test_system -s cms --extra_args="--with-flaky" --cov_args="-p"
exit $EXIT
;; ;;
"commonlib-js-unit") "commonlib-js-unit")
paver test_js --coverage --skip_clean || { EXIT=1; } paver test_js --coverage --skip_clean || { EXIT=1; }
paver test_lib --skip_clean --extra_args="--with-flaky" --cov_args="-p" || { EXIT=1; } paver test_lib --skip_clean --extra_args="--with-flaky" --cov_args="-p" || { EXIT=1; }
# This is to ensure that the build status of the shard is properly set
exit $EXIT exit $EXIT
;; ;;
"lms-acceptance") "lms-acceptance")
case "$SHARD" in paver test_acceptance -s lms --extra_args="-v 3"
"all")
paver test_acceptance -s lms --extra_args="-v 3"
;;
"2")
mkdir -p reports
mkdir -p reports/acceptance
cat > reports/acceptance/xunit.xml <<END
<?xml version="1.0" encoding="UTF-8"?>
<testsuite name="nosetests" tests="1" errors="0" failures="0" skip="0">
<testcase classname="lettuce.tests" name="shard_placeholder" time="0.001"></testcase>
</testsuite>
END
;;
*)
paver test_acceptance -s lms --extra_args="-v 3"
;;
esac
;; ;;
"cms-acceptance") "cms-acceptance")
case "$SHARD" in paver test_acceptance -s cms --extra_args="-v 3"
"all"|"1")
paver test_acceptance -s cms --extra_args="-v 3"
;;
"2"|"3")
mkdir -p reports/acceptance
cat > reports/acceptance/xunit.xml <<END
<?xml version="1.0" encoding="UTF-8"?>
<testsuite name="nosetests" tests="1" errors="0" failures="0" skip="0">
<testcase classname="lettuce.tests" name="shard_placeholder" time="0.001"></testcase>
</testsuite>
END
;;
esac
;; ;;
"bok-choy") "bok-choy")
case "$SHARD" in case "$SHARD" in
"all") "all")
paver test_bokchoy || { EXIT=1; } paver test_bokchoy
;; ;;
"1") "1")
paver test_bokchoy --extra_args="-a shard_1 --with-flaky" || { EXIT=1; } paver test_bokchoy --extra_args="-a shard_1 --with-flaky"
;; ;;
"2") "2")
paver test_bokchoy --extra_args="-a 'shard_2' --with-flaky" || { EXIT=1; } paver test_bokchoy --extra_args="-a 'shard_2' --with-flaky"
;; ;;
"3") "3")
paver test_bokchoy --extra_args="-a 'shard_3' --with-flaky" || { EXIT=1; } paver test_bokchoy --extra_args="-a 'shard_3' --with-flaky"
;; ;;
"4") "4")
paver test_bokchoy --extra_args="-a 'shard_4' --with-flaky" || { EXIT=1; } paver test_bokchoy --extra_args="-a 'shard_4' --with-flaky"
;; ;;
"5") "5")
paver test_bokchoy --extra_args="-a 'shard_5' --with-flaky" || { EXIT=1; } paver test_bokchoy --extra_args="-a 'shard_5' --with-flaky"
;; ;;
"6") "6")
paver test_bokchoy --extra_args="-a shard_1=False,shard_2=False,shard_3=False,shard_4=False,shard_5=False --with-flaky" || { EXIT=1; } paver test_bokchoy --extra_args="-a shard_1=False,shard_2=False,shard_3=False,shard_4=False,shard_5=False --with-flaky"
;; ;;
# Default case because if we later define another bok-choy shard on Jenkins # Default case because if we later define another bok-choy shard on Jenkins
...@@ -237,7 +180,5 @@ END ...@@ -237,7 +180,5 @@ END
END END
;; ;;
esac esac
exit $EXIT
;; ;;
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