Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
181 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
features/fixtures/environment_plugin/environments/local_override.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
test.erb: | ||
target: test.txt | ||
config: | ||
env_test: 'This value overwrites the global value provided by the environment plugin' | ||
env_test: 'This value will be overwritten' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
simple_keys.erb: | ||
target: simple_keys.txt | ||
config: | ||
default_value: 'This overrides the global value from the JSON data source' | ||
default_value: 'From the file datasource' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
Feature: Test new value precedence and merging behaviour | ||
Background: | ||
Given a directory named "templates" | ||
And a file named "templates/test.erb" with: | ||
""" | ||
test_var: <%= test_var %> | ||
""" | ||
|
||
|
||
Scenario: Global vars from two plugins | ||
Given a file named "common.yaml" with: | ||
""" | ||
--- | ||
exec: [ 'cat','test.txt' ] | ||
data_sources: [ "defaults" , "file" ] | ||
template_sources: [ "file" ] | ||
defaults: | ||
test_var: "From defaults plugin" | ||
environments: | ||
development: | ||
global_values: | ||
test_var: 'From file plugin' | ||
test.erb: | ||
target: test.txt | ||
""" | ||
When I successfully run `tiller -b . -v` | ||
Then a file named "test.txt" should exist | ||
And the file "test.txt" should contain: | ||
""" | ||
test_var: From file plugin | ||
""" | ||
|
||
Scenario: Template vars from two plugins | ||
Given a file named "common.yaml" with: | ||
""" | ||
--- | ||
exec: [ 'cat','test.txt' ] | ||
data_sources: [ "defaults" , "file" ] | ||
template_sources: [ "file" ] | ||
defaults: | ||
test.erb: | ||
test_var: "From defaults plugin" | ||
environments: | ||
development: | ||
test.erb: | ||
target: test.txt | ||
config: | ||
test_var: "From file plugin" | ||
""" | ||
When I successfully run `tiller -b . -v` | ||
Then a file named "test.txt" should exist | ||
And the file "test.txt" should contain: | ||
""" | ||
test_var: From file plugin | ||
""" | ||
|
||
Scenario: Environment global should over-ride template vars from earlier plugins | ||
Given a file named "common.yaml" with: | ||
""" | ||
--- | ||
exec: [ 'cat','test.txt' ] | ||
data_sources: [ "defaults" , "file" , "environment" ] | ||
template_sources: [ "file" ] | ||
environment: | ||
prefix: 'test_' | ||
defaults: | ||
test.erb: | ||
test_var: "From defaults plugin" | ||
environments: | ||
development: | ||
test.erb: | ||
target: test.txt | ||
config: | ||
test_var: "From file plugin" | ||
""" | ||
And I set the environment variables exactly to: | ||
| variable | value | | ||
| var | from environment | | ||
When I successfully run `tiller -b . -v` | ||
Then a file named "test.txt" should exist | ||
And the file "test.txt" should contain: | ||
""" | ||
test_var: from environment | ||
""" | ||
And the output should contain: | ||
""" | ||
Warning, merging duplicate data values. | ||
test_var => 'From defaults plugin' being replaced by : 'From file plugin' from FileDataSource | ||
Warning, merging duplicate data values. | ||
test_var => 'From file plugin' being replaced by : 'from environment' from EnvironmentDataSource | ||
""" | ||
|
Oops, something went wrong.