/
gitcycle.feature
232 lines (214 loc) · 7.6 KB
/
gitcycle.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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
Feature: gitcycle
Scenario: No command given
When I execute gitcycle with nothing
Then gitcycle runs
And output includes "No command specified"
Scenario: Non-existent command
When I execute gitcycle with "blah blah"
Then gitcycle runs
And output includes "Command not recognized."
Scenario: Setup
When I execute gitcycle setup
Then gitcycle runs
And output includes "Configuration saved."
And gitcycle.yml should be valid
Scenario: Feature branch w/ custom branch name
Given a fresh set of repositories
And a new Lighthouse ticket
When I cd to the user repo
And I execute gitcycle with the Lighthouse ticket URL
And I enter "y"
And I enter "n"
And I enter "ticket.id-rename"
Then gitcycle runs
And output includes
"""
Retrieving branch information from gitcycle.
Your work will eventually merge into 'master'. Is this correct? (y/n)
Would you like to name your branch 'ticket.id'? (y/n)
What would you like to name your branch?
Adding remote repo 'config.owner/config.repo'.
Fetching remote 'config.owner'.
Checking out remote branch 'ticket.id-rename' from 'config.owner/config.repo/master'.
Fetching remote 'origin'.
Pushing 'origin/ticket.id-rename'.
Sending branch information to gitcycle.
"""
And redis entries valid
Scenario: Feature branch
Given a fresh set of repositories
And a new Lighthouse ticket
When I cd to the user repo
And I execute gitcycle with the Lighthouse ticket URL
And I enter "y"
And I enter "y"
Then gitcycle runs
And output includes
"""
Retrieving branch information from gitcycle.
Your work will eventually merge into 'master'. Is this correct? (y/n)
Would you like to name your branch 'ticket.id'? (y/n)
Adding remote repo 'config.owner/config.repo'.
Fetching remote 'config.owner'.
Checking out remote branch 'ticket.id' from 'config.owner/config.repo/master'.
Fetching remote 'origin'.
Pushing 'origin/ticket.id'.
Sending branch information to gitcycle.
"""
And redis entries valid
Scenario: Reset feature branch
Given a fresh set of repositories
When I cd to the user repo
And I execute gitcycle reset with the Lighthouse ticket URL
And I enter "y"
And I enter "y"
Then gitcycle runs
And output includes
"""
Retrieving branch information from gitcycle.
Your work will eventually merge into 'master'. Is this correct? (y/n)
Would you like to name your branch 'ticket.id'? (y/n)
Adding remote repo 'config.owner/config.repo'.
Fetching remote 'config.owner'.
Checking out remote branch 'ticket.id' from 'config.owner/config.repo/master'.
Fetching remote 'origin'.
Pulling 'origin/ticket.id'.
Pushing 'origin/ticket.id'.
Sending branch information to gitcycle.
"""
And redis entries valid
Scenario: Checkout via ticket w/ existing branch
When I cd to the user repo
And I execute gitcycle with the Lighthouse ticket URL
Then gitcycle runs
And output includes
"""
Retrieving branch information from gitcycle.
Checking out branch 'ticket.id'.
"""
And current branch is "ticket.id"
Scenario: Checkout via ticket w/ fresh repo
Given a fresh set of repositories
When I cd to the user repo
And I execute gitcycle with the Lighthouse ticket URL
Then gitcycle runs
And output includes
"""
Retrieving branch information from gitcycle.
Tracking branch 'origin/ticket.id'.
"""
And current branch is "ticket.id"
Scenario: Pull changes from upstream
When I cd to the owner repo
And I checkout master
And I commit something
And I cd to the user repo
And I checkout ticket.id
And I execute gitcycle with "pull"
Then gitcycle runs
And output includes
"""
Retrieving branch information from gitcycle.
Adding remote repo 'config.owner/config.repo'.
Fetching remote 'config.owner'.
Merging remote branch 'master' from 'config.owner/config.repo'.
"""
And git log should contain the last commit
Scenario: Discuss commits w/ no parameters and nothing committed
When I cd to the user repo
And I checkout ticket.id
And I execute gitcycle with "discuss"
Then gitcycle runs
And output includes
"""
Retrieving branch information from gitcycle.
Creating GitHub pull request.
You must push code before opening a pull request.
"""
And redis entries valid
Scenario: Discuss commits w/ no parameters and something committed
When I cd to the user repo
And I checkout ticket.id
And I commit something
And I execute gitcycle with "discuss"
Then gitcycle runs
And output includes
"""
Retrieving branch information from gitcycle.
Creating GitHub pull request.
"""
And output includes "Opening issue" with URL
And URL is a valid issue
And redis entries valid
Scenario: Discuss commits w/ parameters
When I cd to the user repo
And I checkout ticket.id
And I execute gitcycle with "discuss issue.id"
Then gitcycle runs
And output includes "Retrieving branch information from gitcycle."
And output does not include "Creating GitHub pull request."
And output does not include "Branch not found."
And output does not include "You must push code before opening a pull request."
And output includes "Opening issue" with URL
And URL is a valid issue
Scenario: Ready issue w/ no parameters
When I cd to the user repo
And I checkout ticket.id
And I execute gitcycle with "ready"
Then gitcycle runs
And output includes
"""
Retrieving branch information from gitcycle.
Adding remote repo 'config.owner/config.repo'.
Fetching remote 'config.owner'.
Merging remote branch 'master' from 'config.owner/config.repo'.
Retrieving branch information from gitcycle.
Labeling issue as 'Pending Review'.
"""
Scenario: Ready issue w/ parameters
When I cd to the user repo
And I execute gitcycle with "ready issue.id"
Then gitcycle runs
And output includes "Labeling issues as 'Pending Review'."
Scenario: Reviewed issue w/ no parameters
When I cd to the user repo
And I checkout ticket.id
And I execute gitcycle with "reviewed"
Then gitcycle runs
And output includes "Labeling issue as 'Pending QA'."
Scenario: Reviewed issue w/ parameters
When I cd to the user repo
And I execute gitcycle with "reviewed issue.id"
Then gitcycle runs
And output includes "Labeling issues as 'Pending QA'."
Scenario: QA issue
When I cd to the owner repo
And I checkout master
And I execute gitcycle with "qa issue.id"
Then gitcycle runs
And output includes
"""
Retrieving branch information from gitcycle.
Deleting old QA branch 'qa_master'.
Adding remote repo 'config.owner/config.repo'.
Fetching remote 'config.owner'.
Checking out remote branch 'qa_master' from 'config.owner/config.repo/master'.
Fetching remote 'origin'.
Pushing 'origin/qa_master'.
Adding remote repo 'config.user/config.repo'.
Fetching remote 'config.user'.
Merging remote branch 'ticket.id' from 'config.user/config.repo'.
Pushing branch 'qa_master'.
Type 'gitc qa pass' to approve all issues in this branch.
Type 'gitc qa fail' to reject all issues in this branch.
"""
Scenario: QA issue list
When I cd to the owner repo
And I checkout master
And I execute gitcycle with "qa"
Then gitcycle runs
And output includes
"""
qa_master
issue #issue.id\tconfig.user/ticket.id
"""