Skip to content

Instantly share code, notes, and snippets.

@bandogora
Last active December 8, 2021 21:44
Show Gist options
  • Save bandogora/75070d74153dea5e927c36237dcf60e7 to your computer and use it in GitHub Desktop.
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
#!/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