Skip to content

Commit 22d4e2b

Browse files
denikIsaac
andcommitted
Update the validate edge-case tests for the typed configuration
#7085 recorded main's behaviour. Where the typed configuration fixes a wrong behaviour the Badness is gone (nested and shorthand timestamps, an inline merge mapping, resources: null, a scalar targets section). Where it behaves differently in a wrong way a Badness records it: scalar target variable overrides inherited through a merge key, an aliased complex default rewritten in place, duplicate and invalid merge keys, a duplicate default key, wrong types turned into empty strings, the lost location of an unknown field in a variable default, and presets that an include cannot clear. Co-authored-by: Isaac <no-reply@databricks.com>
1 parent 86509de commit 22d4e2b

42 files changed

Lines changed: 99 additions & 79 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎acceptance/bundle/validate/app_resource_duplicate_name_location/output.txt‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
>>> [CLI] bundle validate
33
Warning: invalid value "INVALID" for enum field. Valid values are [CAN_MANAGE CAN_MANAGE_RUN CAN_VIEW IS_OWNER]
44
at resources.apps.app.resources[0].job.permission
5-
in databricks.yml:13:25
5+
in databricks.yml:17:25
66

77
Name: test-bundle
88
Target: default
@@ -15,7 +15,7 @@ Found 1 warning
1515
>>> [CLI] bundle validate -o json
1616
Warning: invalid value "INVALID" for enum field. Valid values are [CAN_MANAGE CAN_MANAGE_RUN CAN_VIEW IS_OWNER]
1717
at resources.apps.app.resources[0].job.permission
18-
in databricks.yml:13:25
18+
in databricks.yml:17:25
1919

2020
[
2121
{

‎acceptance/bundle/validate/app_resource_duplicate_name_location/script‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# A diagnostic on a field of a duplicated app resource entry points at the first entry when the duplicate's value is the same.
1+
# A diagnostic on a field of a duplicated app resource entry points at the entry that is kept (the later one).
22
errcode trace $CLI bundle validate
33

44
# The entries are merged by name, the later one wins.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Badness = "An include cannot clear a preset with \"\", 0 or false: the base value stays (a written zero is not recorded without ForceSendFields)."
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11

22
>>> [CLI] bundle validate
3+
Warning: unknown field: unexpected_after_failure
4+
at bundle
5+
in b.yml:2:3
6+
37
Error: cannot merge map with string
48

59
Name: test-bundle
610

7-
Found 1 error
11+
Found 1 error and 1 warning
812

913
Exit code: 1
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
# Includes after one that fails to merge do not report their diagnostics.
1+
# Includes after one that fails to merge still report their diagnostics.
22
errcode trace $CLI bundle validate
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Badness = "The merge error has no location or path, and diagnostics of includes loaded after the failed merge (the unknown field in b.yml) are not reported, although they do not depend on the merge."
1+
Badness = "The merge error has no location or path."
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11

22
>>> [CLI] bundle validate
3-
Error: expected a map at "resources", found nil
4-
53
Name: test-bundle
4+
Target: default
5+
Workspace:
6+
User: [USERNAME]
7+
Path: /Workspace/Users/[USERNAME]/.bundle/test-bundle/default
68

7-
Found 1 error
8-
9-
Exit code: 1
9+
Validation OK!
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
# resources: null is rejected.
1+
# resources: null is accepted.
22
errcode trace $CLI bundle validate

‎acceptance/bundle/validate/nulls/resources_container/test.toml‎

Lines changed: 0 additions & 1 deletion
This file was deleted.

‎acceptance/bundle/validate/references/resolved_invalid_map_value/output.txt‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@ Warning: expected string, found map
55
in databricks.yml:15:23
66

77
{
8+
"bad.key[0]": "",
89
"good": "ok"
910
}

0 commit comments

Comments
 (0)