Created
January 26, 2018 01:05
-
-
Save aaronlelevier/8cdf5fd86afea725f2344ed1bf3207b4 to your computer and use it in GitHub Desktop.
Run Django test until fail Bash function
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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