mirror of https://github.com/databricks/cli.git
Added integration test to deploy bundle to /Shared root path
This commit is contained in:
parent
72dde793d8
commit
c934cd66bd
|
@ -11,6 +11,10 @@
|
|||
"node_type_id": {
|
||||
"type": "string",
|
||||
"description": "Node type id for job cluster"
|
||||
},
|
||||
"root_path": {
|
||||
"type": "string",
|
||||
"description": "Root path to deploy bundle to"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,11 @@ bundle:
|
|||
name: basic
|
||||
|
||||
workspace:
|
||||
{{ if .root_path }}
|
||||
root_path: "{{.root_path}}/.bundle/{{.unique_id}}"
|
||||
{{ else }}
|
||||
root_path: "~/.bundle/{{.unique_id}}"
|
||||
{{ end }}
|
||||
|
||||
resources:
|
||||
jobs:
|
||||
|
|
|
@ -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 TestAccDeployBasicToSharedWorkspace(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)
|
||||
}
|
Loading…
Reference in New Issue