Skip to content

Commit a87ab46

Browse files
committed
tests: add support for complex includes and enhance variable structures
1 parent 690c877 commit a87ab46

File tree

5 files changed

+52
-1
lines changed

5 files changed

+52
-1
lines changed

tests/fixtures/scenarios/atmos-include-yaml-function/atmos.yaml

+9
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,12 @@ stacks:
1919
logs:
2020
file: "/dev/stderr"
2121
level: Info
22+
23+
24+
templates:
25+
settings:
26+
enabled: true
27+
sprig:
28+
enabled: true
29+
gomplate:
30+
enabled: true

tests/fixtures/scenarios/atmos-include-yaml-function/config/vars.json

+14
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,20 @@
66
"b",
77
"c"
88
],
9+
"other_list_var": [
10+
"d",
11+
"e",
12+
"f"
13+
],
14+
"list_objects": [
15+
{
16+
"hyphenated-list-var": [
17+
"x",
18+
"y",
19+
"z"
20+
]
21+
}
22+
],
923
"map_var": {
1024
"a": 1,
1125
"b": 2,
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,22 @@
11
string_var = "abc"
22
boolean_var = true
3-
list_var = ["a", "b", "c"]
3+
list_var = ["a", "b", "c"]
44
map_var = {
55
a = 1
66
b = 2
77
c = 3
88
}
9+
other_list_var : [
10+
"d",
11+
"e",
12+
"f"
13+
]
14+
list_objects : [
15+
{
16+
hyphenated-list-var : [
17+
"x",
18+
"y",
19+
"z"
20+
]
21+
}
22+
]

tests/fixtures/scenarios/atmos-include-yaml-function/config/vars.yaml

+9
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,12 @@ map_var:
88
a: 1
99
b: 2
1010
c: 3
11+
other_list_var:
12+
- d
13+
- e
14+
- f
15+
list_objects:
16+
- hyphenated-list-var:
17+
- x
18+
- y
19+
- z

tests/fixtures/scenarios/atmos-include-yaml-function/stacks/deploy/nonprod.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,8 @@ components:
1414
boolean_var: !include config/vars.yaml .boolean_var
1515
list_var: !include config/vars.tfvars .list_var
1616
map_var: !include config/vars.tfvars .map_var
17+
# Relative paths are relative to the file containing the `!include` directive
18+
complex_yq_var: !include '"../../config/vars.json" ".list_var + .other_list_var"'
19+
hyphenated_list_var: !include '"../../config/vars.json" ".list_var + .other_list_var + .list_objects[0].hyphenated-list-var"'
20+
### http include with space based jq filter requires triple quotes.
21+
http_var: !include https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json """.definitions.backend_type.enum + .definitions.metadata.properties.type.enum"""'

0 commit comments

Comments
 (0)