Skip to content

Instantly share code, notes, and snippets.

@slor
Created June 12, 2013 00:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save slor/5761887 to your computer and use it in GitHub Desktop.
Save slor/5761887 to your computer and use it in GitHub Desktop.
Run django test on all the packages listed in a CSV file. Supports additional args too.
#!/usr/bin/env bash
#
# Run tests on packages listed in a csv file.
#
# Usage: ./test_everything.sh [arg1 arg2 ...]
#
# Runs manage.py test on all the packages listed in what_to_test.csv. You can
# pass additional args and they will be appended to the manage command.
#
# Example:
#
# > ./test_everything.sh --with-xunit --xunit-file=$WORKSPACE/nosetests.xml -- -v
#
# Input CSV format:
#
# package1
# package2
# ...
# packageN
# This line is ignored. Don't add a trailing newline!
INPUT=what_to_test.csv
PACKAGES=''
while read package
do
PACKAGES="$PACKAGES $package"
done < "$INPUT"
echo "$PACKAGES $@" | xargs python manage.py test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment