-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added integration test to deploy bundle to /Shared root path (#1914)
## Changes Added integration test to deploy bundle to /Shared root path ## Tests ``` --- PASS: TestAccDeployBasicToSharedWorkspace (24.58s) PASS coverage: 31.2% of statements in ./... ok github.com/databricks/cli/internal/bundle 25.572s coverage: 31.2% of statements in ./... ``` --------- Co-authored-by: shreyas-goenka <[email protected]>
- Loading branch information
1 parent
756e55f
commit fab3e8f
Showing
3 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package bundle | ||
|
||
import ( | ||
"fmt" | ||
"testing" | ||
|
||
"github.com/databricks/cli/internal" | ||
"github.com/databricks/cli/internal/acc" | ||
"github.com/databricks/cli/libs/env" | ||
"github.com/google/uuid" | ||
"github.com/stretchr/testify/require" | ||
) | ||
|
||
func TestAccDeployBasicToSharedWorkspacePath(t *testing.T) { | ||
ctx, wt := acc.WorkspaceTest(t) | ||
|
||
nodeTypeId := internal.GetNodeTypeId(env.Get(ctx, "CLOUD_ENV")) | ||
uniqueId := uuid.New().String() | ||
|
||
currentUser, err := wt.W.CurrentUser.Me(ctx) | ||
require.NoError(t, err) | ||
|
||
bundleRoot, err := initTestTemplate(t, ctx, "basic", map[string]any{ | ||
"unique_id": uniqueId, | ||
"node_type_id": nodeTypeId, | ||
"spark_version": defaultSparkVersion, | ||
"root_path": fmt.Sprintf("/Shared/%s", currentUser.UserName), | ||
}) | ||
require.NoError(t, err) | ||
|
||
t.Cleanup(func() { | ||
err = destroyBundle(wt.T, ctx, bundleRoot) | ||
require.NoError(wt.T, err) | ||
}) | ||
|
||
err = deployBundle(wt.T, ctx, bundleRoot) | ||
require.NoError(wt.T, err) | ||
} |