Update to use shared test script and functions

This commit is contained in:
Devon Mackay 2018-07-09 12:58:05 -04:00
parent 53f27b2ea2
commit 9e89f75b92

View File

@ -2,22 +2,13 @@
# script/test: Run static code checks and unit tests
# If a command fails, exit the script
set -e
source "$(dirname "${0}")"/../script/include/global_header.inc.sh
# Ensure we are in the app root directory (not the /script directory)
cd "$(dirname "${0}")/.."
# Define all relevant python files and directories for this app
PYTHON_FILES="./app.py ./atst ./config"
if [ -z "${SKIP_PIPENV+xxxx}" ]; then
CMD_PREFIX='pipenv run '
fi
PYLINT_CMD="${CMD_PREFIX}pylint"
PYTHON_CMD="${CMD_PREFIX}python"
# Enable Python testing
RUN_PYTHON_TESTS="true"
# Run lint check
echo "Running lint..."
${PYLINT_CMD} app.py atst/ tests/
# Run unit tests
echo "Running unit tests..."
${PYTHON_CMD} -m pytest -s $*
# Run the shared test script
source ./script/include/run_test