Skip to content

Commit

Permalink
ADOnt work
Browse files Browse the repository at this point in the history
Signed-off-by: schristoff <[email protected]>
  • Loading branch information
schristoff committed Dec 5, 2023
1 parent 1025c60 commit 7e6908a
Showing 1 changed file with 8 additions and 15 deletions.
23 changes: 8 additions & 15 deletions tests/integration/dependenciesv2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,14 @@ func TestSharedDependencies(t *testing.T) {

p := porter.NewTestPorter(t)
ctx := p.SetupIntegrationTest()
bunDir := setupFS(ctx, p)
defer os.RemoveAll(bunDir)

p.Config.SetExperimentalFlags(experimental.FlagDependenciesV2)

namespace := p.RandomString(10)
setupMysql(ctx, p, namespace, bunDir)

bunDir, err := os.MkdirTemp("", "porter-mysql-")
require.NoError(p.T(), err, "could not create temp directory at all")
defer os.RemoveAll(bunDir)

setupWordpress_v2(ctx, p, namespace, bunDir)
upgradeWordpressBundle_v2(ctx, p, namespace)
Expand All @@ -36,15 +38,6 @@ func TestSharedDependencies(t *testing.T) {

}

func setupFS(ctx context.Context, p *porter.TestPorter) string {
bunDir, err := os.MkdirTemp("", "porter-mysql-")
require.NoError(p.T(), err, "could not create temp directory at all")

p.TestConfig.TestContext.AddTestDirectory(filepath.Join(p.RepoRoot, "build/testdata/bundles/wordpressv2"), bunDir+"/wordpress")

return bunDir
}

func setupMysql(ctx context.Context, p *porter.TestPorter, namespace string, bunDir string) {
p.TestConfig.TestContext.AddTestDirectory(filepath.Join(p.RepoRoot, "build/testdata/bundles/mysql"), bunDir+"/mysql")

Expand Down Expand Up @@ -79,8 +72,8 @@ func setupMysql(ctx context.Context, p *porter.TestPorter, namespace string, bun
}

func setupWordpress_v2(ctx context.Context, p *porter.TestPorter, namespace string, bunDir string) {

p.Chdir(bunDir + "/wordpress")
setupMysql(ctx, p, namespace, bunDir)
p.CopyDirectory(filepath.Join(p.RepoRoot, "build/testdata/bundles/wordpressv2"), ".", false)

publishOpts := porter.PublishOptions{}
publishOpts.Force = true
Expand All @@ -105,7 +98,7 @@ func setupWordpress_v2(ctx context.Context, p *porter.TestPorter, namespace stri
require.NoError(p.T(), err, "install of root bundle failed namespace %s", namespace)

numInst, err := p.Installations.ListInstallations(ctx, storage.ListOptions{Namespace: namespace})
assert.Equal(p.T(), len(numInst), 2)
assert.Equal(p.T(), 2, len(numInst))

i, err := p.Installations.GetInstallation(ctx, namespace, "mysql")
require.NoError(p.T(), err, "could not fetch installation status for the dependency")
Expand Down

0 comments on commit 7e6908a

Please sign in to comment.