modulesync 2.0.1 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.config/cucumber.yml +1 -0
- data/.rubocop.yml +6 -1
- data/CHANGELOG.md +22 -0
- data/Gemfile +2 -2
- data/README.md +4 -4
- data/features/cli.feature +11 -6
- data/features/hook.feature +3 -5
- data/features/step_definitions/git_steps.rb +63 -35
- data/features/support/env.rb +4 -0
- data/features/update.feature +142 -343
- data/features/update/bad_context.feature +26 -0
- data/lib/modulesync.rb +4 -4
- data/lib/modulesync/cli.rb +5 -4
- data/lib/modulesync/cli/thor.rb +24 -0
- data/lib/modulesync/git.rb +1 -1
- data/lib/monkey_patches.rb +9 -48
- data/modulesync.gemspec +2 -2
- data/spec/helpers/faker.rb +14 -0
- data/spec/helpers/faker/puppet_module_remote_repo.rb +140 -0
- metadata +12 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bb584b8ba14d3c54ae9cf5ca91f24e8d1a087e73e45d98e45e79a29f6bbf2578
|
4
|
+
data.tar.gz: c7fcf27f5bd05249da092a80a92b03430909a400b65c8be53671e2ae4a020459
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b41beb1d73df97a4e006749788f0c6415f8d87c8e7d69cb07a7f74d202bfda4cf238558060d04044080c9b83b71633d182db506820634b92f86887329169b212
|
7
|
+
data.tar.gz: 38f81a8fe37ff9b30f01f59299deb6de1d47ea03c89ea0d0d6df89b83b19f323b1ecaeab349ca7697bff37d9b9b4c7984c1f63083e22c2d721925a93c0d29559
|
@@ -0,0 +1 @@
|
|
1
|
+
default: --publish-quiet
|
data/.rubocop.yml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
inherit_from: .rubocop_todo.yml
|
2
2
|
|
3
3
|
AllCops:
|
4
|
-
TargetRubyVersion: 2.
|
4
|
+
TargetRubyVersion: 2.4
|
5
5
|
Exclude:
|
6
6
|
- 'vendor/**/*'
|
7
7
|
- 'tmp/**/*'
|
@@ -25,3 +25,8 @@ Layout/IndentHeredoc:
|
|
25
25
|
# sane line length
|
26
26
|
Metrics/LineLength:
|
27
27
|
Max: 120
|
28
|
+
Exclude:
|
29
|
+
- 'features/**/*'
|
30
|
+
|
31
|
+
Style/FrozenStringLiteralComment:
|
32
|
+
Enabled: false
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,28 @@
|
|
2
2
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
|
5
|
+
## [2.0.2](https://github.com/voxpupuli/modulesync/tree/2.0.2) (2021-04-03)
|
6
|
+
|
7
|
+
[Full Changelog](https://github.com/voxpupuli/modulesync/compare/2.0.1...2.0.2)
|
8
|
+
|
9
|
+
**Fixed bugs:**
|
10
|
+
|
11
|
+
- Fix language-dependent Git output handling [\#200](https://github.com/voxpupuli/modulesync/pull/200) ([neomilium](https://github.com/neomilium))
|
12
|
+
|
13
|
+
**Closed issues:**
|
14
|
+
|
15
|
+
- Add linting \(rubocop\) to Travis CI configuration [\#153](https://github.com/voxpupuli/modulesync/issues/153)
|
16
|
+
- Language sensitive GIT handling [\#85](https://github.com/voxpupuli/modulesync/issues/85)
|
17
|
+
|
18
|
+
**Merged pull requests:**
|
19
|
+
|
20
|
+
- Fix spelling of PR CLI option \(kebab-case\) [\#209](https://github.com/voxpupuli/modulesync/pull/209) ([bittner](https://github.com/bittner))
|
21
|
+
- Correctly state which config file to update [\#208](https://github.com/voxpupuli/modulesync/pull/208) ([bittner](https://github.com/bittner))
|
22
|
+
- Fix exit status code on failures [\#204](https://github.com/voxpupuli/modulesync/pull/204) ([neomilium](https://github.com/neomilium))
|
23
|
+
- Remove monkey patches [\#203](https://github.com/voxpupuli/modulesync/pull/203) ([neomilium](https://github.com/neomilium))
|
24
|
+
- Improve tests capabilities by using local/fake remote repositories [\#202](https://github.com/voxpupuli/modulesync/pull/202) ([neomilium](https://github.com/neomilium))
|
25
|
+
- Minor modernization and cosmetic fix [\#201](https://github.com/voxpupuli/modulesync/pull/201) ([neomilium](https://github.com/neomilium))
|
26
|
+
|
5
27
|
## [2.0.1](https://github.com/voxpupuli/modulesync/tree/2.0.1) (2020-10-06)
|
6
28
|
|
7
29
|
[Full Changelog](https://github.com/voxpupuli/modulesync/compare/2.0.0...2.0.1)
|
data/Gemfile
CHANGED
@@ -2,9 +2,9 @@ source ENV['GEM_SOURCE'] || 'https://rubygems.org'
|
|
2
2
|
|
3
3
|
gemspec
|
4
4
|
|
5
|
-
gem 'cucumber'
|
5
|
+
gem 'cucumber'
|
6
6
|
gem 'octokit', '~> 4.9'
|
7
7
|
|
8
8
|
group :release do
|
9
|
-
gem 'github_changelog_generator', :require => false
|
9
|
+
gem 'github_changelog_generator', :require => false
|
10
10
|
end
|
data/README.md
CHANGED
@@ -169,7 +169,7 @@ msync hook activate
|
|
169
169
|
```
|
170
170
|
|
171
171
|
If you have activated the hook but want to make changes to the configuration
|
172
|
-
directory (such as changes to managed_modules.yml or modulesync.yml) without
|
172
|
+
directory (such as changes to `managed_modules.yml` or `modulesync.yml`) without
|
173
173
|
touching the modules, you can deactivate the hook.
|
174
174
|
|
175
175
|
```
|
@@ -191,8 +191,8 @@ or set them per repository in `managed_modules.yml`, using the `github` or
|
|
191
191
|
`gitlab` keys respectively.
|
192
192
|
|
193
193
|
For GitHub Enterprise and self-hosted GitLab instances you also need to set the
|
194
|
-
`GITHUB_BASE_URL` or `GITLAB_BASE_URL` environment variables, or
|
195
|
-
`base_url` parameter in `
|
194
|
+
`GITHUB_BASE_URL` or `GITLAB_BASE_URL` environment variables, or specify the
|
195
|
+
`base_url` parameter in `modulesync.yml`:
|
196
196
|
|
197
197
|
```yaml
|
198
198
|
---
|
@@ -214,7 +214,7 @@ Then:
|
|
214
214
|
* Assign labels to the PR/MR with `--pr-labels` or in `modulesync.yml` with
|
215
215
|
the `pr_labels` attribute. **NOTE:** `pr_labels` should be a list. When
|
216
216
|
using the `--pr-labels` CLI option, you should use a comma separated list.
|
217
|
-
* Set the target branch with `--
|
217
|
+
* Set the target branch with `--pr-target-branch` or in `modulesync.yml` with
|
218
218
|
the `pr_target_branch` attribute.
|
219
219
|
|
220
220
|
More details for GitHub:
|
data/features/cli.feature
CHANGED
@@ -4,21 +4,26 @@ Feature: CLI
|
|
4
4
|
Scenario: When passing no arguments to the msync command
|
5
5
|
When I run `msync`
|
6
6
|
And the output should match /Commands:/
|
7
|
+
Then the exit status should be 1
|
7
8
|
|
8
9
|
Scenario: When passing invalid arguments to the msync update command
|
9
10
|
When I run `msync update`
|
10
11
|
And the output should match /No value provided for required option/
|
12
|
+
Then the exit status should be 1
|
11
13
|
|
12
14
|
Scenario: When passing invalid arguments to the msync hook command
|
13
15
|
When I run `msync hook`
|
14
16
|
And the output should match /Commands:/
|
17
|
+
Then the exit status should be 1
|
15
18
|
|
16
|
-
Scenario: When running the help
|
19
|
+
Scenario: When running the help command
|
17
20
|
When I run `msync help`
|
18
21
|
And the output should match /Commands:/
|
22
|
+
Then the exit status should be 0
|
19
23
|
|
20
24
|
Scenario: When overriding a setting from the config file on the command line
|
21
|
-
Given a
|
25
|
+
Given a puppet module "puppet-test" from "fakenamespace"
|
26
|
+
And a file named "managed_modules.yml" with:
|
22
27
|
"""
|
23
28
|
---
|
24
29
|
- puppet-test
|
@@ -26,10 +31,10 @@ Feature: CLI
|
|
26
31
|
And a file named "modulesync.yml" with:
|
27
32
|
"""
|
28
33
|
---
|
29
|
-
|
30
|
-
git_base: 'git@github.com:'
|
34
|
+
namespace: default
|
31
35
|
"""
|
36
|
+
And a git_base option appended to "modulesync.yml" for local tests
|
32
37
|
And a directory named "moduleroot"
|
33
|
-
When I run `msync update --noop --
|
38
|
+
When I run `msync update --noop --namespace fakenamespace`
|
34
39
|
Then the exit status should be 0
|
35
|
-
And the output should
|
40
|
+
And the output should match /Syncing fakenamespace/
|
data/features/hook.feature
CHANGED
@@ -5,8 +5,7 @@ Feature: hook
|
|
5
5
|
Given a directory named ".git/hooks"
|
6
6
|
When I run `msync hook activate`
|
7
7
|
Then the exit status should be 0
|
8
|
-
|
9
|
-
Then the output should contain "bash"
|
8
|
+
And the file named ".git/hooks/pre-push" should contain "bash"
|
10
9
|
|
11
10
|
Scenario: Deactivating a hook
|
12
11
|
Given a file named ".git/hooks/pre-push" with:
|
@@ -21,8 +20,7 @@ Feature: hook
|
|
21
20
|
Given a directory named ".git/hooks"
|
22
21
|
When I run `msync hook activate -a '--foo bar --baz quux' -b master`
|
23
22
|
Then the exit status should be 0
|
24
|
-
|
25
|
-
Then the output should match:
|
23
|
+
And the file named ".git/hooks/pre-push" should contain:
|
26
24
|
"""
|
27
|
-
"
|
25
|
+
"$message" -n puppetlabs -b master --foo bar --baz quux
|
28
26
|
"""
|
@@ -1,47 +1,75 @@
|
|
1
|
-
|
2
|
-
steps %(
|
3
|
-
Given a mocked home directory
|
4
|
-
And I run `git config --global user.name Test`
|
5
|
-
And I run `git config --global user.email test@example.com`
|
6
|
-
)
|
7
|
-
end
|
1
|
+
require_relative '../../spec/helpers/faker/puppet_module_remote_repo'
|
8
2
|
|
9
|
-
Given 'a
|
3
|
+
Given 'a basic setup with a puppet module {string} from {string}' do |name, namespace|
|
10
4
|
steps %(
|
11
|
-
Given a
|
12
|
-
And
|
5
|
+
Given a mocked git configuration
|
6
|
+
And a puppet module "#{name}" from "#{namespace}"
|
13
7
|
And a file named "managed_modules.yml" with:
|
14
8
|
"""
|
15
9
|
---
|
16
|
-
-
|
10
|
+
- #{name}
|
17
11
|
"""
|
12
|
+
And a file named "modulesync.yml" with:
|
13
|
+
"""
|
14
|
+
---
|
15
|
+
namespace: #{namespace}
|
16
|
+
"""
|
17
|
+
And a git_base option appended to "modulesync.yml" for local tests
|
18
18
|
)
|
19
|
-
write_file('modulesync.yml', <<-CONFIG)
|
20
|
-
---
|
21
|
-
namespace: sources
|
22
|
-
git_base: file://#{expand_path('.')}/
|
23
|
-
CONFIG
|
24
19
|
end
|
25
20
|
|
26
|
-
Given
|
21
|
+
Given 'a mocked git configuration' do
|
27
22
|
steps %(
|
28
|
-
Given a
|
29
|
-
And I run `git
|
30
|
-
And
|
31
|
-
"""
|
32
|
-
---
|
33
|
-
- puppet-test
|
34
|
-
"""
|
23
|
+
Given a mocked home directory
|
24
|
+
And I run `git config --global user.name Aruba`
|
25
|
+
And I run `git config --global user.email aruba@example.com`
|
35
26
|
)
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
27
|
+
end
|
28
|
+
|
29
|
+
Given 'a puppet module {string} from {string}' do |name, namespace|
|
30
|
+
pmrr = ModuleSync::Faker::PuppetModuleRemoteRepo.new(name, namespace)
|
31
|
+
pmrr.populate
|
32
|
+
end
|
33
|
+
|
34
|
+
Given 'a git_base option appended to "modulesync.yml" for local tests' do
|
35
|
+
File.write "#{Aruba.config.working_directory}/modulesync.yml", "\ngit_base: #{ModuleSync::Faker::PuppetModuleRemoteRepo.git_base}", mode: 'a'
|
36
|
+
end
|
37
|
+
|
38
|
+
Given 'the puppet module {string} from {string} is read-only' do |name, namespace|
|
39
|
+
pmrr = ModuleSync::Faker::PuppetModuleRemoteRepo.new(name, namespace)
|
40
|
+
pmrr.read_only = true
|
41
|
+
end
|
42
|
+
|
43
|
+
Then 'the puppet module {string} from {string} should have no commits between {string} and {string}' do |name, namespace, commit1, commit2|
|
44
|
+
pmrr = ModuleSync::Faker::PuppetModuleRemoteRepo.new(name, namespace)
|
45
|
+
expect(pmrr.commit_count_between(commit1, commit2)).to eq 0
|
46
|
+
end
|
47
|
+
|
48
|
+
Then 'the puppet module {string} from {string} should have( only) {int} commit(s) made by {string}' do |name, namespace, commit_count, author|
|
49
|
+
pmrr = ModuleSync::Faker::PuppetModuleRemoteRepo.new(name, namespace)
|
50
|
+
expect(pmrr.commit_count_by(author)).to eq commit_count
|
51
|
+
end
|
52
|
+
|
53
|
+
Then 'the puppet module {string} from {string} should have( only) {int} commit(s) made by {string} in branch {string}' do |name, namespace, commit_count, author, branch|
|
54
|
+
pmrr = ModuleSync::Faker::PuppetModuleRemoteRepo.new(name, namespace)
|
55
|
+
expect(pmrr.commit_count_by(author, branch)).to eq commit_count
|
56
|
+
end
|
57
|
+
|
58
|
+
Then 'the puppet module {string} from {string} should have no commits made by {string}' do |name, namespace, author|
|
59
|
+
step "the puppet module \"#{name}\" from \"#{namespace}\" should have 0 commits made by \"#{author}\""
|
60
|
+
end
|
61
|
+
|
62
|
+
Given 'the puppet module {string} from {string} has a file named {string} with:' do |name, namespace, filename, content|
|
63
|
+
pmrr = ModuleSync::Faker::PuppetModuleRemoteRepo.new(name, namespace)
|
64
|
+
pmrr.add_file(filename, content)
|
65
|
+
end
|
66
|
+
|
67
|
+
Then 'the puppet module {string} from {string} should have a branch {string} with a file named {string} which contains:' do |name, namespace, branch, filename, content|
|
68
|
+
pmrr = ModuleSync::Faker::PuppetModuleRemoteRepo.new(name, namespace)
|
69
|
+
expect(pmrr.read_file(filename, branch)).to include(content)
|
70
|
+
end
|
71
|
+
|
72
|
+
Given 'the puppet module {string} from {string} has the default branch named {string}' do |name, namespace, default_branch|
|
73
|
+
pmrr = ModuleSync::Faker::PuppetModuleRemoteRepo.new(name, namespace)
|
74
|
+
pmrr.default_branch = default_branch
|
47
75
|
end
|
data/features/support/env.rb
CHANGED
data/features/update.feature
CHANGED
@@ -2,17 +2,7 @@ Feature: update
|
|
2
2
|
ModuleSync needs to update module boilerplate
|
3
3
|
|
4
4
|
Scenario: Adding a new file
|
5
|
-
Given a
|
6
|
-
"""
|
7
|
-
---
|
8
|
-
- puppet-test
|
9
|
-
"""
|
10
|
-
And a file named "modulesync.yml" with:
|
11
|
-
"""
|
12
|
-
---
|
13
|
-
namespace: maestrodev
|
14
|
-
git_base: https://github.com/
|
15
|
-
"""
|
5
|
+
Given a basic setup with a puppet module "puppet-test" from "fakenamespace"
|
16
6
|
And a file named "config_defaults.yml" with:
|
17
7
|
"""
|
18
8
|
---
|
@@ -31,21 +21,11 @@ Feature: update
|
|
31
21
|
Files added:
|
32
22
|
test
|
33
23
|
"""
|
34
|
-
|
35
|
-
Then the output should contain "aruba"
|
24
|
+
And the file named "modules/fakenamespace/puppet-test/test" should contain "aruba"
|
36
25
|
|
37
26
|
Scenario: Using skip_broken option and adding a new file to repo without write access
|
38
|
-
Given a
|
39
|
-
|
40
|
-
---
|
41
|
-
- puppet-test
|
42
|
-
"""
|
43
|
-
And a file named "modulesync.yml" with:
|
44
|
-
"""
|
45
|
-
---
|
46
|
-
namespace: maestrodev
|
47
|
-
git_base: 'git@github.com:'
|
48
|
-
"""
|
27
|
+
Given a basic setup with a puppet module "puppet-test" from "fakenamespace"
|
28
|
+
And the puppet module "puppet-test" from "fakenamespace" is read-only
|
49
29
|
And a file named "config_defaults.yml" with:
|
50
30
|
"""
|
51
31
|
---
|
@@ -59,19 +39,11 @@ Feature: update
|
|
59
39
|
"""
|
60
40
|
When I run `msync update -s -m "Add test"`
|
61
41
|
Then the exit status should be 0
|
42
|
+
And the puppet module "puppet-test" from "fakenamespace" should have no commits made by "Aruba"
|
62
43
|
|
63
44
|
Scenario: Adding a new file to repo without write access
|
64
|
-
Given a
|
65
|
-
|
66
|
-
---
|
67
|
-
- puppet-test
|
68
|
-
"""
|
69
|
-
And a file named "modulesync.yml" with:
|
70
|
-
"""
|
71
|
-
---
|
72
|
-
namespace: maestrodev
|
73
|
-
git_base: 'git@github.com:'
|
74
|
-
"""
|
45
|
+
Given a basic setup with a puppet module "puppet-test" from "fakenamespace"
|
46
|
+
And the puppet module "puppet-test" from "fakenamespace" is read-only
|
75
47
|
And a file named "config_defaults.yml" with:
|
76
48
|
"""
|
77
49
|
---
|
@@ -85,19 +57,10 @@ Feature: update
|
|
85
57
|
"""
|
86
58
|
When I run `msync update -m "Add test" -r`
|
87
59
|
Then the exit status should be 1
|
60
|
+
And the puppet module "puppet-test" from "fakenamespace" should have no commits made by "Aruba"
|
88
61
|
|
89
62
|
Scenario: Adding a new file, without the .erb suffix
|
90
|
-
Given a
|
91
|
-
"""
|
92
|
-
---
|
93
|
-
- puppet-test
|
94
|
-
"""
|
95
|
-
And a file named "modulesync.yml" with:
|
96
|
-
"""
|
97
|
-
---
|
98
|
-
namespace: maestrodev
|
99
|
-
git_base: https://github.com/
|
100
|
-
"""
|
63
|
+
Given a basic setup with a puppet module "puppet-test" from "fakenamespace"
|
101
64
|
And a file named "config_defaults.yml" with:
|
102
65
|
"""
|
103
66
|
---
|
@@ -120,21 +83,11 @@ Feature: update
|
|
120
83
|
Files added:
|
121
84
|
test
|
122
85
|
"""
|
123
|
-
|
124
|
-
|
86
|
+
And the file named "modules/fakenamespace/puppet-test/test" should contain "aruba"
|
87
|
+
And the puppet module "puppet-test" from "fakenamespace" should have no commits made by "Aruba"
|
125
88
|
|
126
89
|
Scenario: Adding a new file using global values
|
127
|
-
Given a
|
128
|
-
"""
|
129
|
-
---
|
130
|
-
- puppet-test
|
131
|
-
"""
|
132
|
-
And a file named "modulesync.yml" with:
|
133
|
-
"""
|
134
|
-
---
|
135
|
-
namespace: maestrodev
|
136
|
-
git_base: https://github.com/
|
137
|
-
"""
|
90
|
+
Given a basic setup with a puppet module "puppet-test" from "fakenamespace"
|
138
91
|
And a file named "config_defaults.yml" with:
|
139
92
|
"""
|
140
93
|
---
|
@@ -153,21 +106,11 @@ Feature: update
|
|
153
106
|
Files added:
|
154
107
|
test
|
155
108
|
"""
|
156
|
-
|
157
|
-
|
109
|
+
And the file named "modules/fakenamespace/puppet-test/test" should contain "aruba"
|
110
|
+
And the puppet module "puppet-test" from "fakenamespace" should have no commits made by "Aruba"
|
158
111
|
|
159
112
|
Scenario: Adding a new file overriding global values
|
160
|
-
Given a
|
161
|
-
"""
|
162
|
-
---
|
163
|
-
- puppet-test
|
164
|
-
"""
|
165
|
-
And a file named "modulesync.yml" with:
|
166
|
-
"""
|
167
|
-
---
|
168
|
-
namespace: maestrodev
|
169
|
-
git_base: https://github.com/
|
170
|
-
"""
|
113
|
+
Given a basic setup with a puppet module "puppet-test" from "fakenamespace"
|
171
114
|
And a file named "config_defaults.yml" with:
|
172
115
|
"""
|
173
116
|
---
|
@@ -189,21 +132,11 @@ Feature: update
|
|
189
132
|
Files added:
|
190
133
|
test
|
191
134
|
"""
|
192
|
-
|
193
|
-
|
135
|
+
And the file named "modules/fakenamespace/puppet-test/test" should contain "aruba"
|
136
|
+
And the puppet module "puppet-test" from "fakenamespace" should have no commits made by "Aruba"
|
194
137
|
|
195
138
|
Scenario: Adding a new file ignoring global values
|
196
|
-
Given a
|
197
|
-
"""
|
198
|
-
---
|
199
|
-
- puppet-test
|
200
|
-
"""
|
201
|
-
And a file named "modulesync.yml" with:
|
202
|
-
"""
|
203
|
-
---
|
204
|
-
namespace: maestrodev
|
205
|
-
git_base: https://github.com/
|
206
|
-
"""
|
139
|
+
Given a basic setup with a puppet module "puppet-test" from "fakenamespace"
|
207
140
|
And a file named "config_defaults.yml" with:
|
208
141
|
"""
|
209
142
|
---
|
@@ -225,21 +158,11 @@ Feature: update
|
|
225
158
|
Files added:
|
226
159
|
test
|
227
160
|
"""
|
228
|
-
|
229
|
-
|
161
|
+
And the file named "modules/fakenamespace/puppet-test/test" should contain "aruba"
|
162
|
+
And the puppet module "puppet-test" from "fakenamespace" should have no commits made by "Aruba"
|
230
163
|
|
231
164
|
Scenario: Adding a file that ERB can't parse
|
232
|
-
Given a
|
233
|
-
"""
|
234
|
-
---
|
235
|
-
- puppet-test
|
236
|
-
"""
|
237
|
-
And a file named "modulesync.yml" with:
|
238
|
-
"""
|
239
|
-
---
|
240
|
-
namespace: maestrodev
|
241
|
-
git_base: https://github.com/
|
242
|
-
"""
|
165
|
+
Given a basic setup with a puppet module "puppet-test" from "fakenamespace"
|
243
166
|
And a file named "config_defaults.yml" with:
|
244
167
|
"""
|
245
168
|
---
|
@@ -255,19 +178,10 @@ Feature: update
|
|
255
178
|
"""
|
256
179
|
When I run `msync update --noop`
|
257
180
|
Then the exit status should be 1
|
181
|
+
And the puppet module "puppet-test" from "fakenamespace" should have no commits made by "Aruba"
|
258
182
|
|
259
183
|
Scenario: Using skip_broken option with invalid files
|
260
|
-
Given a
|
261
|
-
"""
|
262
|
-
---
|
263
|
-
- puppet-test
|
264
|
-
"""
|
265
|
-
And a file named "modulesync.yml" with:
|
266
|
-
"""
|
267
|
-
---
|
268
|
-
namespace: maestrodev
|
269
|
-
git_base: https://github.com/
|
270
|
-
"""
|
184
|
+
Given a basic setup with a puppet module "puppet-test" from "fakenamespace"
|
271
185
|
And a file named "config_defaults.yml" with:
|
272
186
|
"""
|
273
187
|
---
|
@@ -283,19 +197,10 @@ Feature: update
|
|
283
197
|
"""
|
284
198
|
When I run `msync update --noop -s`
|
285
199
|
Then the exit status should be 0
|
200
|
+
And the puppet module "puppet-test" from "fakenamespace" should have no commits made by "Aruba"
|
286
201
|
|
287
202
|
Scenario: Using skip_broken and fail_on_warnings options with invalid files
|
288
|
-
Given a
|
289
|
-
"""
|
290
|
-
---
|
291
|
-
- puppet-test
|
292
|
-
"""
|
293
|
-
And a file named "modulesync.yml" with:
|
294
|
-
"""
|
295
|
-
---
|
296
|
-
namespace: maestrodev
|
297
|
-
git_base: https://github.com/
|
298
|
-
"""
|
203
|
+
Given a basic setup with a puppet module "puppet-test" from "fakenamespace"
|
299
204
|
And a file named "config_defaults.yml" with:
|
300
205
|
"""
|
301
206
|
---
|
@@ -311,18 +216,13 @@ Feature: update
|
|
311
216
|
"""
|
312
217
|
When I run `msync update --noop --skip_broken --fail_on_warnings`
|
313
218
|
Then the exit status should be 1
|
219
|
+
And the puppet module "puppet-test" from "fakenamespace" should have no commits made by "Aruba"
|
314
220
|
|
315
221
|
Scenario: Modifying an existing file
|
316
|
-
Given a
|
222
|
+
Given a basic setup with a puppet module "puppet-test" from "fakenamespace"
|
223
|
+
And the puppet module "puppet-test" from "fakenamespace" has a file named "Gemfile" with:
|
317
224
|
"""
|
318
|
-
|
319
|
-
- puppet-test
|
320
|
-
"""
|
321
|
-
And a file named "modulesync.yml" with:
|
322
|
-
"""
|
323
|
-
---
|
324
|
-
namespace: maestrodev
|
325
|
-
git_base: https://github.com/
|
225
|
+
source 'https://example.com'
|
326
226
|
"""
|
327
227
|
And a file named "config_defaults.yml" with:
|
328
228
|
"""
|
@@ -342,15 +242,18 @@ Feature: update
|
|
342
242
|
Files changed:
|
343
243
|
+diff --git a/Gemfile b/Gemfile
|
344
244
|
"""
|
345
|
-
|
346
|
-
Then the output should contain:
|
245
|
+
And the file named "modules/fakenamespace/puppet-test/Gemfile" should contain:
|
347
246
|
"""
|
348
247
|
source 'https://somehost.com'
|
349
248
|
"""
|
249
|
+
And the puppet module "puppet-test" from "fakenamespace" should have no commits made by "Aruba"
|
350
250
|
|
351
251
|
Scenario: Modifying an existing file and committing the change
|
352
|
-
Given a
|
353
|
-
And
|
252
|
+
Given a basic setup with a puppet module "puppet-test" from "fakenamespace"
|
253
|
+
And the puppet module "puppet-test" from "fakenamespace" has a file named "Gemfile" with:
|
254
|
+
"""
|
255
|
+
source 'https://example.com'
|
256
|
+
"""
|
354
257
|
And a file named "config_defaults.yml" with:
|
355
258
|
"""
|
356
259
|
---
|
@@ -364,30 +267,25 @@ Feature: update
|
|
364
267
|
"""
|
365
268
|
When I run `msync update -m "Update Gemfile" -r test`
|
366
269
|
Then the exit status should be 0
|
367
|
-
|
368
|
-
And
|
369
|
-
|
270
|
+
And the puppet module "puppet-test" from "fakenamespace" should have only 1 commit made by "Aruba"
|
271
|
+
And the puppet module "puppet-test" from "fakenamespace" should have 1 commit made by "Aruba" in branch "test"
|
272
|
+
And the puppet module "puppet-test" from "fakenamespace" should have a branch "test" with a file named "Gemfile" which contains:
|
370
273
|
"""
|
371
274
|
source 'https://somehost.com'
|
372
275
|
"""
|
373
276
|
|
374
277
|
Scenario: Setting an existing file to unmanaged
|
375
|
-
Given a
|
278
|
+
Given a basic setup with a puppet module "puppet-test" from "fakenamespace"
|
279
|
+
And the puppet module "puppet-test" from "fakenamespace" has a file named "Gemfile" with:
|
376
280
|
"""
|
377
|
-
|
378
|
-
- puppet-test
|
379
|
-
"""
|
380
|
-
And a file named "modulesync.yml" with:
|
381
|
-
"""
|
382
|
-
---
|
383
|
-
namespace: maestrodev
|
384
|
-
git_base: https://github.com/
|
281
|
+
source 'https://rubygems.org'
|
385
282
|
"""
|
386
283
|
And a file named "config_defaults.yml" with:
|
387
284
|
"""
|
388
285
|
---
|
389
286
|
Gemfile:
|
390
287
|
unmanaged: true
|
288
|
+
gem_source: https://somehost.com
|
391
289
|
"""
|
392
290
|
And a directory named "moduleroot"
|
393
291
|
And a file named "moduleroot/Gemfile.erb" with:
|
@@ -405,24 +303,14 @@ Feature: update
|
|
405
303
|
Not managing Gemfile in puppet-test
|
406
304
|
"""
|
407
305
|
And the exit status should be 0
|
408
|
-
|
409
|
-
Then the output should contain:
|
306
|
+
And the file named "modules/fakenamespace/puppet-test/Gemfile" should contain:
|
410
307
|
"""
|
411
308
|
source 'https://rubygems.org'
|
412
309
|
"""
|
310
|
+
And the puppet module "puppet-test" from "fakenamespace" should have no commits made by "Aruba"
|
413
311
|
|
414
312
|
Scenario: Setting an existing file to deleted
|
415
|
-
Given a
|
416
|
-
"""
|
417
|
-
---
|
418
|
-
- puppet-test
|
419
|
-
"""
|
420
|
-
And a file named "modulesync.yml" with:
|
421
|
-
"""
|
422
|
-
---
|
423
|
-
namespace: maestrodev
|
424
|
-
git_base: https://github.com/
|
425
|
-
"""
|
313
|
+
Given a basic setup with a puppet module "puppet-test" from "fakenamespace"
|
426
314
|
And a file named "config_defaults.yml" with:
|
427
315
|
"""
|
428
316
|
---
|
@@ -434,6 +322,10 @@ Feature: update
|
|
434
322
|
"""
|
435
323
|
source '<%= @configs['gem_source'] %>'
|
436
324
|
"""
|
325
|
+
And the puppet module "puppet-test" from "fakenamespace" has a file named "Gemfile" with:
|
326
|
+
"""
|
327
|
+
source 'https://rubygems.org'
|
328
|
+
"""
|
437
329
|
When I run `msync update --noop`
|
438
330
|
Then the output should match:
|
439
331
|
"""
|
@@ -442,19 +334,10 @@ Feature: update
|
|
442
334
|
deleted file mode 100644
|
443
335
|
"""
|
444
336
|
And the exit status should be 0
|
337
|
+
And the puppet module "puppet-test" from "fakenamespace" should have no commits made by "Aruba"
|
445
338
|
|
446
339
|
Scenario: Setting a non-existent file to deleted
|
447
|
-
Given a
|
448
|
-
"""
|
449
|
-
---
|
450
|
-
- puppet-test
|
451
|
-
"""
|
452
|
-
And a file named "modulesync.yml" with:
|
453
|
-
"""
|
454
|
-
---
|
455
|
-
namespace: maestrodev
|
456
|
-
git_base: https://github.com/
|
457
|
-
"""
|
340
|
+
Given a basic setup with a puppet module "puppet-test" from "fakenamespace"
|
458
341
|
And a file named "config_defaults.yml" with:
|
459
342
|
"""
|
460
343
|
---
|
@@ -464,19 +347,10 @@ Feature: update
|
|
464
347
|
And a directory named "moduleroot"
|
465
348
|
When I run `msync update -m 'deletes a file that doesnt exist!' -f puppet-test`
|
466
349
|
And the exit status should be 0
|
350
|
+
And the puppet module "puppet-test" from "fakenamespace" should have no commits made by "Aruba"
|
467
351
|
|
468
352
|
Scenario: Setting a directory to unmanaged
|
469
|
-
Given a
|
470
|
-
"""
|
471
|
-
---
|
472
|
-
- puppetlabs-apache
|
473
|
-
"""
|
474
|
-
And a file named "modulesync.yml" with:
|
475
|
-
"""
|
476
|
-
---
|
477
|
-
namespace: puppetlabs
|
478
|
-
git_base: https://github.com/
|
479
|
-
"""
|
353
|
+
Given a basic setup with a puppet module "puppet-apache" from "puppetlabs"
|
480
354
|
And a file named "config_defaults.yml" with:
|
481
355
|
"""
|
482
356
|
---
|
@@ -488,36 +362,26 @@ Feature: update
|
|
488
362
|
"""
|
489
363
|
some spec_helper fud
|
490
364
|
"""
|
491
|
-
And a directory named "modules/puppetlabs/
|
492
|
-
And a file named "modules/puppetlabs/
|
365
|
+
And a directory named "modules/puppetlabs/puppet-apache/spec"
|
366
|
+
And a file named "modules/puppetlabs/puppet-apache/spec/spec_helper.rb" with:
|
493
367
|
"""
|
494
368
|
This is a fake spec_helper!
|
495
369
|
"""
|
496
370
|
When I run `msync update --offline`
|
497
371
|
Then the output should contain:
|
498
372
|
"""
|
499
|
-
Not managing spec/spec_helper.rb in
|
373
|
+
Not managing spec/spec_helper.rb in puppet-apache
|
500
374
|
"""
|
501
375
|
And the exit status should be 0
|
502
|
-
|
503
|
-
Then the output should contain:
|
376
|
+
And the file named "modules/puppetlabs/puppet-apache/spec/spec_helper.rb" should contain:
|
504
377
|
"""
|
505
378
|
This is a fake spec_helper!
|
506
379
|
"""
|
507
380
|
And the exit status should be 0
|
381
|
+
And the puppet module "puppet-apache" from "puppetlabs" should have no commits made by "Aruba"
|
508
382
|
|
509
383
|
Scenario: Adding a new file in a new subdirectory
|
510
|
-
Given a
|
511
|
-
"""
|
512
|
-
---
|
513
|
-
- puppet-test
|
514
|
-
"""
|
515
|
-
And a file named "modulesync.yml" with:
|
516
|
-
"""
|
517
|
-
---
|
518
|
-
namespace: maestrodev
|
519
|
-
git_base: https://github.com/
|
520
|
-
"""
|
384
|
+
Given a basic setup with a puppet module "puppet-test" from "fakenamespace"
|
521
385
|
And a file named "config_defaults.yml" with:
|
522
386
|
"""
|
523
387
|
---
|
@@ -538,24 +402,14 @@ Feature: update
|
|
538
402
|
Files added:
|
539
403
|
spec/spec_helper.rb
|
540
404
|
"""
|
541
|
-
|
542
|
-
Then the output should contain:
|
405
|
+
And the file named "modules/fakenamespace/puppet-test/spec/spec_helper.rb" should contain:
|
543
406
|
"""
|
544
407
|
require 'puppetlabs_spec_helper/module_helper'
|
545
408
|
"""
|
409
|
+
And the puppet module "puppet-test" from "fakenamespace" should have no commits made by "Aruba"
|
546
410
|
|
547
411
|
Scenario: Updating offline
|
548
|
-
Given a
|
549
|
-
"""
|
550
|
-
---
|
551
|
-
- puppet-test
|
552
|
-
"""
|
553
|
-
And a file named "modulesync.yml" with:
|
554
|
-
"""
|
555
|
-
---
|
556
|
-
namespace: maestrodev
|
557
|
-
git_base: https://github.com/
|
558
|
-
"""
|
412
|
+
Given a basic setup with a puppet module "puppet-test" from "fakenamespace"
|
559
413
|
And a file named "config_defaults.yml" with:
|
560
414
|
"""
|
561
415
|
---
|
@@ -572,19 +426,15 @@ Feature: update
|
|
572
426
|
When I run `msync update --offline`
|
573
427
|
Then the exit status should be 0
|
574
428
|
And the output should not match /Files (changed|added|deleted):/
|
429
|
+
And the puppet module "puppet-test" from "fakenamespace" should have no commits made by "Aruba"
|
575
430
|
|
576
431
|
Scenario: Pulling a module that already exists in the modules directory
|
577
|
-
Given a
|
578
|
-
|
579
|
-
|
580
|
-
|
581
|
-
|
582
|
-
|
583
|
-
"""
|
584
|
-
---
|
585
|
-
git_base: https://github.com/
|
586
|
-
"""
|
587
|
-
And a file named "config_defaults.yml" with:
|
432
|
+
Given a basic setup with a puppet module "puppet-test" from "fakenamespace"
|
433
|
+
And a directory named "moduleroot"
|
434
|
+
When I run `msync update --message "First update run"`
|
435
|
+
Then the exit status should be 0
|
436
|
+
And the puppet module "puppet-test" from "fakenamespace" should have no commits made by "Aruba"
|
437
|
+
Given a file named "config_defaults.yml" with:
|
588
438
|
"""
|
589
439
|
---
|
590
440
|
spec/spec_helper.rb:
|
@@ -597,20 +447,6 @@ Feature: update
|
|
597
447
|
require '<%= required %>'
|
598
448
|
<% end %>
|
599
449
|
"""
|
600
|
-
Given I run `git init modules/maestrodev/puppet-test`
|
601
|
-
Given a file named "modules/maestrodev/puppet-test/.git/config" with:
|
602
|
-
"""
|
603
|
-
[core]
|
604
|
-
repositoryformatversion = 0
|
605
|
-
filemode = true
|
606
|
-
bare = false
|
607
|
-
logallrefupdates = true
|
608
|
-
ignorecase = true
|
609
|
-
precomposeunicode = true
|
610
|
-
[remote "origin"]
|
611
|
-
url = https://github.com/maestrodev/puppet-test.git
|
612
|
-
fetch = +refs/heads/*:refs/remotes/origin/*
|
613
|
-
"""
|
614
450
|
When I run `msync update --noop`
|
615
451
|
Then the exit status should be 0
|
616
452
|
And the output should match:
|
@@ -618,37 +454,23 @@ Feature: update
|
|
618
454
|
Files added:
|
619
455
|
spec/spec_helper.rb
|
620
456
|
"""
|
457
|
+
And the puppet module "puppet-test" from "fakenamespace" should have no commits made by "Aruba"
|
621
458
|
|
622
|
-
Scenario: When running update
|
623
|
-
Given a
|
624
|
-
"""
|
625
|
-
---
|
626
|
-
- puppet-test
|
627
|
-
"""
|
628
|
-
And a file named "modulesync.yml" with:
|
629
|
-
"""
|
630
|
-
---
|
631
|
-
namespace: maestrodev
|
632
|
-
git_base: https://github.com/
|
633
|
-
"""
|
459
|
+
Scenario: When running update without changes
|
460
|
+
Given a basic setup with a puppet module "puppet-test" from "fakenamespace"
|
634
461
|
And a directory named "moduleroot"
|
635
|
-
When I run `msync update --
|
462
|
+
When I run `msync update --message "Running without changes"`
|
636
463
|
Then the exit status should be 0
|
637
|
-
And the
|
464
|
+
And the puppet module "puppet-test" from "fakenamespace" should have no commits made by "Aruba"
|
638
465
|
|
639
466
|
Scenario: When specifying configurations in managed_modules.yml
|
640
|
-
Given a
|
467
|
+
Given a basic setup with a puppet module "puppet-test" from "fakenamespace"
|
468
|
+
And a file named "managed_modules.yml" with:
|
641
469
|
"""
|
642
470
|
---
|
643
471
|
puppet-test:
|
644
472
|
module_name: test
|
645
473
|
"""
|
646
|
-
And a file named "modulesync.yml" with:
|
647
|
-
"""
|
648
|
-
---
|
649
|
-
namespace: maestrodev
|
650
|
-
git_base: https://github.com/
|
651
|
-
"""
|
652
474
|
And a file named "config_defaults.yml" with:
|
653
475
|
"""
|
654
476
|
---
|
@@ -667,11 +489,14 @@ Feature: update
|
|
667
489
|
Files added:
|
668
490
|
test
|
669
491
|
"""
|
670
|
-
|
671
|
-
|
492
|
+
And the file named "modules/fakenamespace/puppet-test/test" should contain "aruba"
|
493
|
+
And the puppet module "puppet-test" from "fakenamespace" should have no commits made by "Aruba"
|
672
494
|
|
673
495
|
Scenario: When specifying configurations in managed_modules.yml and using a filter
|
674
|
-
Given a
|
496
|
+
Given a mocked git configuration
|
497
|
+
And a puppet module "puppet-test" from "fakenamespace"
|
498
|
+
And a puppet module "puppet-blacksmith" from "fakenamespace"
|
499
|
+
And a file named "managed_modules.yml" with:
|
675
500
|
"""
|
676
501
|
---
|
677
502
|
puppet-blacksmith:
|
@@ -681,9 +506,9 @@ Feature: update
|
|
681
506
|
And a file named "modulesync.yml" with:
|
682
507
|
"""
|
683
508
|
---
|
684
|
-
|
685
|
-
git_base: https://github.com/
|
509
|
+
namespace: fakenamespace
|
686
510
|
"""
|
511
|
+
And a git_base option appended to "modulesync.yml" for local tests
|
687
512
|
And a file named "config_defaults.yml" with:
|
688
513
|
"""
|
689
514
|
---
|
@@ -702,12 +527,15 @@ Feature: update
|
|
702
527
|
Files added:
|
703
528
|
test
|
704
529
|
"""
|
705
|
-
|
706
|
-
|
707
|
-
And
|
530
|
+
And the file named "modules/fakenamespace/puppet-test/test" should contain "aruba"
|
531
|
+
And a directory named "modules/fakenamespace/puppet-blacksmith" should not exist
|
532
|
+
And the puppet module "puppet-test" from "fakenamespace" should have no commits made by "Aruba"
|
708
533
|
|
709
534
|
Scenario: When specifying configurations in managed_modules.yml and using a negative filter
|
710
|
-
Given a
|
535
|
+
Given a mocked git configuration
|
536
|
+
And a puppet module "puppet-test" from "fakenamespace"
|
537
|
+
And a puppet module "puppet-blacksmith" from "fakenamespace"
|
538
|
+
And a file named "managed_modules.yml" with:
|
711
539
|
"""
|
712
540
|
---
|
713
541
|
puppet-blacksmith:
|
@@ -717,9 +545,9 @@ Feature: update
|
|
717
545
|
And a file named "modulesync.yml" with:
|
718
546
|
"""
|
719
547
|
---
|
720
|
-
|
721
|
-
git_base: https://github.com/
|
548
|
+
namespace: fakenamespace
|
722
549
|
"""
|
550
|
+
And a git_base option appended to "modulesync.yml" for local tests
|
723
551
|
And a file named "config_defaults.yml" with:
|
724
552
|
"""
|
725
553
|
---
|
@@ -738,21 +566,12 @@ Feature: update
|
|
738
566
|
Files added:
|
739
567
|
test
|
740
568
|
"""
|
741
|
-
|
742
|
-
|
743
|
-
And
|
569
|
+
And the file named "modules/fakenamespace/puppet-test/test" should contain "aruba"
|
570
|
+
And a directory named "modules/fakenamespace/puppet-blacksmith" should not exist
|
571
|
+
And the puppet module "puppet-test" from "fakenamespace" should have no commits made by "Aruba"
|
744
572
|
|
745
573
|
Scenario: Updating a module with a .sync.yml file
|
746
|
-
Given a
|
747
|
-
"""
|
748
|
-
---
|
749
|
-
- maestrodev/puppet-test
|
750
|
-
"""
|
751
|
-
And a file named "modulesync.yml" with:
|
752
|
-
"""
|
753
|
-
---
|
754
|
-
git_base: https://github.com/
|
755
|
-
"""
|
574
|
+
Given a basic setup with a puppet module "puppet-test" from "fakenamespace"
|
756
575
|
And a file named "config_defaults.yml" with:
|
757
576
|
"""
|
758
577
|
---
|
@@ -775,21 +594,7 @@ Feature: update
|
|
775
594
|
<%= @configs['global-to-overwrite'] %>
|
776
595
|
<%= @configs['module-default'] %>
|
777
596
|
"""
|
778
|
-
|
779
|
-
Given a file named "modules/maestrodev/puppet-test/.git/config" with:
|
780
|
-
"""
|
781
|
-
[core]
|
782
|
-
repositoryformatversion = 0
|
783
|
-
filemode = true
|
784
|
-
bare = false
|
785
|
-
logallrefupdates = true
|
786
|
-
ignorecase = true
|
787
|
-
precomposeunicode = true
|
788
|
-
[remote "origin"]
|
789
|
-
url = https://github.com/maestrodev/puppet-test.git
|
790
|
-
fetch = +refs/heads/*:refs/remotes/origin/*
|
791
|
-
"""
|
792
|
-
Given a file named "modules/maestrodev/puppet-test/.sync.yml" with:
|
597
|
+
And the puppet module "puppet-test" from "fakenamespace" has a file named ".sync.yml" with:
|
793
598
|
"""
|
794
599
|
---
|
795
600
|
:global:
|
@@ -804,16 +609,19 @@ Feature: update
|
|
804
609
|
"""
|
805
610
|
Not managing spec/spec_helper.rb in puppet-test
|
806
611
|
"""
|
807
|
-
|
808
|
-
Then the output should match:
|
612
|
+
And the file named "modules/fakenamespace/puppet-test/global-test.md" should contain:
|
809
613
|
"""
|
810
614
|
some-default
|
811
615
|
it-is-overwritten
|
812
616
|
some-value
|
813
617
|
"""
|
618
|
+
And the puppet module "puppet-test" from "fakenamespace" should have no commits made by "Aruba"
|
814
619
|
|
815
620
|
Scenario: Module with custom namespace
|
816
|
-
Given a
|
621
|
+
Given a mocked git configuration
|
622
|
+
And a puppet module "puppet-test" from "fakenamespace"
|
623
|
+
And a puppet module "puppet-lib-file_concat" from "electrical"
|
624
|
+
And a file named "managed_modules.yml" with:
|
817
625
|
"""
|
818
626
|
---
|
819
627
|
- puppet-test
|
@@ -822,9 +630,9 @@ Feature: update
|
|
822
630
|
And a file named "modulesync.yml" with:
|
823
631
|
"""
|
824
632
|
---
|
825
|
-
|
826
|
-
git_base: https://github.com/
|
633
|
+
namespace: fakenamespace
|
827
634
|
"""
|
635
|
+
And a git_base option appended to "modulesync.yml" for local tests
|
828
636
|
And a file named "config_defaults.yml" with:
|
829
637
|
"""
|
830
638
|
---
|
@@ -843,23 +651,13 @@ Feature: update
|
|
843
651
|
Files added:
|
844
652
|
test
|
845
653
|
"""
|
846
|
-
|
847
|
-
|
848
|
-
|
849
|
-
|
654
|
+
And the file named "modules/fakenamespace/puppet-test/.git/config" should match /^\s+url = .*fakenamespace.puppet-test$/
|
655
|
+
And the file named "modules/electrical/puppet-lib-file_concat/.git/config" should match /^\s+url = .*electrical.puppet-lib-file_concat$/
|
656
|
+
And the puppet module "puppet-test" from "fakenamespace" should have no commits made by "Aruba"
|
657
|
+
And the puppet module "puppet-lib-file_concat" from "electrical" should have no commits made by "Aruba"
|
850
658
|
|
851
659
|
Scenario: Modifying an existing file with values exposed by the module
|
852
|
-
Given a
|
853
|
-
"""
|
854
|
-
---
|
855
|
-
- puppet-test
|
856
|
-
"""
|
857
|
-
And a file named "modulesync.yml" with:
|
858
|
-
"""
|
859
|
-
---
|
860
|
-
namespace: maestrodev
|
861
|
-
git_base: https://github.com/
|
862
|
-
"""
|
660
|
+
Given a basic setup with a puppet module "puppet-test" from "fakenamespace"
|
863
661
|
And a file named "config_defaults.yml" with:
|
864
662
|
"""
|
865
663
|
---
|
@@ -868,7 +666,12 @@ Feature: update
|
|
868
666
|
And a directory named "moduleroot"
|
869
667
|
And a file named "moduleroot/README.md.erb" with:
|
870
668
|
"""
|
871
|
-
|
669
|
+
module: <%= @configs[:puppet_module] %>
|
670
|
+
namespace: <%= @configs[:namespace] %>
|
671
|
+
"""
|
672
|
+
And the puppet module "puppet-test" from "fakenamespace" has a file named "README.md" with:
|
673
|
+
"""
|
674
|
+
Hello world!
|
872
675
|
"""
|
873
676
|
When I run `msync update --noop`
|
874
677
|
Then the exit status should be 0
|
@@ -877,15 +680,15 @@ Feature: update
|
|
877
680
|
Files changed:
|
878
681
|
+diff --git a/README.md b/README.md
|
879
682
|
"""
|
880
|
-
|
881
|
-
Then the output should contain:
|
683
|
+
And the file named "modules/fakenamespace/puppet-test/README.md" should contain:
|
882
684
|
"""
|
883
|
-
|
685
|
+
module: puppet-test
|
686
|
+
namespace: fakenamespace
|
884
687
|
"""
|
688
|
+
And the puppet module "puppet-test" from "fakenamespace" should have no commits made by "Aruba"
|
885
689
|
|
886
690
|
Scenario: Running the same update twice and pushing to a remote branch
|
887
|
-
Given a
|
888
|
-
And a remote module repository
|
691
|
+
Given a basic setup with a puppet module "puppet-test" from "fakenamespace"
|
889
692
|
And a file named "config_defaults.yml" with:
|
890
693
|
"""
|
891
694
|
---
|
@@ -899,15 +702,18 @@ Feature: update
|
|
899
702
|
"""
|
900
703
|
When I run `msync update -m "Update Gemfile" -r test`
|
901
704
|
Then the exit status should be 0
|
705
|
+
And the puppet module "puppet-test" from "fakenamespace" should have only 1 commit made by "Aruba"
|
706
|
+
And the puppet module "puppet-test" from "fakenamespace" should have 1 commit made by "Aruba" in branch "test"
|
902
707
|
Given I remove the directory "modules"
|
903
708
|
When I run `msync update -m "Update Gemfile" -r test`
|
904
709
|
Then the exit status should be 0
|
905
710
|
Then the output should not contain "error"
|
906
711
|
Then the output should not contain "rejected"
|
712
|
+
And the puppet module "puppet-test" from "fakenamespace" should have only 1 commit made by "Aruba"
|
713
|
+
And the puppet module "puppet-test" from "fakenamespace" should have 1 commit made by "Aruba" in branch "test"
|
907
714
|
|
908
715
|
Scenario: Creating a GitHub PR with an update
|
909
|
-
Given a
|
910
|
-
And a remote module repository
|
716
|
+
Given a basic setup with a puppet module "puppet-test" from "fakenamespace"
|
911
717
|
And a directory named "moduleroot"
|
912
718
|
And I set the environment variables to:
|
913
719
|
| variable | value |
|
@@ -915,10 +721,10 @@ Feature: update
|
|
915
721
|
When I run `msync update --noop --branch managed_update --pr`
|
916
722
|
Then the output should contain "Would submit PR "
|
917
723
|
And the exit status should be 0
|
724
|
+
And the puppet module "puppet-test" from "fakenamespace" should have no commits made by "Aruba"
|
918
725
|
|
919
726
|
Scenario: Creating a GitLab MR with an update
|
920
|
-
Given a
|
921
|
-
And a remote module repository
|
727
|
+
Given a basic setup with a puppet module "puppet-test" from "fakenamespace"
|
922
728
|
And a directory named "moduleroot"
|
923
729
|
And I set the environment variables to:
|
924
730
|
| variable | value |
|
@@ -926,10 +732,11 @@ Feature: update
|
|
926
732
|
When I run `msync update --noop --branch managed_update --pr`
|
927
733
|
Then the output should contain "Would submit MR "
|
928
734
|
And the exit status should be 0
|
735
|
+
And the puppet module "puppet-test" from "fakenamespace" should have no commits made by "Aruba"
|
929
736
|
|
930
737
|
Scenario: Repository with a default branch other than master
|
931
|
-
Given a
|
932
|
-
And
|
738
|
+
Given a basic setup with a puppet module "puppet-test" from "fakenamespace"
|
739
|
+
And the puppet module "puppet-test" from "fakenamespace" has the default branch named "develop"
|
933
740
|
And a file named "config_defaults.yml" with:
|
934
741
|
"""
|
935
742
|
---
|
@@ -943,24 +750,16 @@ Feature: update
|
|
943
750
|
"""
|
944
751
|
When I run `msync update -m "Update Gemfile"`
|
945
752
|
Then the exit status should be 0
|
946
|
-
|
753
|
+
And the output should contain "Using repository's default branch: develop"
|
754
|
+
And the puppet module "puppet-test" from "fakenamespace" should have only 1 commit made by "Aruba"
|
755
|
+
And the puppet module "puppet-test" from "fakenamespace" should have 1 commit made by "Aruba" in branch "develop"
|
947
756
|
|
948
|
-
Scenario: Adding a new file from a template using
|
757
|
+
Scenario: Adding a new file from a template using metadata
|
758
|
+
Given a basic setup with a puppet module "puppet-test" from "fakenamespace"
|
949
759
|
And a file named "config_defaults.yml" with:
|
950
760
|
"""
|
951
761
|
---
|
952
762
|
"""
|
953
|
-
Given a file named "managed_modules.yml" with:
|
954
|
-
"""
|
955
|
-
---
|
956
|
-
- puppet-test
|
957
|
-
"""
|
958
|
-
And a file named "modulesync.yml" with:
|
959
|
-
"""
|
960
|
-
---
|
961
|
-
namespace: maestrodev
|
962
|
-
git_base: https://github.com/
|
963
|
-
"""
|
964
763
|
And a directory named "moduleroot"
|
965
764
|
And a file named "moduleroot/test.erb" with:
|
966
765
|
"""
|
@@ -970,10 +769,10 @@ Feature: update
|
|
970
769
|
"""
|
971
770
|
When I run `msync update --noop`
|
972
771
|
Then the exit status should be 0
|
973
|
-
|
974
|
-
Then the output should contain:
|
772
|
+
And the file named "modules/fakenamespace/puppet-test/test" should contain:
|
975
773
|
"""
|
976
774
|
module: puppet-test
|
977
|
-
target: modules/
|
978
|
-
workdir: modules/
|
775
|
+
target: modules/fakenamespace/puppet-test/test
|
776
|
+
workdir: modules/fakenamespace/puppet-test
|
979
777
|
"""
|
778
|
+
And the puppet module "puppet-test" from "fakenamespace" should have no commits made by "Aruba"
|