Skip to content

Commit

Permalink
chore: add unit tests for the newly added displayName field
Browse files Browse the repository at this point in the history
  • Loading branch information
nanjingfm committed Mar 28, 2023
1 parent a48d2e6 commit 32f971e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
14 changes: 10 additions & 4 deletions pkg/apis/pipeline/v1beta1/pipeline_conversion_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ func TestPipelineConversion(t *testing.T) {
Namespace: "bar",
},
Spec: v1beta1.PipelineSpec{
DisplayName: "pipeline-display-name",
Description: "test",
Tasks: []v1beta1.PipelineTask{{
Name: "foo",
Expand All @@ -74,12 +75,15 @@ func TestPipelineConversion(t *testing.T) {
Namespace: "bar",
},
Spec: v1beta1.PipelineSpec{
DisplayName: "pipeline-display-name",
Description: "test",
Tasks: []v1beta1.PipelineTask{{
Name: "task-1",
}, {
Name: "foo",
TaskRef: &v1beta1.TaskRef{Name: "example.com/my-foo-task"},
Name: "foo",
DisplayName: "task-display-name",
Description: "task-description",
TaskRef: &v1beta1.TaskRef{Name: "example.com/my-foo-task"},
TaskSpec: &v1beta1.EmbeddedTask{
TaskSpec: v1beta1.TaskSpec{
Steps: []v1beta1.Step{{
Expand Down Expand Up @@ -149,8 +153,10 @@ func TestPipelineConversion(t *testing.T) {
Value: *v1beta1.NewStructuredValues("foo.bar"),
}},
Finally: []v1beta1.PipelineTask{{
Name: "final-task",
TaskRef: &v1beta1.TaskRef{Name: "foo-task"},
Name: "final-task",
DisplayName: "final-task-display-name",
Description: "final-task-description",
TaskRef: &v1beta1.TaskRef{Name: "foo-task"},
}},
},
},
Expand Down
2 changes: 2 additions & 0 deletions pkg/apis/pipeline/v1beta1/task_conversion_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ func TestTaskConversion(t *testing.T) {
Generation: 1,
},
Spec: v1beta1.TaskSpec{
DisplayName: "task-display-name",
Description: "test",
Steps: []v1beta1.Step{{
Image: "foo",
Expand All @@ -76,6 +77,7 @@ func TestTaskConversion(t *testing.T) {
Generation: 1,
},
Spec: v1beta1.TaskSpec{
DisplayName: "task-display-name",
Description: "test",
Steps: []v1beta1.Step{{
Name: "step",
Expand Down

0 comments on commit 32f971e

Please sign in to comment.