diff --git a/src/dev/golang/testing.md b/src/dev/golang/testing.md index f033e22..dd63a6f 100644 --- a/src/dev/golang/testing.md +++ b/src/dev/golang/testing.md @@ -77,3 +77,25 @@ t.Fatalf() ## I don't want my tests to be messy (kudos @athoune) [Assert](https://godoc.org/github.com/stretchr/testify/assert) + +## Shit, i want to disable my oauth test on my CI + +```golang +if os.Getenv("DRONE") == "true" { + t.Skip("Skipping test in CI environment") +} +``` + +## Short mode + +This test is too long ? Skip it ! + +```golang + if testing.Short() { + t.Skip("Skipping test in short mode") + } +``` + +```shell +go test github.com/go/pkg/package --short +``` \ No newline at end of file