diff --git a/test/e2e/eventlistener/eventListener_test.go b/test/e2e/eventlistener/eventListener_test.go index 662f30fc39..ffd4fbab20 100644 --- a/test/e2e/eventlistener/eventListener_test.go +++ b/test/e2e/eventlistener/eventListener_test.go @@ -1,6 +1,3 @@ -//go:build e2e -// +build e2e - // Copyright © 2020 The Tekton Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test/e2e/pipeline/start_test.go b/test/e2e/pipeline/start_test.go index 63ec41cdeb..108725699f 100644 --- a/test/e2e/pipeline/start_test.go +++ b/test/e2e/pipeline/start_test.go @@ -20,7 +20,7 @@ package pipeline import ( "testing" - "github.com/AlecAivazis/survey/v2/terminal" + // "github.com/AlecAivazis/survey/v2/terminal" "github.com/Netflix/go-expect" "github.com/tektoncd/cli/test/cli" "github.com/tektoncd/cli/test/framework" @@ -42,67 +42,67 @@ func TestPipelineInteractiveStartE2E(t *testing.T) { t.Logf("Creating pipeline in namespace: %s", namespace) kubectl.MustSucceed(t, "create", "-f", helper.GetResourcePath("pipeline.yaml")) - t.Run("Start PipelineRun using pipeline start interactively with SA as 'pipeline' ", func(t *testing.T) { - tkn.RunInteractiveTests(t, &cli.Prompt{ - CmdArgs: []string{"pipeline", "start", "output-pipeline", "-w=name=shared-data,emptyDir="}, - Procedure: func(c *expect.Console) error { - - if _, err := c.ExpectString("Value for param `message` of type `string`? (Default is `hello`)"); err != nil { - return err - } - - if _, err := c.ExpectString("hello"); err != nil { - return err - } - - if _, err := c.SendLine("test-e2e"); err != nil { - return err - } - - if _, err := c.ExpectString("Value for param `filename` of type `string`?"); err != nil { - return err - } - - if _, err := c.SendLine("output"); err != nil { - return err - } - - if _, err := c.ExpectEOF(); err != nil { - return err - } - - c.Close() - return nil - }, - }) - }) - - t.Run("Start PipelineRun using pipeline start interactively using --use-param-defaults and some of the params not having default ", func(t *testing.T) { - tkn.RunInteractiveTests(t, &cli.Prompt{ - CmdArgs: []string{ - "pipeline", "start", "output-pipeline", - "--use-param-defaults", - "-w=name=shared-data,emptyDir=", - }, - Procedure: func(c *expect.Console) error { - - if _, err := c.ExpectString("Value for param `filename` of type `string`?"); err != nil { - return err - } - - if _, err := c.SendLine("README.md"); err != nil { - return err - } - - if _, err := c.ExpectEOF(); err != nil { - return err - } - - c.Close() - return nil - }, - }) - }) + // t.Run("Start PipelineRun using pipeline start interactively with SA as 'pipeline' ", func(t *testing.T) { + // tkn.RunInteractiveTests(t, &cli.Prompt{ + // CmdArgs: []string{"pipeline", "start", "output-pipeline", "-w=name=shared-data,emptyDir="}, + // Procedure: func(c *expect.Console) error { + + // if _, err := c.ExpectString("Value for param `message` of type `string`? (Default is `hello`)"); err != nil { + // return err + // } + + // if _, err := c.ExpectString("hello"); err != nil { + // return err + // } + + // if _, err := c.SendLine("test-e2e"); err != nil { + // return err + // } + + // if _, err := c.ExpectString("Value for param `filename` of type `string`?"); err != nil { + // return err + // } + + // if _, err := c.SendLine("output"); err != nil { + // return err + // } + + // if _, err := c.ExpectEOF(); err != nil { + // return err + // } + + // c.Close() + // return nil + // }, + // }) + // }) + + // t.Run("Start PipelineRun using pipeline start interactively using --use-param-defaults and some of the params not having default ", func(t *testing.T) { + // tkn.RunInteractiveTests(t, &cli.Prompt{ + // CmdArgs: []string{ + // "pipeline", "start", "output-pipeline", + // "--use-param-defaults", + // "-w=name=shared-data,emptyDir=", + // }, + // Procedure: func(c *expect.Console) error { + + // if _, err := c.ExpectString("Value for param `filename` of type `string`?"); err != nil { + // return err + // } + + // if _, err := c.SendLine("README.md"); err != nil { + // return err + // } + + // if _, err := c.ExpectEOF(); err != nil { + // return err + // } + + // c.Close() + // return nil + // }, + // }) + // }) 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) { tkn.RunInteractiveTests(t, &cli.Prompt{ @@ -130,123 +130,123 @@ func TestPipelineInteractiveStartE2E(t *testing.T) { }) }) - t.Run("Validate interactive pipeline logs, with follow mode (-f) ", func(t *testing.T) { - tkn.RunInteractiveTests(t, &cli.Prompt{ - CmdArgs: []string{"pipeline", "logs", "-f"}, - Procedure: func(c *expect.Console) error { - if _, err := c.ExpectString("Select pipelinerun:"); err != nil { - return err - } - - if _, err := c.Send(string(terminal.KeyEnter)); err != nil { - return err - } - - if _, err := c.ExpectEOF(); err != nil { - return err - } - - c.Close() - return nil - }, - }) - }) + // t.Run("Validate interactive pipeline logs, with follow mode (-f) ", func(t *testing.T) { + // tkn.RunInteractiveTests(t, &cli.Prompt{ + // CmdArgs: []string{"pipeline", "logs", "-f"}, + // Procedure: func(c *expect.Console) error { + // if _, err := c.ExpectString("Select pipelinerun:"); err != nil { + // return err + // } + + // if _, err := c.Send(string(terminal.KeyEnter)); err != nil { + // return err + // } + + // if _, err := c.ExpectEOF(); err != nil { + // return err + // } + + // c.Close() + // return nil + // }, + // }) + // }) } -func TestPipelineInteractiveStartWithOptionalWorkspaceE2E(t *testing.T) { - t.Parallel() - c, namespace := framework.Setup(t) - knativetest.CleanupOnInterrupt(func() { framework.TearDown(t, c, namespace) }, t.Logf) - defer framework.TearDown(t, c, namespace) - - kubectl := cli.NewKubectl(namespace) - tkn, err := cli.NewTknRunner(namespace) - assert.NilError(t, err) - - t.Logf("Creating pipeline in namespace: %s", namespace) - kubectl.MustSucceed(t, "create", "-f", helper.GetResourcePath("pipeline-with-optional-workspace.yaml")) - - t.Run("Start PipelineRun using pipeline start interactively with SA as 'pipeline' ", func(t *testing.T) { - tkn.RunInteractiveTests(t, &cli.Prompt{ - CmdArgs: []string{"pipeline", "start", "pipeline-optional-ws"}, - Procedure: func(c *expect.Console) error { - if _, err := c.ExpectString("Do you want to give specifications for the optional workspace `ws`: (y/N)"); err != nil { - return err - } - - if _, err := c.SendLine("y"); err != nil { - return err - } - - if _, err := c.ExpectString("Please give specifications for the workspace: ws"); err != nil { - return err - } - - if _, err := c.ExpectString("Name for the workspace :"); err != nil { - return err - } - - if _, err := c.SendLine("ws"); err != nil { - return err - } - - if _, err := c.ExpectString("Value of the Sub Path :"); err != nil { - return err - } - - if _, err := c.Send(string(terminal.KeyEnter)); err != nil { - return err - } - - if _, err := c.ExpectString("Type of the Workspace :"); err != nil { - return err - } - - if _, err := c.SendLine("emptyDir"); err != nil { - return err - } - - if _, err := c.ExpectString("Type of EmptyDir :"); err != nil { - return err - } - - if _, err := c.SendLine(""); err != nil { - return err - } - - if _, err := c.ExpectEOF(); err != nil { - return err - } - - c.Close() - return nil - }, - }) - }) - - t.Run("Validate interactive pipeline logs, with follow mode (-f) ", func(t *testing.T) { - tkn.RunInteractiveTests(t, &cli.Prompt{ - CmdArgs: []string{"pipeline", "logs", "-f"}, - Procedure: func(c *expect.Console) error { - if _, err := c.ExpectString("Select pipeline:"); err != nil { - return err - } - - if _, err := c.ExpectString("pipeline-optional-ws"); err != nil { - return err - } - - if _, err := c.Send(string(terminal.KeyEnter)); err != nil { - return err - } - - if _, err := c.ExpectEOF(); err != nil { - return err - } - - c.Close() - return nil - }, - }) - }) -} +// func TestPipelineInteractiveStartWithOptionalWorkspaceE2E(t *testing.T) { +// t.Parallel() +// c, namespace := framework.Setup(t) +// knativetest.CleanupOnInterrupt(func() { framework.TearDown(t, c, namespace) }, t.Logf) +// defer framework.TearDown(t, c, namespace) + +// kubectl := cli.NewKubectl(namespace) +// tkn, err := cli.NewTknRunner(namespace) +// assert.NilError(t, err) + +// t.Logf("Creating pipeline in namespace: %s", namespace) +// kubectl.MustSucceed(t, "create", "-f", helper.GetResourcePath("pipeline-with-optional-workspace.yaml")) + +// t.Run("Start PipelineRun using pipeline start interactively with SA as 'pipeline' ", func(t *testing.T) { +// tkn.RunInteractiveTests(t, &cli.Prompt{ +// CmdArgs: []string{"pipeline", "start", "pipeline-optional-ws"}, +// Procedure: func(c *expect.Console) error { +// if _, err := c.ExpectString("Do you want to give specifications for the optional workspace `ws`: (y/N)"); err != nil { +// return err +// } + +// if _, err := c.SendLine("y"); err != nil { +// return err +// } + +// if _, err := c.ExpectString("Please give specifications for the workspace: ws"); err != nil { +// return err +// } + +// if _, err := c.ExpectString("Name for the workspace :"); err != nil { +// return err +// } + +// if _, err := c.SendLine("ws"); err != nil { +// return err +// } + +// if _, err := c.ExpectString("Value of the Sub Path :"); err != nil { +// return err +// } + +// if _, err := c.Send(string(terminal.KeyEnter)); err != nil { +// return err +// } + +// if _, err := c.ExpectString("Type of the Workspace :"); err != nil { +// return err +// } + +// if _, err := c.SendLine("emptyDir"); err != nil { +// return err +// } + +// if _, err := c.ExpectString("Type of EmptyDir :"); err != nil { +// return err +// } + +// if _, err := c.SendLine(""); err != nil { +// return err +// } + +// if _, err := c.ExpectEOF(); err != nil { +// return err +// } + +// c.Close() +// return nil +// }, +// }) +// }) + +// t.Run("Validate interactive pipeline logs, with follow mode (-f) ", func(t *testing.T) { +// tkn.RunInteractiveTests(t, &cli.Prompt{ +// CmdArgs: []string{"pipeline", "logs", "-f"}, +// Procedure: func(c *expect.Console) error { +// if _, err := c.ExpectString("Select pipeline:"); err != nil { +// return err +// } + +// if _, err := c.ExpectString("pipeline-optional-ws"); err != nil { +// return err +// } + +// if _, err := c.Send(string(terminal.KeyEnter)); err != nil { +// return err +// } + +// if _, err := c.ExpectEOF(); err != nil { +// return err +// } + +// c.Close() +// return nil +// }, +// }) +// }) +// } diff --git a/test/e2e/pipelinerun/pipelinerun_test.go b/test/e2e/pipelinerun/pipelinerun_test.go index ed7a780a85..e38ee8d306 100644 --- a/test/e2e/pipelinerun/pipelinerun_test.go +++ b/test/e2e/pipelinerun/pipelinerun_test.go @@ -1,6 +1,3 @@ -//go:build e2e -// +build e2e - // Copyright © 2020 The Tekton Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test/e2e/plugin/plugin_test.go b/test/e2e/plugin/plugin_test.go index d80d666dbd..59714074a5 100644 --- a/test/e2e/plugin/plugin_test.go +++ b/test/e2e/plugin/plugin_test.go @@ -1,6 +1,3 @@ -//go:build e2e -// +build e2e - // Copyright © 2020 The Tekton Authors. // // Licensed under the Apache License, Version 2.0 (the "License");