2024-12-13 14:38:58 +00:00
|
|
|
package bundle_test
|
2024-11-20 12:20:39 +00:00
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"testing"
|
|
|
|
|
2024-12-17 07:45:58 +00:00
|
|
|
"github.com/databricks/cli/integration/internal/acc"
|
2024-12-12 21:28:04 +00:00
|
|
|
"github.com/databricks/cli/internal/testutil"
|
2024-11-20 12:20:39 +00:00
|
|
|
"github.com/google/uuid"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
|
|
)
|
|
|
|
|
2024-12-13 14:47:50 +00:00
|
|
|
func TestDeployBasicToSharedWorkspacePath(t *testing.T) {
|
2024-11-20 12:20:39 +00:00
|
|
|
ctx, wt := acc.WorkspaceTest(t)
|
|
|
|
|
2024-12-12 21:28:04 +00:00
|
|
|
nodeTypeId := testutil.GetCloud(t).NodeTypeID()
|
2024-11-20 12:20:39 +00:00
|
|
|
uniqueId := uuid.New().String()
|
|
|
|
|
|
|
|
currentUser, err := wt.W.CurrentUser.Me(ctx)
|
|
|
|
require.NoError(t, err)
|
|
|
|
|
2024-12-16 12:41:32 +00:00
|
|
|
bundleRoot := initTestTemplate(t, ctx, "basic", map[string]any{
|
2024-11-20 12:20:39 +00:00
|
|
|
"unique_id": uniqueId,
|
|
|
|
"node_type_id": nodeTypeId,
|
|
|
|
"spark_version": defaultSparkVersion,
|
|
|
|
"root_path": fmt.Sprintf("/Shared/%s", currentUser.UserName),
|
|
|
|
})
|
|
|
|
|
|
|
|
t.Cleanup(func() {
|
2024-12-16 12:41:32 +00:00
|
|
|
destroyBundle(wt, ctx, bundleRoot)
|
2024-11-20 12:20:39 +00:00
|
|
|
})
|
|
|
|
|
2024-12-16 12:41:32 +00:00
|
|
|
deployBundle(wt, ctx, bundleRoot)
|
2024-11-20 12:20:39 +00:00
|
|
|
}
|