Skip to content

Commit f725fb5

Browse files
authored
acc: test more zero-valued fields in pipeline (#5462)
Extend #5434 (`photon-false`) with `serverless: false` and `continous: false` The test now also dump `bundle.tf.json` when present, showing the CLI writes the `false` value correctly — it is the Terraform provider that drops it.
1 parent 1ff14d3 commit f725fb5

11 files changed

Lines changed: 48 additions & 16 deletions

File tree

acceptance/bundle/resources/pipelines/photon-false/script

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

acceptance/bundle/resources/pipelines/photon-false/test.toml

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

acceptance/bundle/resources/pipelines/photon-false/databricks.yml renamed to acceptance/bundle/resources/pipelines/zero-value-fields/databricks.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
bundle:
2-
name: photon-false
2+
name: zero-value-fields
33

44
resources:
55
pipelines:
66
my:
77
name: test-pipeline
88
photon: false
9+
serverless: false
10+
continuous: false
11+
development: false
912
libraries:
1013
- file:
1114
path: "./foo.py"

acceptance/bundle/resources/pipelines/photon-false/foo.py renamed to acceptance/bundle/resources/pipelines/zero-value-fields/foo.py

File renamed without changes.

acceptance/bundle/resources/pipelines/photon-false/out.requests.direct.txt renamed to acceptance/bundle/resources/pipelines/zero-value-fields/out.requests.direct.txt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,22 @@
33
"path": "/api/2.0/pipelines",
44
"body": {
55
"channel": "CURRENT",
6+
"continuous": false,
67
"deployment": {
78
"kind": "BUNDLE",
8-
"metadata_file_path": "/Workspace/Users/[USERNAME]/.bundle/photon-false/default/state/metadata.json"
9+
"metadata_file_path": "/Workspace/Users/[USERNAME]/.bundle/zero-value-fields/default/state/metadata.json"
910
},
11+
"development": false,
1012
"edition": "ADVANCED",
1113
"libraries": [
1214
{
1315
"file": {
14-
"path": "/Workspace/Users/[USERNAME]/.bundle/photon-false/default/files/foo.py"
16+
"path": "/Workspace/Users/[USERNAME]/.bundle/zero-value-fields/default/files/foo.py"
1517
}
1618
}
1719
],
1820
"name": "test-pipeline",
19-
"photon": false
21+
"photon": false,
22+
"serverless": false
2023
}
2124
}

acceptance/bundle/resources/pipelines/photon-false/out.requests.terraform.txt renamed to acceptance/bundle/resources/pipelines/zero-value-fields/out.requests.terraform.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
"channel": "CURRENT",
66
"deployment": {
77
"kind": "BUNDLE",
8-
"metadata_file_path": "/Workspace/Users/[USERNAME]/.bundle/photon-false/default/state/metadata.json"
8+
"metadata_file_path": "/Workspace/Users/[USERNAME]/.bundle/zero-value-fields/default/state/metadata.json"
99
},
1010
"edition": "ADVANCED",
1111
"libraries": [
1212
{
1313
"file": {
14-
"path": "/Workspace/Users/[USERNAME]/.bundle/photon-false/default/files/foo.py"
14+
"path": "/Workspace/Users/[USERNAME]/.bundle/zero-value-fields/default/files/foo.py"
1515
}
1616
}
1717
],

acceptance/bundle/resources/pipelines/photon-false/out.test.toml renamed to acceptance/bundle/resources/pipelines/zero-value-fields/out.test.toml

File renamed without changes.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"my": {
3+
"channel": "CURRENT",
4+
"continuous": false,
5+
"deployment": {
6+
"kind": "BUNDLE",
7+
"metadata_file_path": "/Workspace/Users/[USERNAME]/.bundle/zero-value-fields/default/state/metadata.json"
8+
},
9+
"development": false,
10+
"edition": "ADVANCED",
11+
"library": [
12+
{
13+
"file": {
14+
"path": "/Workspace/Users/[USERNAME]/.bundle/zero-value-fields/default/files/foo.py"
15+
}
16+
}
17+
],
18+
"name": "test-pipeline",
19+
"photon": false,
20+
"serverless": false
21+
}
22+
}

acceptance/bundle/resources/pipelines/photon-false/output.txt renamed to acceptance/bundle/resources/pipelines/zero-value-fields/output.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
>>> [CLI] bundle deploy
3-
Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/photon-false/default/files...
3+
Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/zero-value-fields/default/files...
44
Deploying resources...
55
Updating deployment state...
66
Deployment complete!
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
trace $CLI bundle deploy
2+
print_requests.py //api/2.0/pipelines > out.requests.$DATABRICKS_BUNDLE_ENGINE.txt 2>&1
3+
4+
if [ -f .databricks/bundle/default/terraform/bundle.tf.json ]; then
5+
jq .resource.databricks_pipeline .databricks/bundle/default/terraform/bundle.tf.json > out.tf.$DATABRICKS_BUNDLE_ENGINE.json
6+
fi

0 commit comments

Comments
 (0)