Skip to content

Commit

Permalink
Fixing task name
Browse files Browse the repository at this point in the history
  • Loading branch information
othomann committed Mar 2, 2020
1 parent 3e8c9b7 commit f45a541
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions pkg/reconciler/pipelinerun/pipelinerun_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1683,9 +1683,9 @@ func ensurePVCCreated(t *testing.T, clients test.Clients, name, namespace string
func TestReconcileWithTaskResults(t *testing.T) {
names.TestingSeed()
ps := []*v1alpha1.Pipeline{tb.Pipeline("test-pipeline", "foo", tb.PipelineSpec(
tb.PipelineTask("aTask", "aTask"),
tb.PipelineTask("bTask", "bTask",
tb.PipelineTaskParam("bParam", "$(tasks.aTask.results.aResult)"),
tb.PipelineTask("a-task", "a-task"),
tb.PipelineTask("b-task", "b-task",
tb.PipelineTaskParam("bParam", "$(tasks.a-task.results.aResult)"),
),
))}
prs := []*v1alpha1.PipelineRun{tb.PipelineRun("test-pipeline-run-different-service-accs", "foo",
Expand All @@ -1694,22 +1694,22 @@ func TestReconcileWithTaskResults(t *testing.T) {
),
)}
ts := []*v1alpha1.Task{
tb.Task("aTask", "foo"),
tb.Task("bTask", "foo",
tb.Task("a-task", "foo"),
tb.Task("b-task", "foo",
tb.TaskSpec(
tb.TaskInputs(tb.InputsParamSpec("bParam", v1alpha1.ParamTypeString)),
),
),
}
trs := []*v1alpha1.TaskRun{
tb.TaskRun("test-pipeline-run-different-service-accs-aTask-9l9zj", "foo",
tb.TaskRun("test-pipeline-run-different-service-accs-a-task-9l9zj", "foo",
tb.TaskRunOwnerReference("PipelineRun", "test-pipeline-run-different-service-accs",
tb.OwnerReferenceAPIVersion("tekton.dev/v1alpha1"),
tb.Controller, tb.BlockOwnerDeletion,
),
tb.TaskRunLabel("tekton.dev/pipeline", "test-pipeline"),
tb.TaskRunLabel("tekton.dev/pipelineRun", "test-pipeline-run-different-service-accs"),
tb.TaskRunLabel("tekton.dev/pipelineTask", "aTask"),
tb.TaskRunLabel("tekton.dev/pipelineTask", "a-task"),
tb.TaskRunSpec(
tb.TaskRunTaskRef("hello-world"),
tb.TaskRunServiceAccountName("test-sa"),
Expand Down Expand Up @@ -1744,24 +1744,24 @@ func TestReconcileWithTaskResults(t *testing.T) {
if err != nil {
t.Fatalf("Somehow had error getting completed reconciled run out of fake client: %s", err)
}
expectedTaskRunName := "test-pipeline-run-different-service-accs-bTask-mz4c7"
expectedTaskRunName := "test-pipeline-run-different-service-accs-b-task-mz4c7"
expectedTaskRun := tb.TaskRun(expectedTaskRunName, "foo",
tb.TaskRunOwnerReference("PipelineRun", "test-pipeline-run-different-service-accs",
tb.OwnerReferenceAPIVersion("tekton.dev/v1alpha1"),
tb.Controller, tb.BlockOwnerDeletion,
),
tb.TaskRunLabel("tekton.dev/pipeline", "test-pipeline"),
tb.TaskRunLabel("tekton.dev/pipelineRun", "test-pipeline-run-different-service-accs"),
tb.TaskRunLabel("tekton.dev/pipelineTask", "bTask"),
tb.TaskRunLabel("tekton.dev/pipelineTask", "b-task"),
tb.TaskRunSpec(
tb.TaskRunTaskRef("bTask"),
tb.TaskRunTaskRef("b-task"),
tb.TaskRunServiceAccountName("test-sa-0"),
tb.TaskRunParam("bParam", "aResultValue"),
),
)
// Check that the expected TaskRun was created
actual, err := clients.Pipeline.TektonV1alpha1().TaskRuns("foo").List(metav1.ListOptions{
LabelSelector: "tekton.dev/pipelineTask=bTask,tekton.dev/pipelineRun=test-pipeline-run-different-service-accs",
LabelSelector: "tekton.dev/pipelineTask=b-task,tekton.dev/pipelineRun=test-pipeline-run-different-service-accs",
Limit: 1,
})

Expand Down

0 comments on commit f45a541

Please sign in to comment.