mirror of
https://github.com/kemko/nomad.git
synced 2026-01-01 16:05:42 +03:00
ci: swap ci parallelization for unconstrained gomaxprocs
This commit is contained in:
25
ci/slow.go
Normal file
25
ci/slow.go
Normal file
@@ -0,0 +1,25 @@
|
||||
package ci
|
||||
|
||||
import (
|
||||
"os"
|
||||
"strconv"
|
||||
"testing"
|
||||
)
|
||||
|
||||
// SkipSlow skips a slow test unless NOMAD_SLOW_TEST is set to a true value.
|
||||
func SkipSlow(t *testing.T, reason string) {
|
||||
value := os.Getenv("NOMAD_SLOW_TEST")
|
||||
run, err := strconv.ParseBool(value)
|
||||
if !run || err != nil {
|
||||
t.Skipf("Skipping slow test: %s", reason)
|
||||
}
|
||||
}
|
||||
|
||||
// Parallel runs t in parallel, unless CI is set to a true value.
|
||||
func Parallel(t *testing.T) {
|
||||
value := os.Getenv("CI")
|
||||
isCI, err := strconv.ParseBool(value)
|
||||
if !isCI || err != nil {
|
||||
t.Parallel()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user