-
Notifications
You must be signed in to change notification settings - Fork 37
/
Copy pathconfig_d.feature
117 lines (113 loc) · 3.68 KB
/
config_d.feature
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
Feature: Configuration from config.d
Background:
Given a directory named "templates"
And a file named "templates/test.erb" with:
"""
Test var : <%= test_var %>
"""
And a file named "templates/additional.erb" with:
"""
Additional var : <%= additional_var %>
"""
And a directory named "config.d"
Scenario: Override common.yaml
Given a file named "common.yaml" with:
"""
---
exec: ["cat","test.txt"]
data_sources: [ "file" ]
template_sources: [ "file" ]
environments:
development:
test.erb:
target: test.txt
config:
test_var: 'From common.yaml'
"""
And a file named "config.d/override.yaml" with:
"""
---
data_sources: [ "file" , "environment" ]
"""
When I successfully run `tiller -b . -n -v`
Then a file named "test.txt" should exist
And the file "test.txt" should contain:
"""
Test var : From common.yaml
"""
And the output should contain "Loading config file ./config.d/override.yaml"
And the output should contain "Data sources loaded [FileDataSource, EnvironmentDataSource]"
Scenario: Configuration from 3 separate files
Given a file named "config.d/00-base.yaml" with:
"""
---
exec: ["cat","test.txt"]
data_sources: [ "defaults" , "file" ]
template_sources: [ "file" ]
"""
And a file named "config.d/01-defaults.yaml" with:
"""
defaults:
global:
test_var: "From defaults module"
"""
And a file named "config.d/02-environments.yaml" with:
"""
environments:
development:
test.erb:
target: test.txt
config:
test_var: 'From 02-environments.yaml'
"""
When I successfully run `tiller -b . -n -v`
Then a file named "test.txt" should exist
And the file "test.txt" should contain:
"""
Test var : From 02-environments.yaml
"""
And the output should contain "Loading config file ./config.d/00-base.yaml"
And the output should contain "Loading config file ./config.d/01-defaults.yaml"
And the output should contain "Loading config file ./config.d/02-environments.yaml"
And the output should contain "Merging duplicate data values"
And the output should contain "test_var => 'From defaults module' being replaced by : 'From 02-environments.yaml' from FileDataSource"
Scenario: Add additional templates in later configuration
Given a file named "config.d/00-base.yaml" with:
"""
---
exec: ["cat","test.txt"]
data_sources: [ "file" ]
template_sources: [ "file" ]
"""
And a file named "config.d/01-development-base.yaml" with:
"""
environments:
development:
test.erb:
target: test.txt
config:
test_var: 'From 01-development-base.yaml'
"""
And a file named "config.d/02-development-additional.yaml" with:
"""
environments:
development:
additional.erb:
target: additional.txt
config:
additional_var: 'From 02-development-additional.yaml'
"""
When I successfully run `tiller -b . -n -v`
Then a file named "test.txt" should exist
And the file "test.txt" should contain:
"""
Test var : From 01-development-base.yaml
"""
And a file named "additional.txt" should exist
And the file "additional.txt" should contain:
"""
Additional var : From 02-development-additional.yaml
"""
And the output should contain "Loading config file ./config.d/00-base.yaml"
And the output should contain "Loading config file ./config.d/01-development-base.yaml"
And the output should contain "Loading config file ./config.d/02-development-additional.yaml"