Skip to content

Commit

Permalink
remove uuid
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Martin <chris@cmartinit.co.uk>
  • Loading branch information
d80tb7 committed Aug 24, 2024
1 parent dd22464 commit e37803f
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions internal/scheduler/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ var priorityClasses = map[string]types.PriorityClass{
func TestExecutorApi_LeaseJobRuns(t *testing.T) {
const maxJobsPerCall = uint(100)
testClock := clock.NewFakeClock(time.Now())
runId1 := uuid.New()
runId2 := uuid.New()
runId3 := uuid.New()
runId1 := uuid.NewString()
runId2 := uuid.NewString()
runId3 := uuid.NewString()
groups, compressedGroups := groups(t)
defaultRequest := &executorapi.LeaseRequest{
ExecutorId: "test-executor",
Expand All @@ -54,13 +54,13 @@ func TestExecutorApi_LeaseJobRuns(t *testing.T) {
{
Name: "test-node",
RunIdsByState: map[string]api.JobState{
runId1.String(): api.JobState_RUNNING,
runId2.String(): api.JobState_RUNNING,
runId1: api.JobState_RUNNING,
runId2: api.JobState_RUNNING,
},
NodeType: "node-type-1",
},
},
UnassignedJobRunIds: []*armadaevents.Uuid{armadaevents.ProtoUuidFromUuid(runId3)},
UnassignedJobRunIds: []*armadaevents.Uuid{armadaevents.MustProtoUuidFromUuidString(runId3)},
MaxJobsToLease: uint32(maxJobsPerCall),
}
defaultExpectedExecutor := &schedulerobjects.Executor{
Expand All @@ -72,7 +72,7 @@ func TestExecutorApi_LeaseJobRuns(t *testing.T) {
Name: "test-node",
Executor: "test-executor",
TotalResources: schedulerobjects.NewResourceList(0),
StateByJobRunId: map[string]schedulerobjects.JobRunState{runId1.String(): schedulerobjects.JobRunState_RUNNING, runId2.String(): schedulerobjects.JobRunState_RUNNING},
StateByJobRunId: map[string]schedulerobjects.JobRunState{runId1: schedulerobjects.JobRunState_RUNNING, runId2: schedulerobjects.JobRunState_RUNNING},
NonArmadaAllocatedResources: map[int32]schedulerobjects.ResourceList{},
AllocatableByPriorityAndResource: map[int32]schedulerobjects.ResourceList{
1000: {
Expand All @@ -88,7 +88,7 @@ func TestExecutorApi_LeaseJobRuns(t *testing.T) {
},
},
LastUpdateTime: testClock.Now().UTC(),
UnassignedJobRuns: []string{runId3.String()},
UnassignedJobRuns: []string{runId3},
}

submit, compressedSubmit := submitMsg(
Expand Down Expand Up @@ -184,20 +184,20 @@ func TestExecutorApi_LeaseJobRuns(t *testing.T) {

tests := map[string]struct {
request *executorapi.LeaseRequest
runsToCancel []uuid.UUID
runsToCancel []string
leases []*database.JobRunLease
expectedExecutor *schedulerobjects.Executor
expectedMsgs []*executorapi.LeaseStreamMessage
}{
"lease and cancel": {
request: defaultRequest,
runsToCancel: []uuid.UUID{runId2},
runsToCancel: []string{runId2},
leases: []*database.JobRunLease{defaultLease},
expectedExecutor: defaultExpectedExecutor,
expectedMsgs: []*executorapi.LeaseStreamMessage{
{
Event: &executorapi.LeaseStreamMessage_CancelRuns{CancelRuns: &executorapi.CancelRuns{
JobRunIdsToCancel: []*armadaevents.Uuid{armadaevents.ProtoUuidFromUuid(runId2)},
JobRunIdsToCancel: []*armadaevents.Uuid{armadaevents.MustProtoUuidFromUuidString(runId2)},
}},
},
{
Expand Down

0 comments on commit e37803f

Please sign in to comment.