Skip to content

Commit

Permalink
Add test for schedulerName in TaskRunSpec
Browse files Browse the repository at this point in the history
This test checks if the schedulerName has passed down from the
TaskRunSpec to the PodSpec
  • Loading branch information
waveywaves committed Jan 6, 2020
1 parent 6c54a48 commit dd018a8
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions pkg/pod/pod_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,43 @@ script-heredoc-randomly-generated-78c5n
}},
Volumes: append(implicitVolumes, scriptsVolume, toolsVolume, downwardVolume),
},
}, {
desc: "using another scheduler",
ts: v1alpha1.TaskSpec{
Steps: []v1alpha1.Step{{Container: corev1.Container{
Name: "schedule-me",
Image: "image",
Command: []string{"cmd"}, // avoid entrypoint lookup.
}}},
},
trs: v1alpha1.TaskRunSpec{
SchedulerName: "there-scheduler",
},
want: &corev1.PodSpec{
RestartPolicy: corev1.RestartPolicyNever,
InitContainers: []corev1.Container{placeToolsInit},
SchedulerName: "there-scheduler",
Volumes: append(implicitVolumes, toolsVolume, downwardVolume),
Containers: []corev1.Container{{
Name: "step-schedule-me",
Image: "image",
Command: []string{"/tekton/tools/entrypoint"},
Args: []string{
"-wait_file",
"/tekton/downward/ready",
"-wait_file_content",
"-post_file",
"/tekton/tools/0",
"-entrypoint",
"cmd",
"--",
},
Env: implicitEnvVars,
VolumeMounts: append([]corev1.VolumeMount{toolsMount, downwardMount}, implicitVolumeMounts...),
WorkingDir: pipeline.WorkspaceDir,
Resources: corev1.ResourceRequirements{Requests: allZeroQty()},
}},
},
}} {
t.Run(c.desc, func(t *testing.T) {
names.TestingSeed()
Expand Down

0 comments on commit dd018a8

Please sign in to comment.