Skip to content

Commit aabe9e6

Browse files
committed
add e2e test
1 parent 1e5023f commit aabe9e6

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

test/e2e/pipeline/pipeline_test.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,23 @@ Waiting for logs to be available...
305305
}
306306
})
307307

308+
t.Run("Start PipelineRun with --task-run-spec", func(t *testing.T) {
309+
tkn.MustSucceed(t, "pipeline", "start", tePipelineName,
310+
"-p=filename=output",
311+
"-w=name=shared-data,emptyDir=",
312+
"--task-run-spec="+helper.GetResourcePath("/taskrunspec/taskrunspec.yaml"),
313+
"--use-param-defaults",
314+
"--showlog")
315+
316+
time.Sleep(1 * time.Second)
317+
318+
pipelineRunGeneratedName := builder.GetPipelineRunListWithName(c, tePipelineName, true).Items[0].Name
319+
timeout := 5 * time.Minute
320+
if err := wait.ForPipelineRunState(c, pipelineRunGeneratedName, timeout, wait.PipelineRunSucceed(pipelineRunGeneratedName), "PipelineRunSucceeded"); err != nil {
321+
t.Errorf("Error waiting for PipelineRun to Succeed: %s", err)
322+
}
323+
})
324+
308325
t.Run("Cancel finished PipelineRun with tkn pipelinerun cancel", func(t *testing.T) {
309326
// Get last PipelineRun for pipeline-with-workspace
310327
pipelineRunLast := builder.GetPipelineRunListWithName(c, tePipelineName, true).Items[0]

test/resources/taskrunspec.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
- pipelineTaskName: first-create-file
2+
taskPodTemplate:
3+
schedulerName: SchedulerName
4+
securityContext:
5+
runAsNonRoot: true
6+
runAsUser: 1001

0 commit comments

Comments
 (0)