Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Go integration tests
package main
func TestIntegration(t *testing.T) {
if m := flag.Lookup("test.run").Value.String(); m == "" || !regexp.MustCompile(m).MatchString(t.Name()) {
t.Skip("skipping integration test as execution was not requested explicitly using go test -run")
}
t.Run("testCase", testCase)
// or
testIntegration(t)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment