Skip to content

Commit

Permalink
Tests: Implement scenario where .sync.yml is changed between two runs
Browse files Browse the repository at this point in the history
This commit implements the scenario described at voxpupuli#192.
  • Loading branch information
neomilium committed Oct 8, 2021
1 parent f955a40 commit 4415e21
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions features/update/dot_sync.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
Feature: Update using a `.sync.yml` file
ModuleSync needs to apply templates according to `.sync.yml` content

Scenario: Updating a module with a .sync.yml file
Given a basic setup with a puppet module "puppet-test" from "fakenamespace"
And a file named "config_defaults.yml" with:
"""
---
:global:
variable: 'global'
template_with_specific_config:
variable: 'specific'
"""
And a file named "moduleroot/template_with_specific_config.erb" with:
"""
---
<%= @configs['variable'] %>
"""
And a file named "moduleroot/template_with_only_global_config.erb" with:
"""
---
<%= @configs['variable'] %>
"""
And the puppet module "puppet-test" from "fakenamespace" has a branch named "target"
And the puppet module "puppet-test" from "fakenamespace" has, in branch "target", a file named ".sync.yml" with:
"""
---
:global:
variable: 'overwritten by globally defined value in .sync.yml'
template_with_specific_config:
variable: 'overwritten by file-specific defined value in .sync.yml'
"""
When I successfully run `msync update --message 'Apply ModuleSync templates to target source code' --branch 'target'`
Then the file named "modules/fakenamespace/puppet-test/template_with_specific_config" should contain:
"""
overwritten by file-specific defined value in .sync.yml
"""
And the puppet module "puppet-test" from "fakenamespace" should have 1 commit made by "Aruba"
When the puppet module "puppet-test" from "fakenamespace" has, in branch "target", a file named ".sync.yml" with:
"""
---
:global:
variable: 'overwritten by globally defined value in .sync.yml'
template_with_specific_config:
variable: 'overwritten by newly file-specific defined value in .sync.yml'
"""
And I successfully run `msync update --message 'Apply ModuleSync templates to target source code' --branch 'target'`
Then the file named "modules/fakenamespace/puppet-test/template_with_specific_config" should contain:
"""
overwritten by newly file-specific defined value in .sync.yml
"""
And the puppet module "puppet-test" from "fakenamespace" should have 2 commits made by "Aruba"

0 comments on commit 4415e21

Please sign in to comment.