Repository navigation
Expand file tree
/
Copy pathupdate.feature
More file actions
144 lines (129 loc) · 4.39 KB
/
Copy pathupdate.feature
File metadata and controls
144 lines (129 loc) · 4.39 KB
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
@announce
Feature: Automatically add, commit, and push multiple repos
This task will run:
repo add -A, repo commit, and repo push on all dirty repos
Examples
Interactive
repo action:update
Non-interactive
repo action:update --force
Filter repos
repo action:update --repos=repo1,repo2
Background: Test repositories and a valid config file
Given a repo in folder "test_path_1" with the following:
| filename | status | content |
| .gitignore | C | |
And a repo in folder "test_path_2" with the following:
| filename | status | content |
| .gitignore | C | |
And a file named "repo.conf" with:
"""
---
folders:
assets : repo/asset/configuration/files
tasks : ../../tasks
commands:
- status
- log
- add
- commit
- push
"""
And the folder "repo/asset/configuration/files" with the following asset configurations:
| name | path |
| test1 | test_path_1 |
| test2 | test_path_2 |
Scenario: No uncommitted changes
When I run `repo action:update`
Then its output should contain:
"""
no changed repos
"""
Scenario: Uncommitted changes filtered out with the '--repos' param
Given a repo in folder "test_path_1" with the following:
| filename | status | content |
| .gitignore | M | tmp/* |
And a repo in folder "test_path_2" with the following:
| filename | status | content |
| .gitignore | M | tmp/* |
| test | ? | test |
And a repo in folder "my_clean_repo" with the following:
| filename | status | content |
| .gitignore | C | tmp/* |
When I run `repo action:update --force --repos=my_clean_repo`
Then its output should contain:
"""
no changed repos
"""
Scenario: Uncommitted changes in multiple repos, non-interactive, custom commit message
Given a repo in folder "test_path_1" with the following:
| filename | status | content |
| .gitignore | M | tmp/* |
And a repo in folder "test_path_2" with the following:
| filename | status | content |
| .gitignore | M | tmp/* |
| test | ? | test |
And the repo in folder "test_path_1" has a remote named "origin" in folder "test_path_1.remote.git"
And the repo in folder "test_path_2" has a remote named "origin" in folder "test_path_2.remote.git"
When I run `repo action:update --force --message="my custom commit message"`
Then its output should contain:
"""
updating test1,test2
"""
And its output should contain:
"""
update finished
"""
And its output should not contain:
"""
failed
"""
When I run `repo status --no-verbose`
Then the exit status should be 0
When I run `repo --no-verbose git log -1 --pretty=format:'%s' --repos test1`
Then its output should contain:
"""
my custom commit message
"""
Then its output should not contain:
"""
automatic commit
"""
When I run `repo push --no-verbose --repos test1`
Then its output should contain:
"""
up-to-date
"""
@slow_process
Scenario: Uncommitted changes in a single repo, interactive prompt to continue
And a repo in folder "test_path_2" with the following:
| filename | status | content |
| .gitignore | M | tmp/* |
| test | ? | test |
And the repo in folder "test_path_2" has a remote named "origin" in folder "test_path_2.remote.git"
When I run `repo action:update` interactively
And I type "y"
Then its output should contain:
"""
updating test2
"""
And its output should contain:
"""
update finished
"""
And its output should not contain:
"""
failed
"""
When I run `repo status --no-verbose`
Then the exit status should be 0
When I run `repo --no-verbose git log -1 --pretty=format:'%s' --repos test2`
Then its output should contain:
"""
automatic commit
"""
When I run `repo push --no-verbose --repos test2`
Then its output should contain:
"""
up-to-date
"""