Skip to content

Commit

Permalink
wip, I'm missing the deps-v2-cnab-representation changes
Browse files Browse the repository at this point in the history
Signed-off-by: Carolyn Van Slyck <me@carolynvanslyck.com>
  • Loading branch information
carolynvs committed Oct 25, 2022
1 parent 03d23e4 commit b4234e9
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
2 changes: 2 additions & 0 deletions pkg/cnab/config-adapter/testdata/porter-depsv2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ dependencies:
- name: mysql
bundle:
reference: "getporter/azure-mysql:5.7"
parameters:
database: wordpress

mixins:
- exec
Expand Down
10 changes: 10 additions & 0 deletions pkg/cnab/config-adapter/testdata/porter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion tests/integration/workflow_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b4234e9

Please sign in to comment.