From fbf6c785f831463d24778342a3bf8668e89a2efe Mon Sep 17 00:00:00 2001 From: Denis Arh Date: Mon, 19 Sep 2022 18:27:38 +0200 Subject: [PATCH] Fix broken workflow tests --- automation/service/workflow_converter.go | 4 ++-- tests/workflows/0001_basics_test.go | 2 +- tests/workflows/main_test.go | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/automation/service/workflow_converter.go b/automation/service/workflow_converter.go index 4ad1674d2..d7c454be3 100644 --- a/automation/service/workflow_converter.go +++ b/automation/service/workflow_converter.go @@ -709,7 +709,7 @@ func verifyStep(s *types.WorkflowStep, in, out types.WorkflowPathSet) types.Work } } - return errors.Internal("unexpected type %q for argument %q no step type %q", msgArg.Type, argName, s.Kind) + return errors.Internal("unexpected type %q for argument %q on step type %q", msgArg.Type, argName, s.Kind) } } @@ -846,7 +846,7 @@ func verifyStep(s *types.WorkflowStep, in, out types.WorkflowPathSet) types.Work checks = append(checks, noRef, // required "workflow" with handle or ID - requiredArg("workflow", expr.String{}, expr.ID{}), + requiredArg("workflow", expr.Handle{}, expr.ID{}), // optional "scope" as expr.Vars checkArg("scope", expr.Vars{}), diff --git a/tests/workflows/0001_basics_test.go b/tests/workflows/0001_basics_test.go index 8e7b3c8b9..ef05282e3 100644 --- a/tests/workflows/0001_basics_test.go +++ b/tests/workflows/0001_basics_test.go @@ -35,6 +35,7 @@ func Test0001_basics_detect_datarace_issues(t *testing.T) { for i := 0; i < 10; i++ { wg.Add(1) go t.Run(fmt.Sprintf("%d", i), func(t *testing.T) { + defer wg.Done() var ( aux = struct{ Foo int64 }{} req = require.New(t) @@ -42,7 +43,6 @@ func Test0001_basics_detect_datarace_issues(t *testing.T) { ) req.NoError(vars.Decode(&aux)) req.Equal(int64(42), aux.Foo) - wg.Done() }) } diff --git a/tests/workflows/main_test.go b/tests/workflows/main_test.go index 08f3ed74f..4eed513d6 100644 --- a/tests/workflows/main_test.go +++ b/tests/workflows/main_test.go @@ -149,9 +149,9 @@ func loadScenarioWithName(ctx context.Context, t *testing.T, scenario string) { } // Reload and register workflows - // if err = service.DefaultWorkflow.Load(ctx); err != nil { - // t.Fatalf("failed to reload workflows: %v", err) - // } + if err = service.DefaultWorkflow.Load(ctx); err != nil { + t.Fatalf("failed to reload workflows: %v", err) + } } func bypassRBAC(ctx context.Context) context.Context {