From d6a2cb36f835aeae7354ff28b4f411945026414c Mon Sep 17 00:00:00 2001 From: jbpratt Date: Thu, 3 Mar 2022 05:32:18 -0600 Subject: [PATCH] gofmt -w test/e2e/* format test/e2e files partially fixes #1481 Signed-off-by: jbpratt --- test/e2e/clustertask/start_test.go | 28 +++++++++-------- test/e2e/pipeline/pipeline_test.go | 3 +- test/e2e/pipeline/start_test.go | 48 +++++++++++++++++++----------- test/e2e/resource/create_test.go | 18 +++++++---- test/e2e/task/start_test.go | 27 ++++++++++------- 5 files changed, 76 insertions(+), 48 deletions(-) diff --git a/test/e2e/clustertask/start_test.go b/test/e2e/clustertask/start_test.go index f4f80091de..cc879fac35 100644 --- a/test/e2e/clustertask/start_test.go +++ b/test/e2e/clustertask/start_test.go @@ -63,7 +63,6 @@ func TestClusterTaskInteractiveStartE2E(t *testing.T) { Err: icmd.None, Out: expected, }) - }) } t.Logf("Creating clustertask read-clustertask") @@ -148,7 +147,8 @@ Waiting for logs to be available... c.Close() return nil - }}) + }, + }) taskRunGeneratedName := builder.GetTaskRunListWithClusterTaskName(c, clusterTaskName, true).Items[0].Name if err := wait.ForTaskRunState(c, taskRunGeneratedName, wait.TaskRunSucceed(taskRunGeneratedName), "TaskRunSucceed"); err != nil { t.Errorf("Error waiting for TaskRun to Succeed: %s", err) @@ -170,13 +170,14 @@ Waiting for logs to be available... t.Run("Start ClusterTask passing --param for some params and some params are not passed", func(t *testing.T) { tkn.RunInteractiveTests(t, &cli.Prompt{ - CmdArgs: []string{"clustertask", "start", clusterTaskName, + CmdArgs: []string{ + "clustertask", "start", clusterTaskName, "-i=source=" + tePipelineGitResourceName, "--param=FILEPATH=docs", "-w=name=shared-workspace,emptyDir=", - "--showlog"}, + "--showlog", + }, Procedure: func(c *expect.Console) error { - if _, err := c.ExpectString("Value for param `FILENAME` of type `string`?"); err != nil { return err } @@ -195,7 +196,8 @@ Waiting for logs to be available... c.Close() return nil - }}) + }, + }) taskRunGeneratedName := builder.GetTaskRunListWithClusterTaskName(c, clusterTaskName, true).Items[0].Name if err := wait.ForTaskRunState(c, taskRunGeneratedName, wait.TaskRunSucceed(taskRunGeneratedName), "TaskRunSucceed"); err != nil { t.Errorf("Error waiting for TaskRun to Succeed: %s", err) @@ -204,13 +206,14 @@ Waiting for logs to be available... t.Run("Start ClusterTask with --use-param-defaults and some of the params not having default", func(t *testing.T) { tkn.RunInteractiveTests(t, &cli.Prompt{ - CmdArgs: []string{"clustertask", "start", clusterTaskName, + CmdArgs: []string{ + "clustertask", "start", clusterTaskName, "-i=source=" + tePipelineGitResourceName, "--use-param-defaults", "-w=name=shared-workspace,emptyDir=", - "--showlog"}, + "--showlog", + }, Procedure: func(c *expect.Console) error { - if _, err := c.ExpectString("Value for param `FILENAME` of type `string`?"); err != nil { return err } @@ -229,7 +232,8 @@ Waiting for logs to be available... c.Close() return nil - }}) + }, + }) taskRunGeneratedName := builder.GetTaskRunListWithClusterTaskName(c, clusterTaskName, true).Items[0].Name if err := wait.ForTaskRunState(c, taskRunGeneratedName, wait.TaskRunSucceed(taskRunGeneratedName), "TaskRunSucceed"); err != nil { t.Errorf("Error waiting for TaskRun to Succeed: %s", err) @@ -367,7 +371,8 @@ Waiting for logs to be available... c.Close() return nil - }}) + }, + }) taskRunGeneratedName := builder.GetTaskRunListWithClusterTaskName(c, clusterTaskName2, true).Items[0].Name if err := wait.ForTaskRunState(c, taskRunGeneratedName, wait.TaskRunSucceed(taskRunGeneratedName), "TaskRunSucceed"); err != nil { t.Errorf("Error waiting for TaskRun to Succeed: %s", err) @@ -401,5 +406,4 @@ Waiting for logs to be available... res = tkn.Run("clustertask", "list") assert.Assert(t, !strings.Contains(res.Stdout(), clusterTaskName2)) }) - } diff --git a/test/e2e/pipeline/pipeline_test.go b/test/e2e/pipeline/pipeline_test.go index a544531ee0..34935e0293 100644 --- a/test/e2e/pipeline/pipeline_test.go +++ b/test/e2e/pipeline/pipeline_test.go @@ -255,7 +255,8 @@ Waiting for logs to be available... c.Close() return nil - }}) + }, + }) }) t.Run("Start PipelineRun with tkn pipeline start --last", func(t *testing.T) { diff --git a/test/e2e/pipeline/start_test.go b/test/e2e/pipeline/start_test.go index d85ae9850b..cd355bfc5e 100644 --- a/test/e2e/pipeline/start_test.go +++ b/test/e2e/pipeline/start_test.go @@ -87,13 +87,16 @@ func TestPipelineInteractiveStartE2E(t *testing.T) { 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"}, + CmdArgs: []string{ + "pipeline", "start", "output-pipeline", + "--use-param-defaults", + }, Procedure: func(c *expect.Console) error { if _, err := c.ExpectString("Choose the git resource to use for source-repo:"); err != nil { return err @@ -121,13 +124,16 @@ func TestPipelineInteractiveStartE2E(t *testing.T) { 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{ - CmdArgs: []string{"pipeline", "start", "output-pipeline", - "-p=FILEPATH=docs", "--use-param-defaults"}, + CmdArgs: []string{ + "pipeline", "start", "output-pipeline", + "-p=FILEPATH=docs", "--use-param-defaults", + }, Procedure: func(c *expect.Console) error { if _, err := c.ExpectString("Choose the git resource to use for source-repo:"); err != nil { return err @@ -155,14 +161,17 @@ func TestPipelineInteractiveStartE2E(t *testing.T) { c.Close() return nil - }}) + }, + }) }) t.Run("Start PipelineRun using pipeline start interactively using --use-param-defaults and params provided with -p", func(t *testing.T) { tkn.RunInteractiveTests(t, &cli.Prompt{ - CmdArgs: []string{"pipeline", "start", "output-pipeline", + CmdArgs: []string{ + "pipeline", "start", "output-pipeline", "--use-param-defaults", - "-p=FILENAME=README.md"}, + "-p=FILENAME=README.md", + }, Procedure: func(c *expect.Console) error { if _, err := c.ExpectString("Choose the git resource to use for source-repo:"); err != nil { return err @@ -181,14 +190,14 @@ func TestPipelineInteractiveStartE2E(t *testing.T) { 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 } @@ -203,7 +212,8 @@ func TestPipelineInteractiveStartE2E(t *testing.T) { c.Close() return nil - }}) + }, + }) }) } @@ -282,8 +292,8 @@ func TestPipelineInteractiveStartWithNewResourceE2E(t *testing.T) { c.Close() return nil - }}) - + }, + }) }) t.Run("Validate interactive pipeline logs, with follow mode (-f) ", func(t *testing.T) { @@ -308,7 +318,8 @@ func TestPipelineInteractiveStartWithNewResourceE2E(t *testing.T) { c.Close() return nil - }}) + }, + }) }) } @@ -379,7 +390,8 @@ func TestPipelineInteractiveStartWithOptionalWorkspaceE2E(t *testing.T) { c.Close() return nil - }}) + }, + }) }) t.Run("Validate interactive pipeline logs, with follow mode (-f) ", func(t *testing.T) { @@ -404,7 +416,7 @@ func TestPipelineInteractiveStartWithOptionalWorkspaceE2E(t *testing.T) { c.Close() return nil - }}) + }, + }) }) - } diff --git a/test/e2e/resource/create_test.go b/test/e2e/resource/create_test.go index 02a19f2157..f9848fec10 100644 --- a/test/e2e/resource/create_test.go +++ b/test/e2e/resource/create_test.go @@ -117,7 +117,8 @@ func TestCreateGitResourceInteractively(t *testing.T) { c.Close() return nil - }}) + }, + }) }) t.Run("list single pipeline resource of git type", func(t *testing.T) { @@ -217,7 +218,8 @@ func TestCreateImageResourceInteractively(t *testing.T) { c.Close() return nil - }}) + }, + }) }) t.Run("list single pipeline resource of image type", func(t *testing.T) { @@ -281,7 +283,8 @@ func TestCreateCloudEventResourceInteractively(t *testing.T) { c.Close() return nil - }}) + }, + }) }) t.Run("list single pipeline resource of cloud event type", func(t *testing.T) { @@ -447,7 +450,8 @@ func TestCreateClusterResourceInteractively(t *testing.T) { c.Close() return nil - }}) + }, + }) }) t.Run("list single pipeline resource of cluster type", func(t *testing.T) { @@ -559,7 +563,8 @@ func TestCreatePullRequestResourceInteractively(t *testing.T) { c.Close() return nil - }}) + }, + }) }) t.Run("list single pipeline resource of pullrequest type", func(t *testing.T) { @@ -667,7 +672,8 @@ func TestCreateStroageResourceInteractively(t *testing.T) { c.Close() return nil - }}) + }, + }) }) t.Run("list single pipeline resource of storage type", func(t *testing.T) { diff --git a/test/e2e/task/start_test.go b/test/e2e/task/start_test.go index 891c2280e1..4c34573802 100644 --- a/test/e2e/task/start_test.go +++ b/test/e2e/task/start_test.go @@ -102,12 +102,13 @@ Waiting for logs to be available... t.Run("Start TaskRun using tkn task start command with --use-param-defaults and some of the params not having default", func(t *testing.T) { tkn.RunInteractiveTests(t, &cli.Prompt{ - CmdArgs: []string{"task", "start", "read-task", + CmdArgs: []string{ + "task", "start", "read-task", "-i=source=" + tePipelineGitResourceName, "--use-param-defaults", - "--showlog"}, + "--showlog", + }, Procedure: func(c *expect.Console) error { - if _, err := c.ExpectString("Value for param `FILENAME` of type `string`?"); err != nil { return err } @@ -126,7 +127,8 @@ Waiting for logs to be available... c.Close() return nil - }}) + }, + }) }) t.Run("Get list of TaskRuns from namespace "+namespace, func(t *testing.T) { @@ -171,12 +173,13 @@ Waiting for logs to be available... t.Run("Start TaskRun using tkn task start command with passing one param and tkn will ask for other", func(t *testing.T) { tkn.RunInteractiveTests(t, &cli.Prompt{ - CmdArgs: []string{"task", "start", "read-task", + CmdArgs: []string{ + "task", "start", "read-task", "-i=source=" + tePipelineGitResourceName, "-p=FILEPATH=docs", - "--showlog"}, + "--showlog", + }, Procedure: func(c *expect.Console) error { - if _, err := c.ExpectString("Value for param `FILENAME` of type `string`?"); err != nil { return err } @@ -195,14 +198,14 @@ Waiting for logs to be available... c.Close() return nil - }}) + }, + }) }) t.Run("Validate interactive task logs, with follow mode (-f) ", func(t *testing.T) { tkn.RunInteractiveTests(t, &cli.Prompt{ CmdArgs: []string{"task", "logs", "-f"}, Procedure: func(c *expect.Console) error { - if _, err := c.ExpectString("Select taskrun:"); err != nil { return err } @@ -217,7 +220,8 @@ Waiting for logs to be available... c.Close() return nil - }}) + }, + }) }) t.Logf("Creating Task task-with-workspace in namespace: %s ", namespace) @@ -384,7 +388,8 @@ Waiting for logs to be available... c.Close() return nil - }}) + }, + }) taskRunGeneratedName := builder.GetTaskRunListWithTaskName(c, "task-optional-ws", true).Items[0].Name if err := wait.ForTaskRunState(c, taskRunGeneratedName, wait.TaskRunSucceed(taskRunGeneratedName), "TaskRunSucceed"); err != nil { t.Errorf("Error waiting for TaskRun to Succeed: %s", err)