From b4234e9776faf026b008432113295ac1b8c4f0ac Mon Sep 17 00:00:00 2001 From: Carolyn Van Slyck Date: Tue, 25 Oct 2022 09:59:40 -0500 Subject: [PATCH] wip, I'm missing the deps-v2-cnab-representation changes Signed-off-by: Carolyn Van Slyck --- pkg/cnab/config-adapter/testdata/porter-depsv2.yaml | 2 ++ pkg/cnab/config-adapter/testdata/porter.yaml | 10 ++++++++++ tests/integration/workflow_test.go | 5 ++++- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/pkg/cnab/config-adapter/testdata/porter-depsv2.yaml b/pkg/cnab/config-adapter/testdata/porter-depsv2.yaml index f9a5dce638..18fe238296 100644 --- a/pkg/cnab/config-adapter/testdata/porter-depsv2.yaml +++ b/pkg/cnab/config-adapter/testdata/porter-depsv2.yaml @@ -19,6 +19,8 @@ dependencies: - name: mysql bundle: reference: "getporter/azure-mysql:5.7" + parameters: + database: wordpress mixins: - exec diff --git a/pkg/cnab/config-adapter/testdata/porter.yaml b/pkg/cnab/config-adapter/testdata/porter.yaml index f9a5dce638..cecee0ab22 100644 --- a/pkg/cnab/config-adapter/testdata/porter.yaml +++ b/pkg/cnab/config-adapter/testdata/porter.yaml @@ -14,11 +14,21 @@ credentials: applyTo: - uninstall +parameters: + - name: db_collation + type: string + default: Latin1_General_CI_AI + dependencies: requires: - name: mysql bundle: reference: "getporter/azure-mysql:5.7" + parameters: + database: wordpress + collation: ${bundle.parameters.db_collation} + credentials: + user: ${bundle.credentials.username} mixins: - exec diff --git a/tests/integration/workflow_test.go b/tests/integration/workflow_test.go index a9e250e6a3..b3634183f1 100644 --- a/tests/integration/workflow_test.go +++ b/tests/integration/workflow_test.go @@ -30,10 +30,13 @@ func TestWorkflow(t *testing.T) { fmt.Println(output) // TODO A workflow should be persisted, and it should match the execution plan generated first with --dry-run + // We don't expose workflow commands yet though so the only way to test this is call the db directly // We should have 2 installations, mybuns and mydb test.RequireInstallationExists(test.CurrentNamespace(), "mybuns") - test.RequireInstallationExists(test.CurrentNamespace(), "mybuns/db") + mydb := test.RequireInstallationExists(test.CurrentNamespace(), "mybuns/db") + require.Contains(t, mydb.Parameters, "database", "mybuns should have explicitly set the database parameter on its db dependency") + require.Equal(t, "bigdb", mydb.Parameters["database"], "incorrect value used for the database parameter on the db dependency, expected the hard coded value specified by the root bundle") // TODO mydb should have a parameter that was set by the workflow, e.g. the db name // TODO mybuns should have used an output from mydb that we saved as a root bundle output so that we can validate that it was used properly