3943dd1e16
This is a followup to running tests in serial in CI. Since the API package cannot import anything outside of api/, copy the ci.Parallel function into api/internal/testutil, and have api tests use that.
24 lines
414 B
Go
24 lines
414 B
Go
package api
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/hashicorp/nomad/api/internal/testutil"
|
|
)
|
|
|
|
func TestStatus_Leader(t *testing.T) {
|
|
testutil.Parallel(t)
|
|
c, s := makeClient(t, nil, nil)
|
|
defer s.Stop()
|
|
status := c.Status()
|
|
|
|
// Query for leader status should return a result
|
|
out, err := status.Leader()
|
|
if err != nil {
|
|
t.Fatalf("err: %s", err)
|
|
}
|
|
if out == "" {
|
|
t.Fatalf("expected leader, got: %q", out)
|
|
}
|
|
}
|