Skip to content

Instantly share code, notes, and snippets.

@mlsteele
Last active March 2, 2016 02:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mlsteele/38b156aff6411acbeb49 to your computer and use it in GitHub Desktop.
Save mlsteele/38b156aff6411acbeb49 to your computer and use it in GitHub Desktop.
Script to continously run go tests.
#!/usr/bin/env bash
# Script to continously run go tests.
# Courtesy of Jon Gjengset.
rm -f results.log
while true; do
echo "Starting trial."
go test -test.timeout 80s 2>run.err | tee run.log | grep -P '^(--- )?FAIL|Passed|^Test:|^ok' | tee -a results.log;
if grep FAIL run.log; then
break;
fi
if grep panic run.err; then
break;
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment