Repository navigation
testserver: match Unity Catalog on renames, forced deletes and taken names #7408
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
5 changes: 0 additions & 5 deletions
5
acceptance/bundle/migrate/auto/registered-model-catalog-change/output.txt
This file contains hidden or 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
6 changes: 3 additions & 3 deletions
6
acceptance/bundle/migrate/auto/registered-model-catalog-change/script
This file contains hidden or 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
5 changes: 0 additions & 5 deletions
5
acceptance/bundle/migrate/auto/schema-catalog-change/output.txt
This file contains hidden or 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 hidden or 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 hidden or 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 @@ | ||
| Cloud = true |
This file contains hidden or 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,104 @@ | ||
|
|
||
| === Create a catalog with a schema, and a volume, a registered model and a secret in it | ||
| >>> [CLI] catalogs create test_catalog_[UNIQUE_NAME] | ||
| { | ||
| "name": "test_catalog_[UNIQUE_NAME]" | ||
| } | ||
|
|
||
| >>> [CLI] schemas create myschema test_catalog_[UNIQUE_NAME] | ||
| { | ||
| "full_name": "test_catalog_[UNIQUE_NAME].myschema" | ||
| } | ||
|
|
||
| >>> [CLI] volumes create test_catalog_[UNIQUE_NAME] myschema myvolume MANAGED | ||
| { | ||
| "full_name": "test_catalog_[UNIQUE_NAME].myschema.myvolume" | ||
| } | ||
|
|
||
| >>> [CLI] registered-models create --catalog-name test_catalog_[UNIQUE_NAME] --schema-name myschema --name mymodel | ||
| { | ||
| "full_name": "test_catalog_[UNIQUE_NAME].myschema.mymodel" | ||
| } | ||
|
|
||
| >>> [CLI] secrets-uc create-secret mysecret test_catalog_[UNIQUE_NAME] myschema value | ||
| { | ||
| "full_name": "test_catalog_[UNIQUE_NAME].myschema.mysecret" | ||
| } | ||
|
|
||
| === Creating a catalog under a taken name fails | ||
| >>> musterr [CLI] catalogs create test_catalog_[UNIQUE_NAME] | ||
| Error: Catalog 'test_catalog_[UNIQUE_NAME]' already exists | ||
|
|
||
| === Renaming the volume lowercases the new name | ||
| >>> [CLI] volumes update test_catalog_[UNIQUE_NAME].myschema.myvolume --new-name MyVolume2 | ||
| { | ||
| "full_name": "test_catalog_[UNIQUE_NAME].myschema.myvolume2", | ||
| "name": "myvolume2" | ||
| } | ||
|
|
||
| === Renaming the model keeps its full name in sync | ||
| >>> [CLI] registered-models update test_catalog_[UNIQUE_NAME].myschema.mymodel --new-name mymodel2 | ||
| { | ||
| "full_name": "test_catalog_[UNIQUE_NAME].myschema.mymodel2", | ||
| "name": "mymodel2" | ||
| } | ||
|
|
||
| === Renaming the schema moves the volume, the model and the secret with it | ||
| >>> [CLI] schemas update test_catalog_[UNIQUE_NAME].myschema --new-name myschema2 | ||
| { | ||
| "full_name": "test_catalog_[UNIQUE_NAME].myschema2" | ||
| } | ||
|
|
||
| >>> [CLI] volumes read test_catalog_[UNIQUE_NAME].myschema2.myvolume2 | ||
| { | ||
| "full_name": "test_catalog_[UNIQUE_NAME].myschema2.myvolume2" | ||
| } | ||
|
|
||
| >>> [CLI] registered-models get test_catalog_[UNIQUE_NAME].myschema2.mymodel2 | ||
| { | ||
| "full_name": "test_catalog_[UNIQUE_NAME].myschema2.mymodel2" | ||
| } | ||
|
|
||
| >>> [CLI] secrets-uc get-secret test_catalog_[UNIQUE_NAME].myschema2.mysecret | ||
| { | ||
| "full_name": "test_catalog_[UNIQUE_NAME].myschema2.mysecret" | ||
| } | ||
|
|
||
| === Renaming the catalog moves everything in it | ||
| >>> [CLI] catalogs update test_catalog_[UNIQUE_NAME] --new-name test_catalog_renamed_[UNIQUE_NAME] | ||
| { | ||
| "name": "test_catalog_renamed_[UNIQUE_NAME]" | ||
| } | ||
|
|
||
| >>> [CLI] schemas get test_catalog_renamed_[UNIQUE_NAME].myschema2 | ||
| { | ||
| "full_name": "test_catalog_renamed_[UNIQUE_NAME].myschema2" | ||
| } | ||
|
|
||
| >>> [CLI] volumes read test_catalog_renamed_[UNIQUE_NAME].myschema2.myvolume2 | ||
| { | ||
| "full_name": "test_catalog_renamed_[UNIQUE_NAME].myschema2.myvolume2" | ||
| } | ||
|
|
||
| >>> [CLI] registered-models get test_catalog_renamed_[UNIQUE_NAME].myschema2.mymodel2 | ||
| { | ||
| "full_name": "test_catalog_renamed_[UNIQUE_NAME].myschema2.mymodel2" | ||
| } | ||
|
|
||
| >>> [CLI] secrets-uc get-secret test_catalog_renamed_[UNIQUE_NAME].myschema2.mysecret | ||
| { | ||
| "full_name": "test_catalog_renamed_[UNIQUE_NAME].myschema2.mysecret" | ||
| } | ||
|
|
||
| === Deleting the schema with force deletes everything in it | ||
| volume: gone | ||
| model: gone | ||
| secret: gone | ||
|
|
||
| === Deleting the catalog with force deletes its schemas | ||
|
|
||
| >>> [CLI] schemas create other test_catalog_renamed_[UNIQUE_NAME] | ||
| { | ||
| "full_name": "test_catalog_renamed_[UNIQUE_NAME].other" | ||
| } | ||
| schema: gone |
This file contains hidden or 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,54 @@ | ||
| CATALOG="test_catalog_${UNIQUE_NAME}" | ||
| RENAMED="test_catalog_renamed_${UNIQUE_NAME}" | ||
|
|
||
| cleanup() { | ||
| # Whichever name the catalog ended up with. | ||
| errcode $CLI catalogs delete "$CATALOG" --force &> LOG.cleanup | ||
| errcode $CLI catalogs delete "$RENAMED" --force >> LOG.cleanup 2>&1 | ||
| } | ||
| trap cleanup EXIT | ||
|
|
||
| exists() { | ||
| "$@" &> /dev/null && echo "exists" || echo "gone" | ||
| } | ||
|
|
||
| title "Create a catalog with a schema, and a volume, a registered model and a secret in it" | ||
| trace $CLI catalogs create "$CATALOG" | jq '{name}' | ||
| trace $CLI schemas create myschema "$CATALOG" | jq '{full_name}' | ||
| trace $CLI volumes create "$CATALOG" myschema myvolume MANAGED | jq '{full_name}' | ||
| trace $CLI registered-models create --catalog-name "$CATALOG" --schema-name myschema --name mymodel | jq '{full_name}' | ||
| trace $CLI secrets-uc create-secret mysecret "$CATALOG" myschema value | jq '{full_name}' | ||
|
|
||
| title "Creating a catalog under a taken name fails" | ||
| trace musterr $CLI catalogs create "$CATALOG" | ||
|
|
||
| title "Renaming the volume lowercases the new name" | ||
| trace $CLI volumes update "$CATALOG.myschema.myvolume" --new-name MyVolume2 | jq '{full_name, name}' | ||
|
|
||
| title "Renaming the model keeps its full name in sync" | ||
| trace $CLI registered-models update "$CATALOG.myschema.mymodel" --new-name mymodel2 | jq '{full_name, name}' | ||
|
|
||
| title "Renaming the schema moves the volume, the model and the secret with it" | ||
| trace $CLI schemas update "$CATALOG.myschema" --new-name myschema2 | jq '{full_name}' | ||
| trace $CLI volumes read "$CATALOG.myschema2.myvolume2" | jq '{full_name}' | ||
| trace $CLI registered-models get "$CATALOG.myschema2.mymodel2" | jq '{full_name}' | ||
| trace $CLI secrets-uc get-secret "$CATALOG.myschema2.mysecret" | jq '{full_name}' | ||
|
|
||
| title "Renaming the catalog moves everything in it" | ||
| trace $CLI catalogs update "$CATALOG" --new-name "$RENAMED" | jq '{name}' | ||
| trace $CLI schemas get "$RENAMED.myschema2" | jq '{full_name}' | ||
| trace $CLI volumes read "$RENAMED.myschema2.myvolume2" | jq '{full_name}' | ||
| trace $CLI registered-models get "$RENAMED.myschema2.mymodel2" | jq '{full_name}' | ||
| trace $CLI secrets-uc get-secret "$RENAMED.myschema2.mysecret" | jq '{full_name}' | ||
|
|
||
| title "Deleting the schema with force deletes everything in it\n" | ||
| # Not traced: the "not found" messages differ between UC and the test server. | ||
| $CLI schemas delete "$RENAMED.myschema2" --force | ||
| echo "volume: $(exists $CLI volumes read "$RENAMED.myschema2.myvolume2")" | ||
| echo "model: $(exists $CLI registered-models get "$RENAMED.myschema2.mymodel2")" | ||
| echo "secret: $(exists $CLI secrets-uc get-secret "$RENAMED.myschema2.mysecret")" | ||
|
|
||
| title "Deleting the catalog with force deletes its schemas\n" | ||
| trace $CLI schemas create other "$RENAMED" | jq '{full_name}' | ||
| $CLI catalogs delete "$RENAMED" --force | ||
| echo "schema: $(exists $CLI schemas get "$RENAMED.other")" |
This file contains hidden or 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,2 @@ | ||
| # Checks the test server's Unity Catalog renames and deletes against a real workspace. | ||
| Cloud = true |
This file contains hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why remove this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's a duplicate, we create this catalog in terraform-requests fixture.