diff --git a/test/builder/pipeline.go b/test/builder/pipeline.go index a8f7615634d..52aee709ed7 100644 --- a/test/builder/pipeline.go +++ b/test/builder/pipeline.go @@ -531,6 +531,13 @@ func PipelineResourceSpec(resourceType v1alpha1.PipelineResourceType, ops ...Pip } } +// PipelineResourceDescription sets the description of the pipeline resource +func PipelineResourceDescription(desc string) PipelineResourceSpecOp { + return func(spec *v1alpha1.PipelineResourceSpec) { + spec.Description = desc + } +} + // PipelineResourceSpecParam adds a ResourceParam, with specified name and value, to the PipelineResourceSpec. func PipelineResourceSpecParam(name, value string) PipelineResourceSpecOp { return func(spec *v1alpha1.PipelineResourceSpec) { diff --git a/test/builder/pipeline_test.go b/test/builder/pipeline_test.go index 646f8829247..bb074a9b179 100644 --- a/test/builder/pipeline_test.go +++ b/test/builder/pipeline_test.go @@ -397,12 +397,13 @@ func TestPipelineRunWithPipelineSpec(t *testing.T) { func TestPipelineResource(t *testing.T) { pipelineResource := tb.PipelineResource("git-resource", "foo", tb.PipelineResourceSpec( - v1alpha1.PipelineResourceTypeGit, tb.PipelineResourceSpecParam("URL", "https://foo.git"), + v1alpha1.PipelineResourceTypeGit, tb.PipelineResourceSpecParam("URL", "https://foo.git"), tb.PipelineResourceDescription("test description"), )) expectedPipelineResource := &v1alpha1.PipelineResource{ ObjectMeta: metav1.ObjectMeta{Name: "git-resource", Namespace: "foo"}, Spec: v1alpha1.PipelineResourceSpec{ - Type: v1alpha1.PipelineResourceTypeGit, + Description: "test description", + Type: v1alpha1.PipelineResourceTypeGit, Params: []v1alpha1.ResourceParam{{ Name: "URL", Value: "https://foo.git", }},