#!/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