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