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.
22 lines
395 B
Go
22 lines
395 B
Go
package api
|
|
|
|
import (
|
|
"reflect"
|
|
"testing"
|
|
|
|
"github.com/hashicorp/nomad/api/internal/testutil"
|
|
)
|
|
|
|
func TestCompose_Constraints(t *testing.T) {
|
|
testutil.Parallel(t)
|
|
c := NewConstraint("kernel.name", "=", "darwin")
|
|
expect := &Constraint{
|
|
LTarget: "kernel.name",
|
|
RTarget: "darwin",
|
|
Operand: "=",
|
|
}
|
|
if !reflect.DeepEqual(c, expect) {
|
|
t.Fatalf("expect: %#v, got: %#v", expect, c)
|
|
}
|
|
}
|