-
-
Save tsauvajon/5992c1f178bee4f8bebc1f4b3b532c78 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/usr/bin/env bash | |
function for_all_test_files { find $(go list -f '{{ .Dir }}' ./...) -name '*_test.go' ; } | |
function first_line_of_test { xargs -n1 awk '/^func Test/{getline; print FILENAME ":" NR-1 " " $0}' ; } | |
function not_parallel { grep -v 't.Parallel()' ; } | |
if for_all_test_files | first_line_of_test | not_parallel | |
then | |
echo FAIL: not all tests call t.Parallel | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment