Skip to content

Commit

Permalink
switch to uuid helper package
Browse files Browse the repository at this point in the history
  • Loading branch information
drewbailey committed Nov 8, 2019
1 parent 1103e9e commit 369a0ef
Showing 1 changed file with 6 additions and 22 deletions.
28 changes: 6 additions & 22 deletions api/allocations_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

"time"

"github.com/hashicorp/go-uuid"
"github.com/hashicorp/nomad/helper/uuid"
"github.com/stretchr/testify/require"
)

Expand Down Expand Up @@ -148,20 +148,12 @@ func TestAllocations_RescheduleInfo(t *testing.T) {
}
job.Canonicalize()

uuidGen := func() string {
ret, err := uuid.GenerateUUID()
if err != nil {
t.Fatal(err)
}
return ret
}

alloc := &Allocation{
ID: uuidGen(),
ID: uuid.Generate(),
Namespace: DefaultNamespace,
EvalID: uuidGen(),
EvalID: uuid.Generate(),
Name: "foo-bar[1]",
NodeID: uuidGen(),
NodeID: uuid.Generate(),
TaskGroup: *job.TaskGroups[0].Name,
JobID: *job.ID,
Job: job,
Expand Down Expand Up @@ -273,20 +265,12 @@ func TestAllocations_ExecErrors(t *testing.T) {
}
job.Canonicalize()

uuidGen := func() string {
ret, err := uuid.GenerateUUID()
if err != nil {
t.Fatal(err)
}
return ret
}

alloc := &Allocation{
ID: "",
Namespace: DefaultNamespace,
EvalID: uuidGen(),
EvalID: uuid.Generate(),
Name: "foo-bar[1]",
NodeID: uuidGen(),
NodeID: uuid.Generate(),
TaskGroup: *job.TaskGroups[0].Name,
JobID: *job.ID,
Job: job,
Expand Down

0 comments on commit 369a0ef

Please sign in to comment.