Created
February 19, 2019 19:42
-
-
Save lbrito1/857b62ea79d4cb4a61a3511df21ee304 to your computer and use it in GitHub Desktop.
RSpec failing seed finder
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/bash | |
# Finds the first seed that breaks the spec suite. Outputs to stdout and a file (rspec_output). | |
found=0 | |
while [ $found == 0 ] | |
do | |
rspec --order random 2>&1 | tee -a ./rspec_output | |
found=$(more rspec_output | grep Failed | wc -l) | |
if [ $found == 0 ] | |
then | |
> rspec_output # empty results if not found | |
fi | |
done | |
echo "Found failing seed." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
FWIW
--order random
is redundant and I don't think it worth to append to the output: