Skip to content

Commit d8ac9ef

Browse files
authored
Remove TestBindSchemaToExistingSchema integration test (#3073)
## Why <!-- Why are these changes needed? Provide the context that the reviewer might be missing. For example, were there any decisions behind the change that are not reflected in the code itself? --> TestBindSchemaToExistingSchema is equivalent to an existing acceptance test in acceptance/bundle/deployment/bind/schema introduced in #2441 <!-- If your PR needs to be included in the release notes for next release, add a separate entry in NEXT_CHANGELOG.md as part of your PR. -->
1 parent e21d5db commit d8ac9ef

File tree

3 files changed

+0
-74
lines changed

3 files changed

+0
-74
lines changed

integration/bundle/bind_resource_test.go

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -15,62 +15,8 @@ import (
1515
"github.com/google/uuid"
1616
"github.com/stretchr/testify/assert"
1717
"github.com/stretchr/testify/require"
18-
19-
"github.com/databricks/databricks-sdk-go/service/catalog"
2018
)
2119

22-
func TestBindSchemaToExistingSchema(t *testing.T) {
23-
ctx, wt := acc.UcWorkspaceTest(t)
24-
25-
// create a pre-defined schema:
26-
uniqueId := uuid.New().String()
27-
predefinedSchema, err := wt.W.Schemas.Create(ctx, catalog.CreateSchema{
28-
CatalogName: "main",
29-
Name: "test-schema-" + uniqueId,
30-
})
31-
require.NoError(t, err)
32-
t.Cleanup(func() {
33-
err := wt.W.Schemas.DeleteByFullName(ctx, predefinedSchema.FullName)
34-
require.NoError(t, err)
35-
})
36-
37-
// setup the bundle:
38-
bundleRoot := initTestTemplate(t, ctx, "uc_schema_only", map[string]any{
39-
"unique_id": uniqueId,
40-
})
41-
ctx = env.Set(ctx, "BUNDLE_ROOT", bundleRoot)
42-
43-
// run the bind command:
44-
c := testcli.NewRunner(t, ctx, "bundle", "deployment", "bind", "schema1", predefinedSchema.FullName, "--auto-approve")
45-
_, _, err = c.Run()
46-
require.NoError(t, err)
47-
48-
// deploy the bundle:
49-
deployBundle(t, ctx, bundleRoot)
50-
51-
// Check that predefinedSchema is updated with config from bundle
52-
w, err := databricks.NewWorkspaceClient()
53-
require.NoError(t, err)
54-
55-
updatedSchema, err := w.Schemas.GetByFullName(ctx, predefinedSchema.FullName)
56-
require.NoError(t, err)
57-
require.Equal(t, updatedSchema.SchemaId, predefinedSchema.SchemaId)
58-
require.Equal(t, "This schema was created from DABs", updatedSchema.Comment)
59-
60-
// unbind the schema:
61-
c = testcli.NewRunner(t, ctx, "bundle", "deployment", "unbind", "schema1")
62-
_, _, err = c.Run()
63-
require.NoError(t, err)
64-
65-
// destroy the bundle:
66-
destroyBundle(t, ctx, bundleRoot)
67-
68-
// Check that schema is unbound and exists after bundle is destroyed
69-
postDestroySchema, err := w.Schemas.GetByFullName(ctx, predefinedSchema.FullName)
70-
require.NoError(t, err)
71-
require.Equal(t, postDestroySchema.SchemaId, predefinedSchema.SchemaId)
72-
}
73-
7420
func TestAbortBind(t *testing.T) {
7521
ctx, wt := acc.WorkspaceTest(t)
7622
gt := &generateJobTest{T: wt, w: wt.W}

integration/bundle/bundles/uc_schema_only/databricks_template_schema.json

Lines changed: 0 additions & 8 deletions
This file was deleted.

integration/bundle/bundles/uc_schema_only/template/databricks.yml.tmpl

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)