mirror of https://github.com/databricks/cli.git
Fixed an apps message order and added output test (#2174)
## Changes Fixed an apps message order and added output test
This commit is contained in:
parent
560c3d352e
commit
0c088d4050
|
@ -130,13 +130,13 @@ func Deploy(outputHandler sync.OutputHandler) bundle.Mutator {
|
||||||
// mutators need informed consent if they are potentially destructive.
|
// mutators need informed consent if they are potentially destructive.
|
||||||
deployCore := bundle.Defer(
|
deployCore := bundle.Defer(
|
||||||
bundle.Seq(
|
bundle.Seq(
|
||||||
|
apps.SlowDeployMessage(),
|
||||||
bundle.LogString("Deploying resources..."),
|
bundle.LogString("Deploying resources..."),
|
||||||
terraform.Apply(),
|
terraform.Apply(),
|
||||||
),
|
),
|
||||||
bundle.Seq(
|
bundle.Seq(
|
||||||
terraform.StatePush(),
|
terraform.StatePush(),
|
||||||
terraform.Load(),
|
terraform.Load(),
|
||||||
apps.SlowDeployMessage(),
|
|
||||||
apps.InterpolateVariables(),
|
apps.InterpolateVariables(),
|
||||||
apps.UploadConfig(),
|
apps.UploadConfig(),
|
||||||
metadata.Compute(),
|
metadata.Compute(),
|
||||||
|
|
|
@ -6,8 +6,10 @@ import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/databricks/cli/integration/internal/acc"
|
"github.com/databricks/cli/integration/internal/acc"
|
||||||
|
"github.com/databricks/cli/internal/testcli"
|
||||||
"github.com/databricks/cli/internal/testutil"
|
"github.com/databricks/cli/internal/testutil"
|
||||||
"github.com/databricks/cli/libs/env"
|
"github.com/databricks/cli/libs/env"
|
||||||
|
"github.com/databricks/cli/libs/testdiff"
|
||||||
"github.com/databricks/databricks-sdk-go/service/apps"
|
"github.com/databricks/databricks-sdk-go/service/apps"
|
||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
|
@ -49,7 +51,31 @@ func TestDeployBundleWithApp(t *testing.T) {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
deployBundle(t, ctx, root)
|
ctx, replacements := testdiff.WithReplacementsMap(ctx)
|
||||||
|
replacements.Set(uniqueId, "$UNIQUE_PRJ")
|
||||||
|
|
||||||
|
user, err := wt.W.CurrentUser.Me(ctx)
|
||||||
|
require.NoError(t, err)
|
||||||
|
require.NotNil(t, user)
|
||||||
|
testdiff.PrepareReplacementsUser(t, replacements, *user)
|
||||||
|
testdiff.PrepareReplacementsWorkspaceClient(t, replacements, wt.W)
|
||||||
|
testdiff.PrepareReplacementsUUID(t, replacements)
|
||||||
|
testdiff.PrepareReplacementsNumber(t, replacements)
|
||||||
|
testdiff.PrepareReplacementsTemporaryDirectory(t, replacements)
|
||||||
|
|
||||||
|
testutil.Chdir(t, root)
|
||||||
|
testcli.AssertOutput(
|
||||||
|
t,
|
||||||
|
ctx,
|
||||||
|
[]string{"bundle", "validate"},
|
||||||
|
testutil.TestData("testdata/apps/bundle_validate.txt"),
|
||||||
|
)
|
||||||
|
testcli.AssertOutput(
|
||||||
|
t,
|
||||||
|
ctx,
|
||||||
|
[]string{"bundle", "deploy", "--force-lock", "--auto-approve"},
|
||||||
|
testutil.TestData("testdata/apps/bundle_deploy.txt"),
|
||||||
|
)
|
||||||
|
|
||||||
// App should exists after bundle deployment
|
// App should exists after bundle deployment
|
||||||
app, err := wt.W.Apps.Get(ctx, apps.GetAppRequest{Name: appId})
|
app, err := wt.W.Apps.Get(ctx, apps.GetAppRequest{Name: appId})
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
Uploading bundle files to /Workspace/Users/$USERNAME/.bundle/$UNIQUE_PRJ/files...
|
||||||
|
Note: Databricks apps included in this bundle may increase initial deployment time due to compute provisioning.
|
||||||
|
Deploying resources...
|
||||||
|
Updating deployment state...
|
||||||
|
Deployment complete!
|
|
@ -0,0 +1,7 @@
|
||||||
|
Name: basic
|
||||||
|
Target: default
|
||||||
|
Workspace:
|
||||||
|
User: $USERNAME
|
||||||
|
Path: /Workspace/Users/$USERNAME/.bundle/$UNIQUE_PRJ
|
||||||
|
|
||||||
|
Validation OK!
|
Loading…
Reference in New Issue