-
-
Notifications
You must be signed in to change notification settings - Fork 689
Open
Labels
Description
Is there an existing issue for this?
- I have searched the existing issues
Is your feature request related to a problem?
We have a mechanism to run less tests, GOTEST_SHORT=true, with various extra things hung on that. But it's not really in line with the feature go uses for this.
Describe your solution
Use go test -short on tests that should do less.
Use t.Skip() to skip whole tests:
if testing.Short() {
t.Skip("skipping slow test in -short mode")
}
Use if testing.Short() { to skip sections:
if testing.Short() {
cases = smallSmokeCaseList // fewer cases / smaller fixtures
}
GOTEST_SHORT was originally intended for true/false to work like go test -short, but obviously I didn't know about that.
It was eventually expanded to specify particular project types, and that overloading is pretty ugly now. (We need it for certain situations, but it shouldn't be overloaded on "short".
https://pkg.go.dev/testing#hdr-Skipping
Describe alternatives
No response
Additional context
No response