all-tests.sh 962 Bytes
Newer Older
1 2 3 4 5
#!/usr/bin/env bash
set -e

###############################################################################
#
6
#   all-tests.sh
7
#
8 9
#   Execute tests for edx-platform. This script is designed to be the
#   entry point for various CI systems.
10 11 12
#
###############################################################################

13
# Violations thresholds for failing the build
14
export PYLINT_THRESHOLD=5999
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
export JSHINT_THRESHOLD=3700

doCheckVars() {
    if [ -n "$CIRCLECI" ] ; then
        SCRIPT_TO_RUN=scripts/circle-ci-tests.sh

    elif [ -n "$JENKINS_HOME" ] ; then
        source scripts/jenkins-common.sh
        SCRIPT_TO_RUN=scripts/generic-ci-tests.sh
    fi
}

# Determine the CI system for the environment
doCheckVars

# Run appropriate CI system script
if [ -n "$SCRIPT_TO_RUN" ] ; then
    $SCRIPT_TO_RUN

    # Exit with the exit code of the called script
    exit $?
else
    echo "ERROR. Could not detect continuous integration system."
    exit 1
fi