Skip to content

Commit

Permalink
Reformat CustomTask within Test
Browse files Browse the repository at this point in the history
Prior to this commit, the previous iteration
of this test had `task-b` as a "custom task" but
was of type `Task`.

In this commit, we changed `task-b` to be of type
`Run`, with its kind being `Example`. This allows
`task-b` to be a true `Custom Task` as intended.

/cc @jerop
/kind feature
  • Loading branch information
Varun Singhai authored and tekton-robot committed Aug 11, 2022
1 parent 81957c1 commit 69b5b9b
Showing 1 changed file with 43 additions and 46 deletions.
89 changes: 43 additions & 46 deletions pkg/reconciler/pipelinerun/pipelinerun_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4806,6 +4806,8 @@ spec:
name: a-task
- name: b-task
taskRef:
apiVersion: example.dev/v0
kind: Example
name: b-task
`)}
trs := []*v1beta1.TaskRun{mustParseTaskRunWithObjectMeta(t,
Expand All @@ -4823,8 +4825,8 @@ status:
- name: a-Result
value: aResultValue
`), mustParseTaskRunWithObjectMeta(t,
taskRunObjectMeta("test-pipeline-run-finally-results-task-run-b", "foo",
"test-pipeline-run-finally-results", "test-pipeline", "b-task", true),
taskRunObjectMeta("test-pipeline-run-finally-results-task-run-c", "foo",
"test-pipeline-run-finally-results", "test-pipeline", "c-task", true),
`
spec:
taskRef:
Expand All @@ -4833,20 +4835,22 @@ status:
conditions:
- status: "True"
type: Succeeded
taskResults:
- name: b-Result
value: bResultValue
`), mustParseTaskRunWithObjectMeta(t,
taskRunObjectMeta("test-pipeline-run-finally-results-task-run-c", "foo",
"test-pipeline-run-finally-results", "test-pipeline", "c-task", true),
`)}
rs := []*v1alpha1.Run{mustParseRunWithObjectMeta(t,
taskRunObjectMeta("test-pipeline-run-finally-results-task-run-b", "foo",
"test-pipeline-run-finally-results", "test-pipeline", "b-task", true),
`
spec:
taskRef:
name: hello-world
ref:
apiVersion: example.dev/v0
kind: Example
status:
conditions:
- status: "True"
type: Succeeded
results:
- name: b-Result
value: bResultValue
`)}
prs := []*v1beta1.PipelineRun{parse.MustParsePipelineRun(t, `
metadata:
Expand All @@ -4863,17 +4867,6 @@ status:
`)}
ts := []*v1beta1.Task{
parse.MustParseTask(t, `
metadata:
name: b-task
namespace: foo
spec:
taskRef:
apiVersion: example.dev/v0
kind: Example
results:
- name: b-Result
`),
parse.MustParseTask(t, `
metadata:
name: a-task
namespace: foo
Expand All @@ -4900,7 +4893,8 @@ spec:
Pipelines: ps,
Tasks: ts,
TaskRuns: trs,
ConfigMaps: []*corev1.ConfigMap{withEmbeddedStatus(newFeatureFlagsConfigMap(), embeddedStatus)},
Runs: rs,
ConfigMaps: []*corev1.ConfigMap{withCustomTasks(withEmbeddedStatus(newFeatureFlagsConfigMap(), embeddedStatus))},
}
prt := newPipelineRunTest(d, t)
defer prt.Cancel()
Expand All @@ -4917,7 +4911,6 @@ spec:
pipelineRef:
name: test-pipeline
status:
runs: {}
pipelineSpec:
results:
- description: pipeline result
Expand All @@ -4938,8 +4931,9 @@ status:
kind: Task
- name: b-task
taskRef:
name: b-task
kind: Task
apiVersion: example.dev/v0
kind: Example
name: b-task
conditions:
- status: "True"
type: Succeeded
Expand All @@ -4960,21 +4954,22 @@ status:
taskResults:
- name: a-Result
value: aResultValue
test-pipeline-run-finally-results-task-run-b:
pipelineTaskName: b-task
test-pipeline-run-finally-results-task-run-c:
pipelineTaskName: c-task
status:
conditions:
- status: "True"
type: Succeeded
taskResults:
- name: b-Result
value: bResultValue
test-pipeline-run-finally-results-task-run-c:
pipelineTaskName: c-task
runs:
test-pipeline-run-finally-results-task-run-b:
pipelineTaskName: b-task
status:
conditions:
- status: "True"
type: Succeeded
results:
- name: b-Result
value: bResultValue
`)

expectedPrBothStatus := parse.MustParsePipelineRun(t, `
Expand All @@ -4988,7 +4983,6 @@ spec:
pipelineRef:
name: test-pipeline
status:
runs: {}
pipelineSpec:
results:
- description: pipeline result
Expand All @@ -5010,7 +5004,8 @@ status:
- name: b-task
taskRef:
name: b-task
kind: Task
apiVersion: example.dev/v0
kind: Example
conditions:
- status: "True"
type: Succeeded
Expand All @@ -5030,8 +5025,8 @@ status:
kind: TaskRun
name: test-pipeline-run-finally-results-task-run-a
pipelineTaskName: a-task
- apiVersion: tekton.dev/v1beta1
kind: TaskRun
- apiVersion: tekton.dev/v1alpha1
kind: Run
name: test-pipeline-run-finally-results-task-run-b
pipelineTaskName: b-task
taskRuns:
Expand All @@ -5044,21 +5039,22 @@ status:
taskResults:
- name: a-Result
value: aResultValue
test-pipeline-run-finally-results-task-run-b:
pipelineTaskName: b-task
test-pipeline-run-finally-results-task-run-c:
pipelineTaskName: c-task
status:
conditions:
- status: "True"
type: Succeeded
taskResults:
- name: b-Result
value: bResultValue
test-pipeline-run-finally-results-task-run-c:
pipelineTaskName: c-task
runs:
test-pipeline-run-finally-results-task-run-b:
pipelineTaskName: b-task
status:
conditions:
- status: "True"
type: Succeeded
results:
- name: b-Result
value: bResultValue
`)

expectedPrMinimalStatus := parse.MustParsePipelineRun(t, `
Expand Down Expand Up @@ -5094,7 +5090,8 @@ status:
- name: b-task
taskRef:
name: b-task
kind: Task
apiVersion: example.dev/v0
kind: Example
conditions:
- status: "True"
type: Succeeded
Expand All @@ -5115,8 +5112,8 @@ status:
kind: TaskRun
name: test-pipeline-run-finally-results-task-run-a
pipelineTaskName: a-task
- apiVersion: tekton.dev/v1beta1
kind: TaskRun
- apiVersion: tekton.dev/v1alpha1
kind: Run
name: test-pipeline-run-finally-results-task-run-b
pipelineTaskName: b-task
`)
Expand Down

0 comments on commit 69b5b9b

Please sign in to comment.