@@ -8,18 +8,26 @@ Feature: Create a pull-request/merge-request after update
8
8
puppet-test:
9
9
github: {}
10
10
"""
11
- And a directory named "moduleroot"
12
11
And I set the environment variables to:
13
12
| variable | value |
14
13
| GITHUB_TOKEN | foobar |
14
+ And a file named "config_defaults.yml" with:
15
+ """
16
+ ---
17
+ test:
18
+ name: aruba
19
+ """
20
+ And a file named "moduleroot/test.erb" with:
21
+ """
22
+ <%= @configs['name'] %>
23
+ """
15
24
When I run `msync update --noop --branch managed_update --pr`
16
25
Then the output should contain "Would submit PR "
17
26
And the exit status should be 0
18
27
And the puppet module "puppet-test" from "fakenamespace" should have no commits made by "Aruba"
19
28
20
29
Scenario : Run update in no-op mode and ask for GitLab MR
21
30
Given a basic setup with a puppet module "puppet-test" from "fakenamespace"
22
- And a directory named "moduleroot"
23
31
And a file named "managed_modules.yml" with:
24
32
"""
25
33
---
@@ -29,11 +37,38 @@ Feature: Create a pull-request/merge-request after update
29
37
And I set the environment variables to:
30
38
| variable | value |
31
39
| GITLAB_TOKEN | foobar |
40
+ And a file named "config_defaults.yml" with:
41
+ """
42
+ ---
43
+ test:
44
+ name: aruba
45
+ """
46
+ And a file named "moduleroot/test.erb" with:
47
+ """
48
+ <%= @configs['name'] %>
49
+ """
32
50
When I run `msync update --noop --branch managed_update --pr`
33
51
Then the output should contain "Would submit MR "
34
52
And the exit status should be 0
35
53
And the puppet module "puppet-test" from "fakenamespace" should have no commits made by "Aruba"
36
54
55
+ Scenario : Run update without changes in no-op mode and ask for GitLab MR
56
+ Given a basic setup with a puppet module "puppet-test" from "fakenamespace"
57
+ And a directory named "moduleroot"
58
+ And a file named "managed_modules.yml" with:
59
+ """
60
+ ---
61
+ puppet-test:
62
+ gitlab: {}
63
+ """
64
+ And I set the environment variables to:
65
+ | variable | value |
66
+ | GITLAB_TOKEN | foobar |
67
+ When I run `msync update --noop --branch managed_update --pr`
68
+ Then the output should not contain "Would submit MR "
69
+ And the exit status should be 0
70
+ And the puppet module "puppet-test" from "fakenamespace" should have no commits made by "Aruba"
71
+
37
72
Scenario : Ask for PR without credentials
38
73
Given a basic setup with a puppet module "puppet-test" from "fakenamespace"
39
74
And a file named "managed_modules.yml" with:
@@ -42,7 +77,16 @@ Feature: Create a pull-request/merge-request after update
42
77
puppet-test:
43
78
gitlab: {}
44
79
"""
45
- And a directory named "moduleroot"
80
+ And a file named "config_defaults.yml" with:
81
+ """
82
+ ---
83
+ test:
84
+ name: aruba
85
+ """
86
+ And a file named "moduleroot/test.erb" with:
87
+ """
88
+ <%= @configs['name'] %>
89
+ """
46
90
When I run `msync update --noop --pr`
47
91
Then the stderr should contain "No GitLab token specified to create a merge request"
48
92
And the exit status should be 1
@@ -61,7 +105,16 @@ Feature: Create a pull-request/merge-request after update
61
105
gitlab:
62
106
token: 'secret'
63
107
"""
64
- And a directory named "moduleroot"
108
+ And a file named "config_defaults.yml" with:
109
+ """
110
+ ---
111
+ test:
112
+ name: aruba
113
+ """
114
+ And a file named "moduleroot/test.erb" with:
115
+ """
116
+ <%= @configs['name'] %>
117
+ """
65
118
When I run `msync update --noop --branch managed_update --pr`
66
119
Then the exit status should be 0
67
120
And the output should contain "Would submit PR "
@@ -78,7 +131,16 @@ Feature: Create a pull-request/merge-request after update
78
131
gitlab:
79
132
token: 'secret'
80
133
"""
81
- And a directory named "moduleroot"
134
+ And a file named "config_defaults.yml" with:
135
+ """
136
+ ---
137
+ test:
138
+ name: aruba
139
+ """
140
+ And a file named "moduleroot/test.erb" with:
141
+ """
142
+ <%= @configs['name'] %>
143
+ """
82
144
When I run `msync update --noop --branch managed_update --pr --pr-target-branch managed_update`
83
145
Then the stderr should contain "Unable to open a pull request with the same source and target branch: 'managed_update'"
84
146
And the exit status should be 1
@@ -94,6 +156,16 @@ Feature: Create a pull-request/merge-request after update
94
156
github:
95
157
token: 'secret'
96
158
"""
159
+ And a file named "config_defaults.yml" with:
160
+ """
161
+ ---
162
+ test:
163
+ name: aruba
164
+ """
165
+ And a file named "moduleroot/test.erb" with:
166
+ """
167
+ <%= @configs['name'] %>
168
+ """
97
169
And a directory named "moduleroot"
98
170
When I run `msync update --noop --pr`
99
171
Then the stderr should contain "Unable to open a pull request with the same source and target branch: 'custom_default_branch'"
0 commit comments