Skip to content

Instantly share code, notes, and snippets.

@aaronlelevier
Created January 26, 2018 01:05
Show Gist options
  • Select an option

  • Save aaronlelevier/8cdf5fd86afea725f2344ed1bf3207b4 to your computer and use it in GitHub Desktop.

Select an option

Save aaronlelevier/8cdf5fd86afea725f2344ed1bf3207b4 to your computer and use it in GitHub Desktop.
Run Django test until fail Bash function
testuntilfail () {
if [ $# -eq 0 ]
then
echo "Django test path must be specified"
else
RUNS_BEFORE_FAILURE=0
while [ $? = 0 ]; do
let RUNS_BEFORE_FAILURE=RUNS_BEFORE_FAILURE+1
echo "Beginning run number: $RUNS_BEFORE_FAILURE"
./manage.py test $1
done
fi
echo "Failed after $RUNS_BEFORE_FAILURE runs"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment