Skip to content

Commit

Permalink
tests
Browse files Browse the repository at this point in the history
  • Loading branch information
psschwei committed Apr 19, 2021
1 parent d297d22 commit 01ee11d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 32 deletions.
19 changes: 1 addition & 18 deletions pkg/apis/pipeline/v1beta1/pipelinerun_validation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,24 +37,7 @@ func TestPipelineRun_Invalid(t *testing.T) {
pr v1beta1.PipelineRun
want *apis.FieldError
wc func(context.Context) context.Context
}{
{
name: "invalid pipelinerun metadata",
pr: v1beta1.PipelineRun{
ObjectMeta: metav1.ObjectMeta{
Name: "pipelinerun.name",
},
Spec: v1beta1.PipelineRunSpec{
PipelineRef: &v1beta1.PipelineRef{
Name: "prname",
},
},
},
want: &apis.FieldError{
Message: "Invalid resource name: special character . must not be present",
Paths: []string{"metadata.name"},
},
}, {
}{{
name: "no pipeline reference",
pr: v1beta1.PipelineRun{
ObjectMeta: metav1.ObjectMeta{
Expand Down
14 changes: 0 additions & 14 deletions pkg/apis/pipeline/v1beta1/taskrun_validation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,20 +39,6 @@ func TestTaskRun_Invalidate(t *testing.T) {
name: "invalid taskspec",
task: &v1beta1.TaskRun{},
want: apis.ErrMissingField("spec.taskref.name", "spec.taskspec"),
}, {
name: "invalid taskrun metadata",
task: &v1beta1.TaskRun{
ObjectMeta: metav1.ObjectMeta{
Name: "task.name",
},
Spec: v1beta1.TaskRunSpec{
TaskRef: &v1beta1.TaskRef{Name: "task"},
},
},
want: &apis.FieldError{
Message: "Invalid resource name: special character . must not be present",
Paths: []string{"metadata.name"},
},
}}
for _, ts := range tests {
t.Run(ts.name, func(t *testing.T) {
Expand Down

0 comments on commit 01ee11d

Please sign in to comment.