diff --git a/pkg/testworkflows/testworkflowprocessor/action/process_test.go b/pkg/testworkflows/testworkflowprocessor/action/process_test.go index 90542d2d08d..38ccf374531 100644 --- a/pkg/testworkflows/testworkflowprocessor/action/process_test.go +++ b/pkg/testworkflows/testworkflowprocessor/action/process_test.go @@ -511,7 +511,7 @@ func TestProcess_IgnoreExecutionOfStaticSkipGroup(t *testing.T) { // Build the expectations want := actiontypes.NewActionList(). // Configure - Setup(true, true). + Setup(false, false). // don't copy as there is nothing to do // Declare stage conditions Declare("init", "false"). @@ -557,7 +557,7 @@ func TestProcess_IgnoreExecutionOfStaticSkipGroup_Pause(t *testing.T) { // Build the expectations want := actiontypes.NewActionList(). // Configure - Setup(true, true). + Setup(false, false). // don't copy as there is nothing to do // Declare stage conditions Declare("init", "false"). diff --git a/pkg/testworkflows/testworkflowprocessor/bundle.go b/pkg/testworkflows/testworkflowprocessor/bundle.go index b6ce0cf58cd..2000a8fad61 100644 --- a/pkg/testworkflows/testworkflowprocessor/bundle.go +++ b/pkg/testworkflows/testworkflowprocessor/bundle.go @@ -11,6 +11,7 @@ import ( "k8s.io/client-go/kubernetes" "github.com/kubeshop/testkube/pkg/testworkflows/testworkflowprocessor/action/actiontypes" + "github.com/kubeshop/testkube/pkg/testworkflows/testworkflowprocessor/action/actiontypes/lite" "github.com/kubeshop/testkube/pkg/testworkflows/testworkflowprocessor/constants" "github.com/kubeshop/testkube/pkg/testworkflows/testworkflowprocessor/stage" ) @@ -22,10 +23,14 @@ type Bundle struct { Signature []stage.Signature } -func (b *Bundle) Actions() actiontypes.ActionGroups { - var actions actiontypes.ActionGroups +func (b *Bundle) Actions() (actions actiontypes.ActionGroups) { _ = json.Unmarshal([]byte(b.Job.Spec.Template.Annotations[constants.SpecAnnotationName]), &actions) - return actions + return +} + +func (b *Bundle) LiteActions() (actions lite.LiteActionGroups) { + _ = json.Unmarshal([]byte(b.Job.Spec.Template.Annotations[constants.SpecAnnotationName]), &actions) + return } func (b *Bundle) Deploy(ctx context.Context, clientSet kubernetes.Interface, namespace string) (err error) { diff --git a/pkg/testworkflows/testworkflowprocessor/presets/processor_test.go b/pkg/testworkflows/testworkflowprocessor/presets/processor_test.go index 4bf936e6477..cad8270dff0 100644 --- a/pkg/testworkflows/testworkflowprocessor/presets/processor_test.go +++ b/pkg/testworkflows/testworkflowprocessor/presets/processor_test.go @@ -125,7 +125,7 @@ func TestProcessBasic(t *testing.T) { wantActions := actiontypes.NewActionGroups(). Append(func(list actiontypes.ActionList) actiontypes.ActionList { return list. - Setup(true, true). + Setup(false, false). Declare(constants.RootOperationName, "true"). Declare(sig[0].Ref(), "true", constants.RootOperationName). Result(constants.RootOperationName, sig[0].Ref()). @@ -385,7 +385,7 @@ func TestProcessBasicEnvReference(t *testing.T) { wantActions := lite.NewLiteActionGroups(). Append(func(list lite.LiteActionList) lite.LiteActionList { return list. - Setup(true, true). + Setup(false, false). Declare(constants.RootOperationName, "true"). Declare(sig[0].Ref(), "true", constants.RootOperationName). Result(constants.RootOperationName, sig[0].Ref()). @@ -458,7 +458,7 @@ func TestProcessBasicEnvReference(t *testing.T) { assert.NoError(t, err) assert.Equal(t, wantPod, res.Job.Spec.Template.Spec) - assert.Equal(t, wantActions, res.Actions()) + assert.Equal(t, wantActions, res.LiteActions()) } func TestProcessMultipleSteps(t *testing.T) { @@ -480,7 +480,7 @@ func TestProcessMultipleSteps(t *testing.T) { wantActions := lite.NewLiteActionGroups(). Append(func(list lite.LiteActionList) lite.LiteActionList { return list. - Setup(true, true). + Setup(false, false). Declare(constants.RootOperationName, "true"). Declare(sig[0].Ref(), "true", constants.RootOperationName). Declare(sig[1].Ref(), sig[0].Ref(), constants.RootOperationName). @@ -573,7 +573,7 @@ func TestProcessMultipleSteps(t *testing.T) { assert.NoError(t, err) assert.Equal(t, want, res.Job.Spec.Template.Spec) - assert.Equal(t, wantActions, res.Actions()) + assert.Equal(t, wantActions, res.LiteActions()) } func TestProcessNestedSteps(t *testing.T) { @@ -602,7 +602,7 @@ func TestProcessNestedSteps(t *testing.T) { wantActions := lite.NewLiteActionGroups(). Append(func(list lite.LiteActionList) lite.LiteActionList { return list. - Setup(true, true). + Setup(false, false). Declare(constants.RootOperationName, "true"). Declare(sig[0].Ref(), "true", constants.RootOperationName). Declare(sig[1].Ref(), sig[0].Ref(), constants.RootOperationName). @@ -749,7 +749,7 @@ func TestProcessNestedSteps(t *testing.T) { } assert.NoError(t, err) - assert.Equal(t, wantActions, res.Actions()) + assert.Equal(t, wantActions, res.LiteActions()) assert.Equal(t, want, res.Job.Spec.Template.Spec) } @@ -971,7 +971,7 @@ func TestProcessShell(t *testing.T) { want := lite.NewLiteActionGroups(). Append(func(list lite.LiteActionList) lite.LiteActionList { return list. - Setup(true, true). + Setup(false, false). Declare(constants.RootOperationName, "true"). Declare(sig[0].Ref(), "true", constants.RootOperationName). Result(constants.RootOperationName, sig[0].Ref()). @@ -995,5 +995,5 @@ func TestProcessShell(t *testing.T) { }) assert.NoError(t, err) - assert.Equal(t, want, res.Actions()) + assert.Equal(t, want, res.LiteActions()) }