Skip to content

Commit

Permalink
Fix a few tests which failed when run individually
Browse files Browse the repository at this point in the history
I honestly can't tell how they passed when run as a whole, since in both cases, the underlying `ClusterTask` or `Pipeline` didn't have the expected parameters in their param specs, but hey.

Signed-off-by: Andrew Bayer <[email protected]>
  • Loading branch information
abayer authored and tekton-robot committed Jun 29, 2022
1 parent 88940ba commit f0464a9
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/cmd/clustertask/start_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,12 @@ func Test_ClusterTask_Start(t *testing.T) {
},
},
},
Params: []v1alpha1.ParamSpec{
{
Name: "myarg",
Type: v1alpha1.ParamTypeString,
},
},
Steps: []v1alpha1.Step{
{
Container: corev1.Container{
Expand Down
4 changes: 4 additions & 0 deletions pkg/cmd/pipeline/start_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -764,6 +764,8 @@ func TestPipelineStart_ExecuteCommand(t *testing.T) {
"start", "-f", "./testdata/pipeline-v1alpha1.yaml",
"-r=source-repo=scaffold-git",
"-r=web-image=imageres",
"-p=pipeline-param=value1",
"-p=rev-param=value2",
"-n", "ns",
"--dry-run",
},
Expand Down Expand Up @@ -795,6 +797,8 @@ func TestPipelineStart_ExecuteCommand(t *testing.T) {
"start", "-f", "./testdata/pipeline-v1alpha1.yaml",
"-r=source-repo=scaffold-git",
"-r=web-image=imageres",
"-p=pipeline-param=value1",
"-p=rev-param=value2",
"-n", "ns",
},
namespace: "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,19 @@ metadata:
generateName: test-pipeline-run-
namespace: ns
spec:
params:
- name: pipeline-param
value: value1
- name: rev-param
value: value2
pipelineSpec:
params:
- default: foo
name: pipeline-param
type: string
- default: bar
name: rev-param
type: string
resources:
- name: source-repo
type: git
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,18 @@
}
]
}
],
"params": [
{
"name": "pipeline-param",
"type": "string",
"default": "foo"
},
{
"name": "rev-param",
"type": "string",
"default": "bar"
}
]
},
"resources": [
Expand Down
7 changes: 7 additions & 0 deletions pkg/cmd/pipeline/testdata/pipeline-v1alpha1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ kind: Pipeline
metadata:
name: test-pipeline
spec:
params:
- name: pipeline-param
type: string
default: "foo"
- name: rev-param
type: string
default: "bar"
resources:
- name: source-repo
type: git
Expand Down

0 comments on commit f0464a9

Please sign in to comment.