Skip to content

Instantly share code, notes, and snippets.

@criccomini
Created June 22, 2016 15:16
Show Gist options
  • Save criccomini/93ea06702c7bc325199e8391180bee11 to your computer and use it in GitHub Desktop.
Save criccomini/93ea06702c7bc325199e8391180bee11 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