-
Notifications
You must be signed in to change notification settings - Fork 177
Reproduce #1976 as acceptance test #5455
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
Open
janniklasrose
wants to merge
1
commit into
main
Choose a base branch
from
janniklasrose/issue-1976
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
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
15 changes: 15 additions & 0 deletions
15
acceptance/bundle/deploy/files/out-of-band-delete/databricks.yml
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,15 @@ | ||
| bundle: | ||
| name: out-of-band-delete | ||
|
|
||
| resources: | ||
| jobs: | ||
| foo: | ||
| name: test-job | ||
| tasks: | ||
| - task_key: my_task | ||
| spark_python_task: | ||
| python_file: ./hello_world.py | ||
| new_cluster: | ||
| num_workers: 1 | ||
| spark_version: 13.3.x-snapshot-scala2.12 | ||
| node_type_id: i3.xlarge |
1 change: 1 addition & 0 deletions
1
acceptance/bundle/deploy/files/out-of-band-delete/hello_world.py
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 @@ | ||
| print("Hello World!") |
3 changes: 3 additions & 0 deletions
3
acceptance/bundle/deploy/files/out-of-band-delete/out.test.toml
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
47 changes: 47 additions & 0 deletions
47
acceptance/bundle/deploy/files/out-of-band-delete/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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
|
|
||
| >>> [CLI] bundle deploy | ||
| Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/out-of-band-delete/default/files... | ||
| Deploying resources... | ||
| Updating deployment state... | ||
| Deployment complete! | ||
|
|
||
| === After the initial deploy the job's python_file and the deployment state exist | ||
| >>> [CLI] workspace get-status /Workspace/Users/[USERNAME]/.bundle/out-of-band-delete/default/files/hello_world.py | ||
| { | ||
| "object_type": "FILE", | ||
| "path": "/Workspace/Users/[USERNAME]/.bundle/out-of-band-delete/default/files/hello_world.py" | ||
| } | ||
|
|
||
| >>> [CLI] workspace get-status /Workspace/Users/[USERNAME]/.bundle/out-of-band-delete/default/state/deployment.json | ||
| { | ||
| "object_type": "FILE", | ||
| "path": "/Workspace/Users/[USERNAME]/.bundle/out-of-band-delete/default/state/deployment.json" | ||
| } | ||
|
|
||
| === Delete the remote bundle directory out-of-band (simulates deleting it in the UI) | ||
| >>> [CLI] workspace delete --recursive /Workspace/Users/[USERNAME]/.bundle/out-of-band-delete | ||
|
|
||
| === Redeploy without changing any local file, so the stale sync snapshot is reused | ||
| >>> [CLI] bundle deploy | ||
| Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/out-of-band-delete/default/files... | ||
| Deploying resources... | ||
| Updating deployment state... | ||
| Deployment complete! | ||
|
|
||
| === After redeploy: the files dir and state are recreated, but the python_file is NOT re-uploaded | ||
| >>> errcode [CLI] workspace get-status /Workspace/Users/[USERNAME]/.bundle/out-of-band-delete/default/files/hello_world.py | ||
| Error: Workspace path not found | ||
|
|
||
| Exit code: 1 | ||
|
|
||
| >>> [CLI] workspace get-status /Workspace/Users/[USERNAME]/.bundle/out-of-band-delete/default/files | ||
| { | ||
| "object_type": "DIRECTORY", | ||
| "path": "/Workspace/Users/[USERNAME]/.bundle/out-of-band-delete/default/files" | ||
| } | ||
|
|
||
| >>> [CLI] workspace get-status /Workspace/Users/[USERNAME]/.bundle/out-of-band-delete/default/state/deployment.json | ||
| { | ||
| "object_type": "FILE", | ||
| "path": "/Workspace/Users/[USERNAME]/.bundle/out-of-band-delete/default/state/deployment.json" | ||
| } |
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,31 @@ | ||
| # Redeploy after the remote bundle directory is deleted out-of-band (e.g. a user | ||
| # deletes it in the workspace UI). | ||
| # | ||
| # After such a deletion the next "bundle deploy" does not re-upload the bundle files: | ||
| # the local sync snapshot still records them as present remotely, and the remote | ||
| # deployment state that would otherwise reset the snapshot was deleted too, so the | ||
| # file sync computes an empty diff and uploads nothing. | ||
| # | ||
| # This test pins down the current behaviour: hello_world.py is missing from the | ||
| # workspace after the redeploy even though the deploy reports success. If the file | ||
| # sync is changed to re-upload in this case, the final get-status will succeed and | ||
| # this output is expected to change. | ||
|
|
||
| BUNDLE_PATH="/Workspace/Users/${CURRENT_USER_NAME}/.bundle/out-of-band-delete/default" | ||
|
|
||
| trace $CLI bundle deploy | ||
|
|
||
| title "After the initial deploy the job's python_file and the deployment state exist" | ||
| trace $CLI workspace get-status "$BUNDLE_PATH/files/hello_world.py" | jq '{object_type,path}' | ||
| trace $CLI workspace get-status "$BUNDLE_PATH/state/deployment.json" | jq '{object_type,path}' | ||
|
|
||
| title "Delete the remote bundle directory out-of-band (simulates deleting it in the UI)" | ||
| trace $CLI workspace delete --recursive "/Workspace/Users/${CURRENT_USER_NAME}/.bundle/out-of-band-delete" | ||
|
|
||
| title "Redeploy without changing any local file, so the stale sync snapshot is reused" | ||
| trace $CLI bundle deploy | ||
|
|
||
| title "After redeploy: the files dir and state are recreated, but the python_file is NOT re-uploaded" | ||
| trace errcode $CLI workspace get-status "$BUNDLE_PATH/files/hello_world.py" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we have also 'musterr' to assert that it must fail. |
||
| trace $CLI workspace get-status "$BUNDLE_PATH/files" | jq '{object_type,path}' | ||
| trace $CLI workspace get-status "$BUNDLE_PATH/state/deployment.json" | jq '{object_type,path}' | ||
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.
We have Badness in test.toml to mark tests recording a buggy behaviour.
This could also be shortened, for example: "After bundle files deleted remotely, next "bundle deploy" does not reupload them until snapshot.json is removed."
You can also confirm that it's the issue by removing snapshot.json and deploying again.