Skip to content

Commit

Permalink
Add test coverage for pipeline providedBy
Browse files Browse the repository at this point in the history
Adding an additional case for when a Task tries to depend on a Resource
from a previous Task that doesn't exist. Had previously covered this
only in the case where the first Task tries to express a `providedBy`,
but this is a special case b/c the first Task should never have any
`providedBy` constraints.
  • Loading branch information
bobcatfish authored and knative-prow-robot committed Jan 24, 2019
1 parent 65cf1cb commit 39a0d6e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pkg/apis/pipeline/v1alpha1/pipeline_validation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,19 @@ func TestPipelineSpec_Validate_Error(t *testing.T) {
tb.PipelineTask("foo", "foo-task"),
)),
},
{
name: "providedby is on first task",
p: tb.Pipeline("pipeline", "namespace", tb.PipelineSpec(
tb.PipelineDeclaredResource("great-resource", v1alpha1.PipelineResourceTypeGit),
tb.PipelineTask("foo", "foo-task",
tb.PipelineTaskInputResource("the-resource", "great-resource", tb.ProvidedBy("bar"))),
)),
},
{
name: "providedby task doesnt exist",
p: tb.Pipeline("pipeline", "namespace", tb.PipelineSpec(
tb.PipelineDeclaredResource("great-resource", v1alpha1.PipelineResourceTypeGit),
tb.PipelineTask("baz", "baz-task"),
tb.PipelineTask("foo", "foo-task",
tb.PipelineTaskInputResource("the-resource", "great-resource", tb.ProvidedBy("bar"))),
)),
Expand Down

0 comments on commit 39a0d6e

Please sign in to comment.