Last active
February 23, 2017 12:16
-
-
Save nilsmagnus/8d5a431f19760ddcaa5d8c12d22b13f9 to your computer and use it in GitHub Desktop.
Script that runs go test forever and gives a notification each time tests are broken or fixed.
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 | |
failing=0 | |
while : | |
do | |
go test > /dev/null | |
if [ "$?" = "1" ]; then | |
if [ "$failing" = "1" ]; then | |
echo "Continuing failure!" | |
else | |
failing=1 | |
echo "tests failed" | |
notify-send "go tests failed" -t 1500 | |
fi | |
go test | |
else | |
if [ "$failing" = "1" ]; then | |
notify-send "go tests fixed" -t 1500 | |
echo "Tests fixed." | |
fi | |
failing=0 | |
fi | |
sleep 1 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Running the script
Download the script:
Execute it and let it run forever:
Exit the script by pressing ctrl-c