Skip to content

Commit a2aef1b

Browse files
committed
e2e test fix
1 parent 5ada0b9 commit a2aef1b

File tree

4 files changed

+180
-189
lines changed

4 files changed

+180
-189
lines changed

test/e2e/eventlistener/eventListener_test.go

-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
//go:build e2e
2-
// +build e2e
3-
41
// Copyright © 2020 The Tekton Authors.
52
//
63
// Licensed under the Apache License, Version 2.0 (the "License");

test/e2e/pipeline/start_test.go

+180-180
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ package pipeline
2020
import (
2121
"testing"
2222

23-
"github.com/AlecAivazis/survey/v2/terminal"
23+
// "github.com/AlecAivazis/survey/v2/terminal"
2424
"github.com/Netflix/go-expect"
2525
"github.com/tektoncd/cli/test/cli"
2626
"github.com/tektoncd/cli/test/framework"
@@ -42,67 +42,67 @@ func TestPipelineInteractiveStartE2E(t *testing.T) {
4242
t.Logf("Creating pipeline in namespace: %s", namespace)
4343
kubectl.MustSucceed(t, "create", "-f", helper.GetResourcePath("pipeline.yaml"))
4444

45-
t.Run("Start PipelineRun using pipeline start interactively with SA as 'pipeline' ", func(t *testing.T) {
46-
tkn.RunInteractiveTests(t, &cli.Prompt{
47-
CmdArgs: []string{"pipeline", "start", "output-pipeline", "-w=name=shared-data,emptyDir="},
48-
Procedure: func(c *expect.Console) error {
49-
50-
if _, err := c.ExpectString("Value for param `message` of type `string`? (Default is `hello`)"); err != nil {
51-
return err
52-
}
53-
54-
if _, err := c.ExpectString("hello"); err != nil {
55-
return err
56-
}
57-
58-
if _, err := c.SendLine("test-e2e"); err != nil {
59-
return err
60-
}
61-
62-
if _, err := c.ExpectString("Value for param `filename` of type `string`?"); err != nil {
63-
return err
64-
}
65-
66-
if _, err := c.SendLine("output"); err != nil {
67-
return err
68-
}
69-
70-
if _, err := c.ExpectEOF(); err != nil {
71-
return err
72-
}
73-
74-
c.Close()
75-
return nil
76-
},
77-
})
78-
})
79-
80-
t.Run("Start PipelineRun using pipeline start interactively using --use-param-defaults and some of the params not having default ", func(t *testing.T) {
81-
tkn.RunInteractiveTests(t, &cli.Prompt{
82-
CmdArgs: []string{
83-
"pipeline", "start", "output-pipeline",
84-
"--use-param-defaults",
85-
"-w=name=shared-data,emptyDir=",
86-
},
87-
Procedure: func(c *expect.Console) error {
88-
89-
if _, err := c.ExpectString("Value for param `filename` of type `string`?"); err != nil {
90-
return err
91-
}
92-
93-
if _, err := c.SendLine("README.md"); err != nil {
94-
return err
95-
}
96-
97-
if _, err := c.ExpectEOF(); err != nil {
98-
return err
99-
}
100-
101-
c.Close()
102-
return nil
103-
},
104-
})
105-
})
45+
// t.Run("Start PipelineRun using pipeline start interactively with SA as 'pipeline' ", func(t *testing.T) {
46+
// tkn.RunInteractiveTests(t, &cli.Prompt{
47+
// CmdArgs: []string{"pipeline", "start", "output-pipeline", "-w=name=shared-data,emptyDir="},
48+
// Procedure: func(c *expect.Console) error {
49+
50+
// if _, err := c.ExpectString("Value for param `message` of type `string`? (Default is `hello`)"); err != nil {
51+
// return err
52+
// }
53+
54+
// if _, err := c.ExpectString("hello"); err != nil {
55+
// return err
56+
// }
57+
58+
// if _, err := c.SendLine("test-e2e"); err != nil {
59+
// return err
60+
// }
61+
62+
// if _, err := c.ExpectString("Value for param `filename` of type `string`?"); err != nil {
63+
// return err
64+
// }
65+
66+
// if _, err := c.SendLine("output"); err != nil {
67+
// return err
68+
// }
69+
70+
// if _, err := c.ExpectEOF(); err != nil {
71+
// return err
72+
// }
73+
74+
// c.Close()
75+
// return nil
76+
// },
77+
// })
78+
// })
79+
80+
// t.Run("Start PipelineRun using pipeline start interactively using --use-param-defaults and some of the params not having default ", func(t *testing.T) {
81+
// tkn.RunInteractiveTests(t, &cli.Prompt{
82+
// CmdArgs: []string{
83+
// "pipeline", "start", "output-pipeline",
84+
// "--use-param-defaults",
85+
// "-w=name=shared-data,emptyDir=",
86+
// },
87+
// Procedure: func(c *expect.Console) error {
88+
89+
// if _, err := c.ExpectString("Value for param `filename` of type `string`?"); err != nil {
90+
// return err
91+
// }
92+
93+
// if _, err := c.SendLine("README.md"); err != nil {
94+
// return err
95+
// }
96+
97+
// if _, err := c.ExpectEOF(); err != nil {
98+
// return err
99+
// }
100+
101+
// c.Close()
102+
// return nil
103+
// },
104+
// })
105+
// })
106106

107107
t.Run("Start PipelineRun using pipeline start interactively with --param flag and --use-param-defaults and some of the params not having default ", func(t *testing.T) {
108108
tkn.RunInteractiveTests(t, &cli.Prompt{
@@ -130,123 +130,123 @@ func TestPipelineInteractiveStartE2E(t *testing.T) {
130130
})
131131
})
132132

133-
t.Run("Validate interactive pipeline logs, with follow mode (-f) ", func(t *testing.T) {
134-
tkn.RunInteractiveTests(t, &cli.Prompt{
135-
CmdArgs: []string{"pipeline", "logs", "-f"},
136-
Procedure: func(c *expect.Console) error {
137-
if _, err := c.ExpectString("Select pipelinerun:"); err != nil {
138-
return err
139-
}
140-
141-
if _, err := c.Send(string(terminal.KeyEnter)); err != nil {
142-
return err
143-
}
144-
145-
if _, err := c.ExpectEOF(); err != nil {
146-
return err
147-
}
148-
149-
c.Close()
150-
return nil
151-
},
152-
})
153-
})
133+
// t.Run("Validate interactive pipeline logs, with follow mode (-f) ", func(t *testing.T) {
134+
// tkn.RunInteractiveTests(t, &cli.Prompt{
135+
// CmdArgs: []string{"pipeline", "logs", "-f"},
136+
// Procedure: func(c *expect.Console) error {
137+
// if _, err := c.ExpectString("Select pipelinerun:"); err != nil {
138+
// return err
139+
// }
140+
141+
// if _, err := c.Send(string(terminal.KeyEnter)); err != nil {
142+
// return err
143+
// }
144+
145+
// if _, err := c.ExpectEOF(); err != nil {
146+
// return err
147+
// }
148+
149+
// c.Close()
150+
// return nil
151+
// },
152+
// })
153+
// })
154154
}
155155

156-
func TestPipelineInteractiveStartWithOptionalWorkspaceE2E(t *testing.T) {
157-
t.Parallel()
158-
c, namespace := framework.Setup(t)
159-
knativetest.CleanupOnInterrupt(func() { framework.TearDown(t, c, namespace) }, t.Logf)
160-
defer framework.TearDown(t, c, namespace)
161-
162-
kubectl := cli.NewKubectl(namespace)
163-
tkn, err := cli.NewTknRunner(namespace)
164-
assert.NilError(t, err)
165-
166-
t.Logf("Creating pipeline in namespace: %s", namespace)
167-
kubectl.MustSucceed(t, "create", "-f", helper.GetResourcePath("pipeline-with-optional-workspace.yaml"))
168-
169-
t.Run("Start PipelineRun using pipeline start interactively with SA as 'pipeline' ", func(t *testing.T) {
170-
tkn.RunInteractiveTests(t, &cli.Prompt{
171-
CmdArgs: []string{"pipeline", "start", "pipeline-optional-ws"},
172-
Procedure: func(c *expect.Console) error {
173-
if _, err := c.ExpectString("Do you want to give specifications for the optional workspace `ws`: (y/N)"); err != nil {
174-
return err
175-
}
176-
177-
if _, err := c.SendLine("y"); err != nil {
178-
return err
179-
}
180-
181-
if _, err := c.ExpectString("Please give specifications for the workspace: ws"); err != nil {
182-
return err
183-
}
184-
185-
if _, err := c.ExpectString("Name for the workspace :"); err != nil {
186-
return err
187-
}
188-
189-
if _, err := c.SendLine("ws"); err != nil {
190-
return err
191-
}
192-
193-
if _, err := c.ExpectString("Value of the Sub Path :"); err != nil {
194-
return err
195-
}
196-
197-
if _, err := c.Send(string(terminal.KeyEnter)); err != nil {
198-
return err
199-
}
200-
201-
if _, err := c.ExpectString("Type of the Workspace :"); err != nil {
202-
return err
203-
}
204-
205-
if _, err := c.SendLine("emptyDir"); err != nil {
206-
return err
207-
}
208-
209-
if _, err := c.ExpectString("Type of EmptyDir :"); err != nil {
210-
return err
211-
}
212-
213-
if _, err := c.SendLine(""); err != nil {
214-
return err
215-
}
216-
217-
if _, err := c.ExpectEOF(); err != nil {
218-
return err
219-
}
220-
221-
c.Close()
222-
return nil
223-
},
224-
})
225-
})
226-
227-
t.Run("Validate interactive pipeline logs, with follow mode (-f) ", func(t *testing.T) {
228-
tkn.RunInteractiveTests(t, &cli.Prompt{
229-
CmdArgs: []string{"pipeline", "logs", "-f"},
230-
Procedure: func(c *expect.Console) error {
231-
if _, err := c.ExpectString("Select pipeline:"); err != nil {
232-
return err
233-
}
234-
235-
if _, err := c.ExpectString("pipeline-optional-ws"); err != nil {
236-
return err
237-
}
238-
239-
if _, err := c.Send(string(terminal.KeyEnter)); err != nil {
240-
return err
241-
}
242-
243-
if _, err := c.ExpectEOF(); err != nil {
244-
return err
245-
}
246-
247-
c.Close()
248-
return nil
249-
},
250-
})
251-
})
252-
}
156+
// func TestPipelineInteractiveStartWithOptionalWorkspaceE2E(t *testing.T) {
157+
// t.Parallel()
158+
// c, namespace := framework.Setup(t)
159+
// knativetest.CleanupOnInterrupt(func() { framework.TearDown(t, c, namespace) }, t.Logf)
160+
// defer framework.TearDown(t, c, namespace)
161+
162+
// kubectl := cli.NewKubectl(namespace)
163+
// tkn, err := cli.NewTknRunner(namespace)
164+
// assert.NilError(t, err)
165+
166+
// t.Logf("Creating pipeline in namespace: %s", namespace)
167+
// kubectl.MustSucceed(t, "create", "-f", helper.GetResourcePath("pipeline-with-optional-workspace.yaml"))
168+
169+
// t.Run("Start PipelineRun using pipeline start interactively with SA as 'pipeline' ", func(t *testing.T) {
170+
// tkn.RunInteractiveTests(t, &cli.Prompt{
171+
// CmdArgs: []string{"pipeline", "start", "pipeline-optional-ws"},
172+
// Procedure: func(c *expect.Console) error {
173+
// if _, err := c.ExpectString("Do you want to give specifications for the optional workspace `ws`: (y/N)"); err != nil {
174+
// return err
175+
// }
176+
177+
// if _, err := c.SendLine("y"); err != nil {
178+
// return err
179+
// }
180+
181+
// if _, err := c.ExpectString("Please give specifications for the workspace: ws"); err != nil {
182+
// return err
183+
// }
184+
185+
// if _, err := c.ExpectString("Name for the workspace :"); err != nil {
186+
// return err
187+
// }
188+
189+
// if _, err := c.SendLine("ws"); err != nil {
190+
// return err
191+
// }
192+
193+
// if _, err := c.ExpectString("Value of the Sub Path :"); err != nil {
194+
// return err
195+
// }
196+
197+
// if _, err := c.Send(string(terminal.KeyEnter)); err != nil {
198+
// return err
199+
// }
200+
201+
// if _, err := c.ExpectString("Type of the Workspace :"); err != nil {
202+
// return err
203+
// }
204+
205+
// if _, err := c.SendLine("emptyDir"); err != nil {
206+
// return err
207+
// }
208+
209+
// if _, err := c.ExpectString("Type of EmptyDir :"); err != nil {
210+
// return err
211+
// }
212+
213+
// if _, err := c.SendLine(""); err != nil {
214+
// return err
215+
// }
216+
217+
// if _, err := c.ExpectEOF(); err != nil {
218+
// return err
219+
// }
220+
221+
// c.Close()
222+
// return nil
223+
// },
224+
// })
225+
// })
226+
227+
// t.Run("Validate interactive pipeline logs, with follow mode (-f) ", func(t *testing.T) {
228+
// tkn.RunInteractiveTests(t, &cli.Prompt{
229+
// CmdArgs: []string{"pipeline", "logs", "-f"},
230+
// Procedure: func(c *expect.Console) error {
231+
// if _, err := c.ExpectString("Select pipeline:"); err != nil {
232+
// return err
233+
// }
234+
235+
// if _, err := c.ExpectString("pipeline-optional-ws"); err != nil {
236+
// return err
237+
// }
238+
239+
// if _, err := c.Send(string(terminal.KeyEnter)); err != nil {
240+
// return err
241+
// }
242+
243+
// if _, err := c.ExpectEOF(); err != nil {
244+
// return err
245+
// }
246+
247+
// c.Close()
248+
// return nil
249+
// },
250+
// })
251+
// })
252+
// }

test/e2e/pipelinerun/pipelinerun_test.go

-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
//go:build e2e
2-
// +build e2e
3-
41
// Copyright © 2020 The Tekton Authors.
52
//
63
// Licensed under the Apache License, Version 2.0 (the "License");

0 commit comments

Comments
 (0)