Created
October 30, 2017 01:57
-
-
Save sdboyer/2c9a2a92e6a11638dbd49631e947d8b5 to your computer and use it in GitHub Desktop.
Figure out which of your go (sub)tests are slow
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
# This will sort go test -v output in ascending order of time to complete the test | |
$ go test -v | sed -n 's#.*PASS: \([^ ]*\) (\([0-9]*\.[0-9]\{2\}\)s)#\2 \1#p' | sort -g | |
# Add this to e.g. ~/.bashrc, ~/.zshrc, then you can pipe to it: `go test -v | goslowtests` | |
function goslowtests { | |
sed -n 's#.*PASS: \([^ ]*\) (\([0-9]*\.[0-9]\{2\}\)s)#\2 \1#p' | sort -g | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment