From 057d596f1382726da838dd005a056f72fefe3eff Mon Sep 17 00:00:00 2001 From: Sami Alajrami Date: Mon, 21 Oct 2024 14:03:26 +0200 Subject: [PATCH] revert tests --- cmd/kosli/beginTrail_test.go | 2 +- cmd/kosli/createEnvironment_test.go | 2 +- cmd/kosli/createFlow_test.go | 2 +- cmd/kosli/renameEnvironment_test.go | 2 +- cmd/kosli/renameFlow_test.go | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cmd/kosli/beginTrail_test.go b/cmd/kosli/beginTrail_test.go index a4b813361..71b4dbe0d 100644 --- a/cmd/kosli/beginTrail_test.go +++ b/cmd/kosli/beginTrail_test.go @@ -39,7 +39,7 @@ func (suite *BeginTrailCommandTestSuite) TestBeginTrailCmd() { wantError: true, name: "fails when name is considered invalid by the server", cmd: fmt.Sprintf("begin trail foo?$bar --flow %s %s", suite.flowName, suite.defaultKosliArguments), - golden: "Error: Input payload validation failed: map[name:'foo?$bar' does not match '^[a-zA-Z0-9][a-zA-Z0-9\\\\-_\\\\.~]*$']\n", + golden: "Error: Input payload validation failed: map[name:'foo?$bar' does not match '^[a-zA-Z0-9][a-zA-Z0-9\\\\.\\\\-_~]*$']\n", }, { wantError: true, diff --git a/cmd/kosli/createEnvironment_test.go b/cmd/kosli/createEnvironment_test.go index 6204c2902..163db34e6 100644 --- a/cmd/kosli/createEnvironment_test.go +++ b/cmd/kosli/createEnvironment_test.go @@ -100,7 +100,7 @@ func (suite *CreateEnvironmentCommandTestSuite) TestCreateEnvironmentCmd() { wantError: true, name: "fails when name is considered invalid by the server", cmd: "create env 'foo bar' --type K8S" + suite.defaultKosliArguments, - golden: "Error: Input payload validation failed: map[name:'foo bar' does not match '^[a-zA-Z][a-zA-Z0-9\\\\-]*$']\n", + golden: "Error: Input payload validation failed: map[name:'foo bar' does not match '^[a-zA-Z0-9][a-zA-Z0-9\\\\.\\\\-_~]*$']\n", }, { wantError: false, diff --git a/cmd/kosli/createFlow_test.go b/cmd/kosli/createFlow_test.go index 17a47dd48..471100304 100644 --- a/cmd/kosli/createFlow_test.go +++ b/cmd/kosli/createFlow_test.go @@ -36,7 +36,7 @@ func (suite *CreateFlowCommandTestSuite) TestCreateFlowCmd() { wantError: true, name: "fails when name is considered invalid by the server", cmd: "create flow 'foo bar'" + suite.defaultKosliArguments, - golden: "Error: Input payload validation failed: map[name:'foo bar' does not match '^[a-zA-Z0-9\\\\-\\\\.]+$']\n", + golden: "Error: Input payload validation failed: map[name:'foo bar' does not match '^[a-zA-Z0-9][a-zA-Z0-9\\\\.\\\\-_~]*$']\n", }, { name: "can create a flow (by default legacy template is used)", diff --git a/cmd/kosli/renameEnvironment_test.go b/cmd/kosli/renameEnvironment_test.go index b2e2623ec..2e946c65b 100644 --- a/cmd/kosli/renameEnvironment_test.go +++ b/cmd/kosli/renameEnvironment_test.go @@ -39,7 +39,7 @@ func (suite *RenameEnvironmentCommandTestSuite) TestRenameEnvironmentCmd() { wantError: true, name: "renaming environment fails if the new name is illegal", cmd: fmt.Sprintf(`rename environment %s 'new illegal name' %s`, suite.envName, suite.defaultKosliArguments), - golden: "Error: 'new illegal name' is an invalid name for environments. Valid names should start with a letter and can contain alphanumeric characters and '-'.\n", + golden: "Error: 'new illegal name' is an invalid name for environments. Valid names should start with an alphanumeric and only contain alphanumeric characters, '.', '-', '_' and '~'.\n", }, { wantError: true, diff --git a/cmd/kosli/renameFlow_test.go b/cmd/kosli/renameFlow_test.go index 623b110e4..aa491c404 100644 --- a/cmd/kosli/renameFlow_test.go +++ b/cmd/kosli/renameFlow_test.go @@ -39,7 +39,7 @@ func (suite *RenameFlowCommandTestSuite) TestRenameFlowCmd() { wantError: true, name: "renaming flow fails if the new name is illegal", cmd: fmt.Sprintf(`rename flow %s 'new illegal name' %s`, suite.flowName, suite.defaultKosliArguments), - golden: "Error: 'new illegal name' is an invalid name for flows. Valid names should only contain alphanumeric characters, '.', and '-'.\n", + golden: "Error: 'new illegal name' is an invalid name for flows. Valid names should start with an alphanumeric and only contain alphanumeric characters, '.', '-', '_' and '~'.\n", }, { wantError: true,