about summary refs log tree commit diff
path: root/context/testdata/merging/resource
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2018-06-26T10·25+0200
committerVincent Ambo <github@tazj.in>2018-06-26T19·06+0200
commit6d8214bfc8eb9733f0adf58a629c77950c34e80d (patch)
treee915ac77b68d50c76e80eb4b1d5b3a0808444640 /context/testdata/merging/resource
parent4a6f087fbfe84731db0a8e5084364ad0f6ad5212 (diff)
test(context): Introduce an explicit value merging test
Introduces a test which will merge variables defined at every possible
layer together and ensure that the loaded context configuration is as
expected.

The test data provides an actual resource set template that can be
tested locally from a kontemplate source checkout:

    kontemplate template context/testdata/merging/context.yaml --var cliVar=cliVar
Diffstat (limited to 'context/testdata/merging/resource')
-rw-r--r--context/testdata/merging/resource/default.yaml5
-rw-r--r--context/testdata/merging/resource/output.yaml5
2 files changed, 10 insertions, 0 deletions
diff --git a/context/testdata/merging/resource/default.yaml b/context/testdata/merging/resource/default.yaml
new file mode 100644
index 000000000000..040a19aaba25
--- /dev/null
+++ b/context/testdata/merging/resource/default.yaml
@@ -0,0 +1,5 @@
+defaultVar: defaultVar
+importVar: should be overridden (default)
+globalVar: should be overridden (default)
+includeVar: should be overridden (default)
+cliVar: should be overridden (default)
diff --git a/context/testdata/merging/resource/output.yaml b/context/testdata/merging/resource/output.yaml
new file mode 100644
index 000000000000..5920b2720780
--- /dev/null
+++ b/context/testdata/merging/resource/output.yaml
@@ -0,0 +1,5 @@
+defaultVar: {{ .defaultVar }}
+importVar: {{ .importVar }}
+globalVar: {{ .globalVar }}
+includeVar: {{ .includeVar }}
+cliVar: {{ .cliVar }}