diff --git a/flytectl/cmd/config/subcommand/launchplan/config_flags.go b/flytectl/cmd/config/subcommand/launchplan/config_flags.go index 3348bff7ee..dfac4c53ea 100755 --- a/flytectl/cmd/config/subcommand/launchplan/config_flags.go +++ b/flytectl/cmd/config/subcommand/launchplan/config_flags.go @@ -58,5 +58,6 @@ func (cfg Config) GetPFlagSet(prefix string) *pflag.FlagSet { cmdFlags.Int32Var(&DefaultConfig.Filter.Limit, fmt.Sprintf("%v%v", prefix, "filter.limit"), DefaultConfig.Filter.Limit, "Specifies the limit") cmdFlags.BoolVar(&DefaultConfig.Filter.Asc, fmt.Sprintf("%v%v", prefix, "filter.asc"), DefaultConfig.Filter.Asc, "Specifies the sorting order. By default flytectl sort result in descending order") cmdFlags.Int32Var(&DefaultConfig.Filter.Page, fmt.Sprintf("%v%v", prefix, "filter.page"), DefaultConfig.Filter.Page, "Specifies the page number, in case there are multiple pages of results") + cmdFlags.StringVar(&DefaultConfig.Workflow, fmt.Sprintf("%v%v", prefix, "workflow"), DefaultConfig.Workflow, "name of the workflow for which the launchplans need to be fetched.") return cmdFlags } diff --git a/flytectl/cmd/config/subcommand/launchplan/config_flags_test.go b/flytectl/cmd/config/subcommand/launchplan/config_flags_test.go index afcd0597dd..b46c8d104f 100755 --- a/flytectl/cmd/config/subcommand/launchplan/config_flags_test.go +++ b/flytectl/cmd/config/subcommand/launchplan/config_flags_test.go @@ -211,4 +211,18 @@ func TestConfig_SetFlags(t *testing.T) { } }) }) + t.Run("Test_workflow", func(t *testing.T) { + + t.Run("Override", func(t *testing.T) { + testValue := "1" + + cmdFlags.Set("workflow", testValue) + if vString, err := cmdFlags.GetString("workflow"); err == nil { + testDecodeJson_Config(t, fmt.Sprintf("%v", vString), &actual.Workflow) + + } else { + assert.FailNow(t, err.Error()) + } + }) + }) } diff --git a/flytectl/cmd/config/subcommand/launchplan/launchplan_config.go b/flytectl/cmd/config/subcommand/launchplan/launchplan_config.go index 7c8245256a..1a10764384 100644 --- a/flytectl/cmd/config/subcommand/launchplan/launchplan_config.go +++ b/flytectl/cmd/config/subcommand/launchplan/launchplan_config.go @@ -17,4 +17,5 @@ type Config struct { Version string `json:"version" pflag:",version of the launchplan to be fetched."` Latest bool `json:"latest" pflag:", flag to indicate to fetch the latest version, version flag will be ignored in this case"` Filter filters.Filters `json:"filter" pflag:","` + Workflow string `json:"workflow" pflag:",name of the workflow for which the launchplans need to be fetched."` } diff --git a/flytectl/cmd/get/launch_plan.go b/flytectl/cmd/get/launch_plan.go index 1700f4c04e..047965ebf4 100644 --- a/flytectl/cmd/get/launch_plan.go +++ b/flytectl/cmd/get/launch_plan.go @@ -2,6 +2,7 @@ package get import ( "context" + "fmt" "github.com/flyteorg/flytectl/cmd/config" "github.com/flyteorg/flytectl/cmd/config/subcommand/launchplan" @@ -40,6 +41,12 @@ Retrieve a particular version of the launch plan by name within the project and flytectl get launchplan -p flytesnacks -d development core.basic.lp.go_greet --version v2 +Retrieve all launch plans for a given workflow name: + +:: + + flytectl get launchplan -p flytesnacks -d development --workflow core.flyte_basics.lp.go_greet + Retrieve all the launch plans with filters: :: @@ -170,6 +177,13 @@ func getLaunchPlanFunc(ctx context.Context, args []string, cmdCtx cmdCore.Comman return nil } + if len(launchplan.DefaultConfig.Workflow) > 0 { + if len(launchplan.DefaultConfig.Filter.FieldSelector) > 0 { + return fmt.Errorf("fieldSelector cannot be specified with workflow flag") + } + launchplan.DefaultConfig.Filter.FieldSelector = fmt.Sprintf("workflow.name=%s", launchplan.DefaultConfig.Workflow) + } + launchPlans, err := cmdCtx.AdminFetcherExt().FetchAllVerOfLP(ctx, "", config.GetConfig().Project, config.GetConfig().Domain, launchplan.DefaultConfig.Filter) if err != nil { return err diff --git a/flytectl/cmd/get/launch_plan_test.go b/flytectl/cmd/get/launch_plan_test.go index e6a7cbec01..a36cd2ec77 100644 --- a/flytectl/cmd/get/launch_plan_test.go +++ b/flytectl/cmd/get/launch_plan_test.go @@ -23,14 +23,15 @@ import ( ) var ( - resourceListRequest *admin.ResourceListRequest - resourceGetRequest *admin.ResourceListRequest - objectGetRequest *admin.ObjectGetRequest - namedIDRequest *admin.NamedEntityIdentifierListRequest - launchPlanListResponse *admin.LaunchPlanList - argsLp []string - namedIdentifierList *admin.NamedEntityIdentifierList - launchPlan2 *admin.LaunchPlan + resourceListRequest *admin.ResourceListRequest + resourceGetRequest *admin.ResourceListRequest + objectGetRequest *admin.ObjectGetRequest + namedIDRequest *admin.NamedEntityIdentifierListRequest + launchPlanListResponse *admin.LaunchPlanList + filteredLaunchPlanListResponse *admin.LaunchPlanList + argsLp []string + namedIdentifierList *admin.NamedEntityIdentifierList + launchPlan2 *admin.LaunchPlan ) func getLaunchPlanSetup() { @@ -96,6 +97,9 @@ func getLaunchPlanSetup() { Version: "v1", }, Spec: &admin.LaunchPlanSpec{ + WorkflowId: &core.Identifier{ + Name: "workflow1", + }, DefaultInputs: &core.ParameterMap{ Parameters: parameterMap, }, @@ -113,6 +117,9 @@ func getLaunchPlanSetup() { Version: "v2", }, Spec: &admin.LaunchPlanSpec{ + WorkflowId: &core.Identifier{ + Name: "workflow2", + }, DefaultInputs: &core.ParameterMap{ Parameters: parameterMap, }, @@ -146,6 +153,10 @@ func getLaunchPlanSetup() { LaunchPlans: launchPlans, } + filteredLaunchPlanListResponse = &admin.LaunchPlanList{ + LaunchPlans: []*admin.LaunchPlan{launchPlan2}, + } + objectGetRequest = &admin.ObjectGetRequest{ Id: &core.Identifier{ ResourceType: core.ResourceType_LAUNCH_PLAN, @@ -249,178 +260,7 @@ func TestGetLaunchPlanFunc(t *testing.T) { err = getLaunchPlanFunc(ctx, argsLp, cmdCtx) assert.Nil(t, err) mockClient.AssertCalled(t, "ListLaunchPlans", ctx, resourceGetRequest) - tearDownAndVerify(t, `[ - { - "id": { - "name": "launchplan1", - "version": "v2" - }, - "spec": { - "defaultInputs": { - "parameters": { - "numbers": { - "var": { - "type": { - "collectionType": { - "simple": "INTEGER" - } - }, - "description": "short desc" - } - }, - "numbers_count": { - "var": { - "type": { - "simple": "INTEGER" - }, - "description": "long description will be truncated in table" - } - }, - "run_local_at_count": { - "var": { - "type": { - "simple": "INTEGER" - }, - "description": "run_local_at_count" - }, - "default": { - "scalar": { - "primitive": { - "integer": "10" - } - } - } - } - } - } - }, - "closure": { - "expectedInputs": { - "parameters": { - "numbers": { - "var": { - "type": { - "collectionType": { - "simple": "INTEGER" - } - }, - "description": "short desc" - } - }, - "numbers_count": { - "var": { - "type": { - "simple": "INTEGER" - }, - "description": "long description will be truncated in table" - } - }, - "run_local_at_count": { - "var": { - "type": { - "simple": "INTEGER" - }, - "description": "run_local_at_count" - }, - "default": { - "scalar": { - "primitive": { - "integer": "10" - } - } - } - } - } - }, - "createdAt": "1970-01-01T00:00:01Z" - } - }, - { - "id": { - "name": "launchplan1", - "version": "v1" - }, - "spec": { - "defaultInputs": { - "parameters": { - "numbers": { - "var": { - "type": { - "collectionType": { - "simple": "INTEGER" - } - }, - "description": "short desc" - } - }, - "numbers_count": { - "var": { - "type": { - "simple": "INTEGER" - }, - "description": "long description will be truncated in table" - } - }, - "run_local_at_count": { - "var": { - "type": { - "simple": "INTEGER" - }, - "description": "run_local_at_count" - }, - "default": { - "scalar": { - "primitive": { - "integer": "10" - } - } - } - } - } - } - }, - "closure": { - "expectedInputs": { - "parameters": { - "numbers": { - "var": { - "type": { - "collectionType": { - "simple": "INTEGER" - } - }, - "description": "short desc" - } - }, - "numbers_count": { - "var": { - "type": { - "simple": "INTEGER" - }, - "description": "long description will be truncated in table" - } - }, - "run_local_at_count": { - "var": { - "type": { - "simple": "INTEGER" - }, - "description": "run_local_at_count" - }, - "default": { - "scalar": { - "primitive": { - "integer": "10" - } - } - } - } - } - }, - "createdAt": "1970-01-01T00:00:00Z" - } - } -]`) + tearDownAndVerify(t, `[{"id": {"name": "launchplan1","version": "v2"},"spec": {"workflowId": {"name": "workflow2"},"defaultInputs": {"parameters": {"numbers": {"var": {"type": {"collectionType": {"simple": "INTEGER"}},"description": "short desc"}},"numbers_count": {"var": {"type": {"simple": "INTEGER"},"description": "long description will be truncated in table"}},"run_local_at_count": {"var": {"type": {"simple": "INTEGER"},"description": "run_local_at_count"},"default": {"scalar": {"primitive": {"integer": "10"}}}}}}},"closure": {"expectedInputs": {"parameters": {"numbers": {"var": {"type": {"collectionType": {"simple": "INTEGER"}},"description": "short desc"}},"numbers_count": {"var": {"type": {"simple": "INTEGER"},"description": "long description will be truncated in table"}},"run_local_at_count": {"var": {"type": {"simple": "INTEGER"},"description": "run_local_at_count"},"default": {"scalar": {"primitive": {"integer": "10"}}}}}},"createdAt": "1970-01-01T00:00:01Z"}},{"id": {"name": "launchplan1","version": "v1"},"spec": {"workflowId": {"name": "workflow1"},"defaultInputs": {"parameters": {"numbers": {"var": {"type": {"collectionType": {"simple": "INTEGER"}},"description": "short desc"}},"numbers_count": {"var": {"type": {"simple": "INTEGER"},"description": "long description will be truncated in table"}},"run_local_at_count": {"var": {"type": {"simple": "INTEGER"},"description": "run_local_at_count"},"default": {"scalar": {"primitive": {"integer": "10"}}}}}}},"closure": {"expectedInputs": {"parameters": {"numbers": {"var": {"type": {"collectionType": {"simple": "INTEGER"}},"description": "short desc"}},"numbers_count": {"var": {"type": {"simple": "INTEGER"},"description": "long description will be truncated in table"}},"run_local_at_count": {"var": {"type": {"simple": "INTEGER"},"description": "run_local_at_count"},"default": {"scalar": {"primitive": {"integer": "10"}}}}}},"createdAt": "1970-01-01T00:00:00Z"}}]`) } func TestGetLaunchPlanFuncLatest(t *testing.T) { @@ -433,91 +273,7 @@ func TestGetLaunchPlanFuncLatest(t *testing.T) { err = getLaunchPlanFunc(ctx, argsLp, cmdCtx) assert.Nil(t, err) mockClient.AssertCalled(t, "ListLaunchPlans", ctx, resourceGetRequest) - tearDownAndVerify(t, `{ - "id": { - "name": "launchplan1", - "version": "v2" - }, - "spec": { - "defaultInputs": { - "parameters": { - "numbers": { - "var": { - "type": { - "collectionType": { - "simple": "INTEGER" - } - }, - "description": "short desc" - } - }, - "numbers_count": { - "var": { - "type": { - "simple": "INTEGER" - }, - "description": "long description will be truncated in table" - } - }, - "run_local_at_count": { - "var": { - "type": { - "simple": "INTEGER" - }, - "description": "run_local_at_count" - }, - "default": { - "scalar": { - "primitive": { - "integer": "10" - } - } - } - } - } - } - }, - "closure": { - "expectedInputs": { - "parameters": { - "numbers": { - "var": { - "type": { - "collectionType": { - "simple": "INTEGER" - } - }, - "description": "short desc" - } - }, - "numbers_count": { - "var": { - "type": { - "simple": "INTEGER" - }, - "description": "long description will be truncated in table" - } - }, - "run_local_at_count": { - "var": { - "type": { - "simple": "INTEGER" - }, - "description": "run_local_at_count" - }, - "default": { - "scalar": { - "primitive": { - "integer": "10" - } - } - } - } - } - }, - "createdAt": "1970-01-01T00:00:01Z" - } -}`) + tearDownAndVerify(t, `{"id": {"name": "launchplan1","version": "v2"},"spec": {"workflowId": {"name": "workflow2"},"defaultInputs": {"parameters": {"numbers": {"var": {"type": {"collectionType": {"simple": "INTEGER"}},"description": "short desc"}},"numbers_count": {"var": {"type": {"simple": "INTEGER"},"description": "long description will be truncated in table"}},"run_local_at_count": {"var": {"type": {"simple": "INTEGER"},"description": "run_local_at_count"},"default": {"scalar": {"primitive": {"integer": "10"}}}}}}},"closure": {"expectedInputs": {"parameters": {"numbers": {"var": {"type": {"collectionType": {"simple": "INTEGER"}},"description": "short desc"}},"numbers_count": {"var": {"type": {"simple": "INTEGER"},"description": "long description will be truncated in table"}},"run_local_at_count": {"var": {"type": {"simple": "INTEGER"},"description": "run_local_at_count"},"default": {"scalar": {"primitive": {"integer": "10"}}}}}},"createdAt": "1970-01-01T00:00:01Z"}}`) } func TestGetLaunchPlanWithVersion(t *testing.T) { @@ -530,102 +286,40 @@ func TestGetLaunchPlanWithVersion(t *testing.T) { err = getLaunchPlanFunc(ctx, argsLp, cmdCtx) assert.Nil(t, err) mockClient.AssertCalled(t, "GetLaunchPlan", ctx, objectGetRequest) - tearDownAndVerify(t, `{ - "id": { - "name": "launchplan1", - "version": "v2" - }, - "spec": { - "defaultInputs": { - "parameters": { - "numbers": { - "var": { - "type": { - "collectionType": { - "simple": "INTEGER" - } - }, - "description": "short desc" - } - }, - "numbers_count": { - "var": { - "type": { - "simple": "INTEGER" - }, - "description": "long description will be truncated in table" - } - }, - "run_local_at_count": { - "var": { - "type": { - "simple": "INTEGER" - }, - "description": "run_local_at_count" - }, - "default": { - "scalar": { - "primitive": { - "integer": "10" - } - } - } - } - } - } - }, - "closure": { - "expectedInputs": { - "parameters": { - "numbers": { - "var": { - "type": { - "collectionType": { - "simple": "INTEGER" - } - }, - "description": "short desc" - } - }, - "numbers_count": { - "var": { - "type": { - "simple": "INTEGER" - }, - "description": "long description will be truncated in table" - } - }, - "run_local_at_count": { - "var": { - "type": { - "simple": "INTEGER" - }, - "description": "run_local_at_count" - }, - "default": { - "scalar": { - "primitive": { - "integer": "10" - } - } - } - } - } - }, - "createdAt": "1970-01-01T00:00:01Z" - } -}`) + tearDownAndVerify(t, `{"id": {"name": "launchplan1","version": "v2"},"spec": {"workflowId": {"name": "workflow2"},"defaultInputs": {"parameters": {"numbers": {"var": {"type": {"collectionType": {"simple": "INTEGER"}},"description": "short desc"}},"numbers_count": {"var": {"type": {"simple": "INTEGER"},"description": "long description will be truncated in table"}},"run_local_at_count": {"var": {"type": {"simple": "INTEGER"},"description": "run_local_at_count"},"default": {"scalar": {"primitive": {"integer": "10"}}}}}}},"closure": {"expectedInputs": {"parameters": {"numbers": {"var": {"type": {"collectionType": {"simple": "INTEGER"}},"description": "short desc"}},"numbers_count": {"var": {"type": {"simple": "INTEGER"},"description": "long description will be truncated in table"}},"run_local_at_count": {"var": {"type": {"simple": "INTEGER"},"description": "run_local_at_count"},"default": {"scalar": {"primitive": {"integer": "10"}}}}}},"createdAt": "1970-01-01T00:00:01Z"}}`) } func TestGetLaunchPlans(t *testing.T) { - setup() - getLaunchPlanSetup() - mockClient.OnListLaunchPlansMatch(ctx, resourceListRequest).Return(launchPlanListResponse, nil) - mockClient.OnGetLaunchPlanMatch(ctx, objectGetRequest).Return(launchPlan2, nil) - argsLp = []string{} - err = getLaunchPlanFunc(ctx, argsLp, cmdCtx) - assert.Nil(t, err) - tearDownAndVerify(t, `[{"id": {"name": "launchplan1","version": "v2"},"spec": {"defaultInputs": {"parameters": {"numbers": {"var": {"type": {"collectionType": {"simple": "INTEGER"}},"description": "short desc"}},"numbers_count": {"var": {"type": {"simple": "INTEGER"},"description": "long description will be truncated in table"}},"run_local_at_count": {"var": {"type": {"simple": "INTEGER"},"description": "run_local_at_count"},"default": {"scalar": {"primitive": {"integer": "10"}}}}}}},"closure": {"expectedInputs": {"parameters": {"numbers": {"var": {"type": {"collectionType": {"simple": "INTEGER"}},"description": "short desc"}},"numbers_count": {"var": {"type": {"simple": "INTEGER"},"description": "long description will be truncated in table"}},"run_local_at_count": {"var": {"type": {"simple": "INTEGER"},"description": "run_local_at_count"},"default": {"scalar": {"primitive": {"integer": "10"}}}}}},"createdAt": "1970-01-01T00:00:01Z"}},{"id": {"name": "launchplan1","version": "v1"},"spec": {"defaultInputs": {"parameters": {"numbers": {"var": {"type": {"collectionType": {"simple": "INTEGER"}},"description": "short desc"}},"numbers_count": {"var": {"type": {"simple": "INTEGER"},"description": "long description will be truncated in table"}},"run_local_at_count": {"var": {"type": {"simple": "INTEGER"},"description": "run_local_at_count"},"default": {"scalar": {"primitive": {"integer": "10"}}}}}}},"closure": {"expectedInputs": {"parameters": {"numbers": {"var": {"type": {"collectionType": {"simple": "INTEGER"}},"description": "short desc"}},"numbers_count": {"var": {"type": {"simple": "INTEGER"},"description": "long description will be truncated in table"}},"run_local_at_count": {"var": {"type": {"simple": "INTEGER"},"description": "run_local_at_count"},"default": {"scalar": {"primitive": {"integer": "10"}}}}}},"createdAt": "1970-01-01T00:00:00Z"}}]`) + t.Run("no workflow filter", func(t *testing.T) { + setup() + getLaunchPlanSetup() + mockClient.OnListLaunchPlansMatch(ctx, resourceListRequest).Return(launchPlanListResponse, nil) + argsLp = []string{} + err = getLaunchPlanFunc(ctx, argsLp, cmdCtx) + assert.Nil(t, err) + tearDownAndVerify(t, `[{"id": {"name": "launchplan1","version": "v2"},"spec": {"workflowId": {"name": "workflow2"},"defaultInputs": {"parameters": {"numbers": {"var": {"type": {"collectionType": {"simple": "INTEGER"}},"description": "short desc"}},"numbers_count": {"var": {"type": {"simple": "INTEGER"},"description": "long description will be truncated in table"}},"run_local_at_count": {"var": {"type": {"simple": "INTEGER"},"description": "run_local_at_count"},"default": {"scalar": {"primitive": {"integer": "10"}}}}}}},"closure": {"expectedInputs": {"parameters": {"numbers": {"var": {"type": {"collectionType": {"simple": "INTEGER"}},"description": "short desc"}},"numbers_count": {"var": {"type": {"simple": "INTEGER"},"description": "long description will be truncated in table"}},"run_local_at_count": {"var": {"type": {"simple": "INTEGER"},"description": "run_local_at_count"},"default": {"scalar": {"primitive": {"integer": "10"}}}}}},"createdAt": "1970-01-01T00:00:01Z"}},{"id": {"name": "launchplan1","version": "v1"},"spec": {"workflowId": {"name": "workflow1"},"defaultInputs": {"parameters": {"numbers": {"var": {"type": {"collectionType": {"simple": "INTEGER"}},"description": "short desc"}},"numbers_count": {"var": {"type": {"simple": "INTEGER"},"description": "long description will be truncated in table"}},"run_local_at_count": {"var": {"type": {"simple": "INTEGER"},"description": "run_local_at_count"},"default": {"scalar": {"primitive": {"integer": "10"}}}}}}},"closure": {"expectedInputs": {"parameters": {"numbers": {"var": {"type": {"collectionType": {"simple": "INTEGER"}},"description": "short desc"}},"numbers_count": {"var": {"type": {"simple": "INTEGER"},"description": "long description will be truncated in table"}},"run_local_at_count": {"var": {"type": {"simple": "INTEGER"},"description": "run_local_at_count"},"default": {"scalar": {"primitive": {"integer": "10"}}}}}},"createdAt": "1970-01-01T00:00:00Z"}}]`) + }) + t.Run("workflow filter", func(t *testing.T) { + setup() + getLaunchPlanSetup() + resourceListRequest.Filters = "eq(workflow.name,workflow2)" + mockClient.OnListLaunchPlansMatch(ctx, resourceListRequest).Return(filteredLaunchPlanListResponse, nil) + argsLp = []string{} + launchplan.DefaultConfig.Workflow = "workflow2" + err = getLaunchPlanFunc(ctx, argsLp, cmdCtx) + assert.Nil(t, err) + tearDownAndVerify(t, `{"id": {"name": "launchplan1","version": "v2"},"spec": {"workflowId": {"name": "workflow2"},"defaultInputs": {"parameters": {"numbers": {"var": {"type": {"collectionType": {"simple": "INTEGER"}},"description": "short desc"}},"numbers_count": {"var": {"type": {"simple": "INTEGER"},"description": "long description will be truncated in table"}},"run_local_at_count": {"var": {"type": {"simple": "INTEGER"},"description": "run_local_at_count"},"default": {"scalar": {"primitive": {"integer": "10"}}}}}}},"closure": {"expectedInputs": {"parameters": {"numbers": {"var": {"type": {"collectionType": {"simple": "INTEGER"}},"description": "short desc"}},"numbers_count": {"var": {"type": {"simple": "INTEGER"},"description": "long description will be truncated in table"}},"run_local_at_count": {"var": {"type": {"simple": "INTEGER"},"description": "run_local_at_count"},"default": {"scalar": {"primitive": {"integer": "10"}}}}}},"createdAt": "1970-01-01T00:00:01Z"}}`) + }) + t.Run("workflow filter error", func(t *testing.T) { + setup() + getLaunchPlanSetup() + argsLp = []string{} + launchplan.DefaultConfig.Workflow = "workflow2" + launchplan.DefaultConfig.Filter.FieldSelector = "workflow.name" + err = getLaunchPlanFunc(ctx, argsLp, cmdCtx) + assert.NotNil(t, err) + assert.Equal(t, fmt.Errorf("fieldSelector cannot be specified with workflow flag"), err) + }) } func TestGetLaunchPlansWithExecFile(t *testing.T) { @@ -640,91 +334,7 @@ func TestGetLaunchPlansWithExecFile(t *testing.T) { os.Remove(launchplan.DefaultConfig.ExecFile) assert.Nil(t, err) mockClient.AssertCalled(t, "GetLaunchPlan", ctx, objectGetRequest) - tearDownAndVerify(t, `{ - "id": { - "name": "launchplan1", - "version": "v2" - }, - "spec": { - "defaultInputs": { - "parameters": { - "numbers": { - "var": { - "type": { - "collectionType": { - "simple": "INTEGER" - } - }, - "description": "short desc" - } - }, - "numbers_count": { - "var": { - "type": { - "simple": "INTEGER" - }, - "description": "long description will be truncated in table" - } - }, - "run_local_at_count": { - "var": { - "type": { - "simple": "INTEGER" - }, - "description": "run_local_at_count" - }, - "default": { - "scalar": { - "primitive": { - "integer": "10" - } - } - } - } - } - } - }, - "closure": { - "expectedInputs": { - "parameters": { - "numbers": { - "var": { - "type": { - "collectionType": { - "simple": "INTEGER" - } - }, - "description": "short desc" - } - }, - "numbers_count": { - "var": { - "type": { - "simple": "INTEGER" - }, - "description": "long description will be truncated in table" - } - }, - "run_local_at_count": { - "var": { - "type": { - "simple": "INTEGER" - }, - "description": "run_local_at_count" - }, - "default": { - "scalar": { - "primitive": { - "integer": "10" - } - } - } - } - } - }, - "createdAt": "1970-01-01T00:00:01Z" - } -}`) + tearDownAndVerify(t, `{"id": {"name": "launchplan1","version": "v2"},"spec": {"workflowId": {"name": "workflow2"},"defaultInputs": {"parameters": {"numbers": {"var": {"type": {"collectionType": {"simple": "INTEGER"}},"description": "short desc"}},"numbers_count": {"var": {"type": {"simple": "INTEGER"},"description": "long description will be truncated in table"}},"run_local_at_count": {"var": {"type": {"simple": "INTEGER"},"description": "run_local_at_count"},"default": {"scalar": {"primitive": {"integer": "10"}}}}}}},"closure": {"expectedInputs": {"parameters": {"numbers": {"var": {"type": {"collectionType": {"simple": "INTEGER"}},"description": "short desc"}},"numbers_count": {"var": {"type": {"simple": "INTEGER"},"description": "long description will be truncated in table"}},"run_local_at_count": {"var": {"type": {"simple": "INTEGER"},"description": "run_local_at_count"},"default": {"scalar": {"primitive": {"integer": "10"}}}}}},"createdAt": "1970-01-01T00:00:01Z"}}`) } func TestGetLaunchPlanTableFunc(t *testing.T) {