13dab7dd24
* Divest api/ package of deps elsewhere in the nomad repo. This will allow making api/ a module without then pulling in the external repo, leading to a package name conflict. This required some migration of tests to an apitests/ folder (can be moved anywhere as it has no deps on it). It also required some duplication of code, notably some test helpers from api/ -> apitests/ and part (but not all) of testutil/ -> api/testutil/. Once there's more separation and an e.g. sdk/ folder those can be removed in favor of a dep on the sdk/ folder, provided the sdk/ folder doesn't depend on api/ or /. * Also remove consul dep from api/ package * Fix stupid linters * Some restructuring
16 lines
316 B
Go
16 lines
316 B
Go
package testutil
|
|
|
|
import (
|
|
"os"
|
|
|
|
testing "github.com/mitchellh/go-testing-interface"
|
|
)
|
|
|
|
// SkipSlow skips a slow test unless the NOMAD_SLOW_TEST environment variable
|
|
// is set.
|
|
func SkipSlow(t testing.T) {
|
|
if os.Getenv("NOMAD_SLOW_TEST") == "" {
|
|
t.Skip("Skipping slow test. Set NOMAD_SLOW_TEST=1 to run.")
|
|
}
|
|
}
|