PLAT-1858 Better capture of deprecation warnings

This commit is contained in:
Jeremy Bowman
2017-12-14 14:30:40 -05:00
parent dba976fc16
commit 7d436a18ee
12 changed files with 103 additions and 42 deletions

View File

@@ -131,14 +131,8 @@ case "$TEST_SUITE" in
"lms-unit")
case "$SHARD" in
"all")
$TOX paver test_system -s lms --disable_capture $PAVER_ARGS $PARALLEL 2> lms-tests.log
;;
[1-3])
$TOX paver test_system -s lms --disable_capture --eval-attr="shard==$SHARD" $PAVER_ARGS $PARALLEL 2> lms-tests.$SHARD.log
;;
4|"noshard")
$TOX paver test_system -s lms --disable_capture --eval-attr='not shard' $PAVER_ARGS $PARALLEL 2> lms-tests.4.log
"all"|[1-4]|"noshard")
$TOX bash scripts/unit-tests.sh
;;
*)
# If no shard is specified, rather than running all tests, create an empty xunit file. This is a
@@ -151,12 +145,8 @@ case "$TEST_SUITE" in
esac
;;
"cms-unit")
$TOX paver test_system -s cms --disable_capture $PAVER_ARGS 2> cms-tests.log
;;
"commonlib-unit")
$TOX paver test_lib --disable_capture $PAVER_ARGS 2> common-tests.log
"cms-unit"|"commonlib-unit")
$TOX bash scripts/unit-tests.sh
;;
"js-unit")

58
scripts/unit-tests.sh Executable file
View File

@@ -0,0 +1,58 @@
#!/bin/bash
set -e
###############################################################################
#
# unit-tests.sh
#
# Execute Python unit tests for edx-platform.
#
# This script is typically called from generic-ci-tests.sh, which defines
# these environment variables:
#
# `TEST_SUITE` defines which kind of test to run.
# Possible values are:
#
# - "lms-unit": Run the LMS Python unit tests
# - "cms-unit": Run the CMS Python unit tests
# - "commonlib-unit": Run Python unit tests from the common/lib directory
#
# `SHARD` is a number indicating which subset of the tests to build.
#
# For "lms-unit", the tests are put into shard groups
# using the 'attr' decorator (e.g. "@attr(shard=1)"). Anything with
# the 'shard=n' attribute will run in the nth shard. If there isn't a
# shard explicitly assigned, the test will run in the last shard.
#
# This script is broken out so it can be run by tox and redirect stderr to
# the specified file before tox gets a chance to redirect it to stdout.
#
###############################################################################
PAVER_ARGS="-v"
PARALLEL="--processes=-1"
case "${TEST_SUITE}" in
"lms-unit")
case "$SHARD" in
"all")
paver test_system -s lms --disable_capture ${PAVER_ARGS} ${PARALLEL} 2> lms-tests.log
;;
[1-3])
paver test_system -s lms --disable_capture --eval-attr="shard==$SHARD" ${PAVER_ARGS} ${PARALLEL} 2> lms-tests.${SHARD}.log
;;
4|"noshard")
paver test_system -s lms --disable_capture --eval-attr='not shard' ${PAVER_ARGS} ${PARALLEL} 2> lms-tests.4.log
;;
esac
;;
"cms-unit")
paver test_system -s cms --disable_capture ${PAVER_ARGS} 2> cms-tests.log
;;
"commonlib-unit")
paver test_lib --disable_capture ${PAVER_ARGS} 2> common-tests.log
;;
esac