Skip to content

Instantly share code, notes, and snippets.

@tim-tang
Forked from criccomini/run-tests.sh
Created October 28, 2016 11:30
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tim-tang/9f275e8621229e8d42f51569b1bfc2e8 to your computer and use it in GitHub Desktop.
Save tim-tang/9f275e8621229e8d42f51569b1bfc2e8 to your computer and use it in GitHub Desktop.
run-tests.sh
#!/bin/bash
# Runs airflow-dags tests.
# Set Nose defaults if no arguments are passed from CLI.
CWD="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
NOSE_ARGS=$@
if [ -z "$NOSE_ARGS" ]; then
NOSE_ARGS=" \
--with-coverage \
--cover-erase \
--cover-package=dags \
--cover-package=weflow \
--cover-html-dir=build/coverage \
--cover-html \
--with-xunit \
--xunit-file=build/test_output.xml \
-s \
-v \
--logging-level=DEBUG"
fi
# Export for the DAGs import test.
export AIRFLOW_DAGS=$CWD/dags
# Create a build directory to store test output.
mkdir -p build
# Run Flake to make sure things are stylish.
flake8 --max-line-length 120 --max-complexity 12 dags weflow
# Run tests.
nosetests $NOSE_ARGS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment