Skip to content

Commit

Permalink
Enable fan-in fan-out e2e test
Browse files Browse the repository at this point in the history
fixes #375

- It was disabled when gke test infrastructure was run in multi regional
cluster and multiple PVCs were allocated across regions. Entrypoint PVC
has been removed in last release and there is only one PVC created to
support sharing resources across taskruns
  • Loading branch information
Shash Reddy authored and knative-prow-robot committed Feb 25, 2019
1 parent 49713cb commit 3ee62a6
Showing 1 changed file with 18 additions and 14 deletions.
32 changes: 18 additions & 14 deletions test/pipelinerun_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,7 @@ func TestPipelineRun(t *testing.T) {
expectedTaskRuns: []string{"create-file-kritis", "create-fan-out-1", "create-fan-out-2", "check-fan-in"},
// 1 from PipelineRun and 4 from Tasks defined in pipelinerun
expectedNumberOfEvents: 5,
}}
// TODO(#375): Reenable the 'fan-in and fan-out' test once it's fixed.
tds = []tests{{
}, {
name: "service account propagation",
testSetup: func(t *testing.T, c *clients, namespace string, index int) {
t.Helper()
Expand Down Expand Up @@ -205,14 +203,15 @@ func getFanInFanOutTasks(namespace string) []*v1alpha1.Task {
tb.TaskInputs(tb.InputsResource("workspace", v1alpha1.PipelineResourceTypeGit,
tb.ResourceTargetPath("brandnewspace"),
)),
tb.TaskOutputs(tb.OutputsResource("workspace", v1alpha1.PipelineResourceTypeGit)),
tb.TaskOutputs(outWorkspaceResource),
tb.Step("write-data-task-0-step-0", "ubuntu", tb.Command("/bin/bash"),
tb.Args("-c", "echo stuff > /workspace/brandnewspace/stuff"),
),
tb.Step("write-data-task-0-step-1", "ubuntu", tb.Command("/bin/bash"),
tb.Args("-c", "echo other > /workspace/brandnewspace/other"),
),
)), tb.Task("check-create-files-exists", namespace, tb.TaskSpec(
)),
tb.Task("check-create-files-exists", namespace, tb.TaskSpec(
tb.TaskInputs(inWorkspaceResource),
tb.TaskOutputs(outWorkspaceResource),
tb.Step("read-from-task-0", "ubuntu", tb.Command("/bin/bash"),
Expand All @@ -221,7 +220,8 @@ func getFanInFanOutTasks(namespace string) []*v1alpha1.Task {
tb.Step("write-data-task-1", "ubuntu", tb.Command("/bin/bash"),
tb.Args("-c", "echo something > /workspace/workspace/something"),
),
)), tb.Task("check-create-files-exists-2", namespace, tb.TaskSpec(
)),
tb.Task("check-create-files-exists-2", namespace, tb.TaskSpec(
tb.TaskInputs(inWorkspaceResource),
tb.TaskOutputs(outWorkspaceResource),
tb.Step("read-from-task-0", "ubuntu", tb.Command("/bin/bash"),
Expand All @@ -230,7 +230,8 @@ func getFanInFanOutTasks(namespace string) []*v1alpha1.Task {
tb.Step("write-data-task-1", "ubuntu", tb.Command("/bin/bash"),
tb.Args("-c", "echo else > /workspace/workspace/else"),
),
)), tb.Task("read-files", namespace, tb.TaskSpec(
)),
tb.Task("read-files", namespace, tb.TaskSpec(
tb.TaskInputs(tb.InputsResource("workspace", v1alpha1.PipelineResourceTypeGit,
tb.ResourceTargetPath("readingspace"),
)),
Expand All @@ -248,18 +249,21 @@ func getFanInFanOutTasks(namespace string) []*v1alpha1.Task {
}

func getFanInFanOutPipeline(suffix int, namespace string) *v1alpha1.Pipeline {
outGitResource := tb.PipelineTaskOutputResource("workspace", "git-repo")

return tb.Pipeline(getName(pipelineName, suffix), namespace, tb.PipelineSpec(
tb.PipelineDeclaredResource("git-repo", "git"),
tb.PipelineTask("create-file-kritis", "create-file",
tb.PipelineTaskOutputResource("workspace", "git-repo"),
tb.PipelineTaskInputResource("workspace", "git-repo"),
outGitResource,
),
tb.PipelineTask("create-fan-out-1", "check-create-files-exists",
tb.PipelineTaskInputResource("workspace", "git-repo", tb.From("create-file-kritis")),
tb.PipelineTaskOutputResource("workspace", "git-repo"),
outGitResource,
),
tb.PipelineTask("create-fan-out-2", "check-create-files-exists-2",
tb.PipelineTaskInputResource("workspace", "git-repo", tb.From("create-file-kritis")),
tb.PipelineTaskOutputResource("workspace", "git-repo"),
outGitResource,
),
tb.PipelineTask("check-fan-in", "read-files",
tb.PipelineTaskInputResource("workspace", "git-repo", tb.From("create-fan-out-2", "create-fan-out-1")),
Expand Down Expand Up @@ -289,10 +293,10 @@ func getPipelineRunServiceAccount(suffix int, namespace string) *corev1.ServiceA
}
}
func getFanInFanOutPipelineRun(suffix int, namespace string) *v1alpha1.PipelineRun {
return tb.PipelineRun(getName(pipelineRunName, suffix), namespace, tb.PipelineRunSpec(
getName(pipelineName, suffix),
tb.PipelineRunResourceBinding("git-repo", tb.PipelineResourceBindingRef("kritis-resource-git")),
))
return tb.PipelineRun(getName(pipelineRunName, suffix), namespace,
tb.PipelineRunSpec(getName(pipelineName, suffix),
tb.PipelineRunResourceBinding("git-repo", tb.PipelineResourceBindingRef("kritis-resource-git")),
))
}

func getPipelineRunSecret(suffix int, namespace string) *corev1.Secret {
Expand Down

0 comments on commit 3ee62a6

Please sign in to comment.