Last active
December 8, 2021 21:44
-
-
Save bandogora/75070d74153dea5e927c36237dcf60e7 to your computer and use it in GitHub Desktop.
Run ruby parallel_tests with rspec in a loop until a test fails
This file contains 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
#!/bin/sh | |
echo -e "\033[0;31mRunning parallel:spec recursively until a failure occurs\033[0m" | |
: > rspec_error.txt #clear file in case last run failed | |
pushd $1 | |
while [[ $(tail -n 1 ~/rspec_error.txt) != "Tests Failed" ]] | |
do | |
rake parallel:spec 1>~/rspec_out.txt 2>~/rspec_error.txt | |
echo -ne "\033[1;34m.\033[0m" | |
done | |
echo -e "\n\033[0;31mTests Failed\033[0m" | |
cat ~/rspec_out.txt | |
popd |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment