Skip to content

Commit 598f03e

Browse files
committed
update test
1 parent 4eb6c52 commit 598f03e

File tree

6 files changed

+67
-9
lines changed

6 files changed

+67
-9
lines changed

acceptance/bundle/deployment/migrate/basic/databricks.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ resources:
3030
myjob_name: ${resources.jobs.test_job.name}
3131
volume_catalog_name: ${resources.volumes.test_volume.catalog_name}
3232

33-
# Remote field cause permanent drift (unrelated to migration)
33+
# Remote fields cause permanent drift (unrelated to migration)
3434
# remote field, int, null
35-
#myjob_timeout: ${resources.jobs.test_job.timeout_seconds}
35+
myjob_timeout: ${resources.jobs.test_job.timeout_seconds}
3636

3737
# remote field, string:
38-
#volume_storage_location: ${resources.volumes.test_volume.storage_location}
38+
volume_storage_location: ${resources.volumes.test_volume.storage_location}
3939
libraries:
4040
- notebook:
4141
path: "./pipeline.py"

acceptance/bundle/deployment/migrate/basic/out.new_state.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,10 @@
4646
"tags": {
4747
"myjob_id": "[NUMID]",
4848
"myjob_name": "Test Migration Job",
49+
"myjob_timeout": "",
4950
"myvolume_id": "mycat.myschema.myvol",
50-
"volume_catalog_name": "mycat"
51+
"volume_catalog_name": "mycat",
52+
"volume_storage_location": "s3://deco-uc-prod-isolated-aws-us-east-1/metastore/[UUID]/volumes/[UUID]"
5153
}
5254
}
5355
},

acceptance/bundle/deployment/migrate/basic/out.original_state.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,10 @@
184184
"tags": {
185185
"myjob_id": "[NUMID]",
186186
"myjob_name": "Test Migration Job",
187+
"myjob_timeout": "0",
187188
"myvolume_id": "mycat.myschema.myvol",
188-
"volume_catalog_name": "mycat"
189+
"volume_catalog_name": "mycat",
190+
"volume_storage_location": "s3://deco-uc-prod-isolated-aws-us-east-1/metastore/[UUID]/volumes/[UUID]"
189191
},
190192
"target": null,
191193
"timeouts": null,

acceptance/bundle/deployment/migrate/basic/out.plan_after_migrate.json

Lines changed: 49 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,53 @@
4747
"node": "resources.jobs.test_job",
4848
"label": "${resources.jobs.test_job.name}"
4949
},
50+
{
51+
"node": "resources.jobs.test_job",
52+
"label": "${resources.jobs.test_job.timeout_seconds}"
53+
},
5054
{
5155
"node": "resources.volumes.test_volume",
5256
"label": "${resources.volumes.test_volume.catalog_name}"
5357
},
5458
{
5559
"node": "resources.volumes.test_volume",
5660
"label": "${resources.volumes.test_volume.id}"
61+
},
62+
{
63+
"node": "resources.volumes.test_volume",
64+
"label": "${resources.volumes.test_volume.storage_location}"
5765
}
5866
],
59-
"action": "skip",
67+
"action": "update",
68+
"new_state": {
69+
"config": {
70+
"channel": "CURRENT",
71+
"deployment": {
72+
"kind": "BUNDLE",
73+
"metadata_file_path": "/Workspace/Users/[USERNAME]/.bundle/migrate-basic-test/default/state/metadata.json"
74+
},
75+
"edition": "ADVANCED",
76+
"libraries": [
77+
{
78+
"notebook": {
79+
"path": "/Workspace/Users/[USERNAME]/.bundle/migrate-basic-test/default/files/pipeline"
80+
}
81+
}
82+
],
83+
"name": "Test Migration Pipeline",
84+
"tags": {
85+
"myjob_id": "[NUMID]",
86+
"myjob_name": "Test Migration Job",
87+
"myjob_timeout": "",
88+
"myvolume_id": "mycat.myschema.myvol",
89+
"volume_catalog_name": "mycat",
90+
"volume_storage_location": "${resources.volumes.test_volume.storage_location}"
91+
}
92+
},
93+
"vars": {
94+
"tags.volume_storage_location": "${resources.volumes.test_volume.storage_location}"
95+
}
96+
},
6097
"remote_state": {
6198
"creator_user_name": "[USERNAME]",
6299
"last_modified": [UNIX_TIME_MILLIS],
@@ -83,17 +120,27 @@
83120
"tags": {
84121
"myjob_id": "[NUMID]",
85122
"myjob_name": "Test Migration Job",
123+
"myjob_timeout": "0",
86124
"myvolume_id": "mycat.myschema.myvol",
87-
"volume_catalog_name": "mycat"
125+
"volume_catalog_name": "mycat",
126+
"volume_storage_location": "s3://deco-uc-prod-isolated-aws-us-east-1/metastore/[UUID]/volumes/[UUID]"
88127
}
89128
},
90129
"state": "IDLE"
91130
},
92131
"changes": {
132+
"local": {
133+
"tags.volume_storage_location": {
134+
"action": "update"
135+
}
136+
},
93137
"remote": {
94138
"storage": {
95139
"action": "skip",
96140
"reason": "server_side_default"
141+
},
142+
"tags.myjob_timeout": {
143+
"action": "update"
97144
}
98145
}
99146
}

acceptance/bundle/deployment/migrate/basic/output.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,13 @@ resources.json
2020
sync-snapshots
2121
terraform
2222

23+
>>> jq .state."resources.pipelines.test_pipeline".state.tags.volume_storage_location out.new_state.json
24+
"s3://deco-uc-prod-isolated-aws-us-east-1/metastore/[UUID]/volumes/[UUID]"
25+
2326
>>> [CLI] bundle plan
24-
Plan: 0 to add, 0 to change, 0 to delete, 3 unchanged
27+
update pipelines.test_pipeline
28+
29+
Plan: 0 to add, 1 to change, 0 to delete, 2 unchanged
2530

2631
>>> [CLI] bundle debug plan
2732

acceptance/bundle/deployment/migrate/basic/script

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@ print_state.py > out.original_state.json
77
trace $CLI bundle deployment migrate
88
print_state.py > out.new_state.json
99
trace ls -1 .databricks/bundle/default/ | contains.py "resources.json"
10+
# check that this is stored as resolved value, not as reference:
11+
trace jq '.state."resources.pipelines.test_pipeline".state.tags.volume_storage_location' out.new_state.json | contains.py 's3://'
1012

1113
rm out.requests.txt
12-
trace $CLI bundle plan | contains.py "3 unchanged"
14+
trace $CLI bundle plan | contains.py "2 unchanged" # should be "3 unchanged" when permanent drift is fixed
1315
trace $CLI bundle debug plan > out.plan_after_migrate.json
1416
trace print_requests.py --get //jobs/get | contains.py 'engine/direct'
1517

0 commit comments

Comments
 (0)