Blame


1 5565365c 2024-03-27 op #!/bin/sh
2 5565365c 2024-03-27 op #
3 5565365c 2024-03-27 op # Copyright (c) 2024 Omar Polo <op@openbsd.org>
4 5565365c 2024-03-27 op #
5 5565365c 2024-03-27 op # Permission to use, copy, modify, and distribute this software for any
6 5565365c 2024-03-27 op # purpose with or without fee is hereby granted, provided that the above
7 5565365c 2024-03-27 op # copyright notice and this permission notice appear in all copies.
8 5565365c 2024-03-27 op #
9 5565365c 2024-03-27 op # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 5565365c 2024-03-27 op # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 5565365c 2024-03-27 op # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 5565365c 2024-03-27 op # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 5565365c 2024-03-27 op # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 5565365c 2024-03-27 op # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 5565365c 2024-03-27 op # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 5565365c 2024-03-27 op
17 5565365c 2024-03-27 op . ../cmdline/common.sh
18 5565365c 2024-03-27 op . ./common.sh
19 5565365c 2024-03-27 op
20 050c0b8c 2024-04-16 op # flan:password encoded in base64
21 050c0b8c 2024-04-16 op AUTH="ZmxhbjpwYXNzd29yZA=="
22 050c0b8c 2024-04-16 op
23 5565365c 2024-03-27 op test_file_changed() {
24 5565365c 2024-03-27 op local testroot=`test_init file_changed 1`
25 5565365c 2024-03-27 op
26 5565365c 2024-03-27 op got clone -a -q ${GOTD_TEST_REPO_URL} $testroot/repo-clone
27 5565365c 2024-03-27 op ret=$?
28 5565365c 2024-03-27 op if [ $ret -ne 0 ]; then
29 5565365c 2024-03-27 op echo "got clone failed unexpectedly" >&2
30 5565365c 2024-03-27 op test_done "$testroot" 1
31 5565365c 2024-03-27 op return 1
32 5565365c 2024-03-27 op fi
33 5565365c 2024-03-27 op
34 5565365c 2024-03-27 op got checkout -q $testroot/repo-clone $testroot/wt >/dev/null
35 5565365c 2024-03-27 op ret=$?
36 5565365c 2024-03-27 op if [ $ret -ne 0 ]; then
37 5565365c 2024-03-27 op echo "got checkout failed unexpectedly" >&2
38 5565365c 2024-03-27 op test_done "$testroot" 1
39 5565365c 2024-03-27 op return 1
40 5565365c 2024-03-27 op fi
41 5565365c 2024-03-27 op
42 5565365c 2024-03-27 op echo "change alpha" > $testroot/wt/alpha
43 5565365c 2024-03-27 op (cd $testroot/wt && got commit -m 'make changes' > /dev/null)
44 5565365c 2024-03-27 op local commit_id=`git_show_head $testroot/repo-clone`
45 5565365c 2024-03-27 op local author_time=`git_show_author_time $testroot/repo-clone`
46 5565365c 2024-03-27 op
47 050c0b8c 2024-04-16 op timeout 5 ./http-server -a $AUTH -p $GOTD_TEST_HTTP_PORT \
48 5565365c 2024-03-27 op > $testroot/stdout &
49 5565365c 2024-03-27 op
50 5565365c 2024-03-27 op got send -b main -q -r $testroot/repo-clone
51 5565365c 2024-03-27 op ret=$?
52 5565365c 2024-03-27 op if [ $ret -ne 0 ]; then
53 5565365c 2024-03-27 op echo "got send failed unexpectedly" >&2
54 5565365c 2024-03-27 op test_done "$testroot" "1"
55 5565365c 2024-03-27 op return 1
56 5565365c 2024-03-27 op fi
57 5565365c 2024-03-27 op
58 5565365c 2024-03-27 op wait %1 # wait for the http "server"
59 5565365c 2024-03-27 op
60 87890bc2 2024-03-28 op touch "$testroot/stdout.expected"
61 87890bc2 2024-03-28 op ed -s "$testroot/stdout.expected" <<-EOF
62 87890bc2 2024-03-28 op a
63 87890bc2 2024-03-28 op {"notifications":[{
64 93623901 2024-03-28 op "type":"commit",
65 87890bc2 2024-03-28 op "short":false,
66 c1003102 2024-04-15 op "repo":"test-repo",
67 841969e1 2024-04-30 op "authenticated_user":"${GOTD_DEVUSER}",
68 87890bc2 2024-03-28 op "id":"$commit_id",
69 ac0a4dfc 2024-03-28 op "author":{
70 ac0a4dfc 2024-03-28 op "full":"$GOT_AUTHOR",
71 ac0a4dfc 2024-03-28 op "name":"$GIT_AUTHOR_NAME",
72 ac0a4dfc 2024-03-28 op "mail":"$GIT_AUTHOR_EMAIL",
73 ac0a4dfc 2024-03-28 op "user":"$GOT_AUTHOR_11"
74 ac0a4dfc 2024-03-28 op },
75 ac0a4dfc 2024-03-28 op "committer":{
76 ac0a4dfc 2024-03-28 op "full":"$GOT_AUTHOR",
77 ac0a4dfc 2024-03-28 op "name":"$GIT_AUTHOR_NAME",
78 ac0a4dfc 2024-03-28 op "mail":"$GIT_AUTHOR_EMAIL",
79 ac0a4dfc 2024-03-28 op "user":"$GOT_AUTHOR_11"
80 ac0a4dfc 2024-03-28 op },
81 939d3016 2024-04-23 op "date":$author_time,
82 ac0a4dfc 2024-03-28 op "short_message":"make changes",
83 87890bc2 2024-03-28 op "message":"make changes\n",
84 763b7f49 2024-03-28 op "diffstat":{
85 763b7f49 2024-03-28 op "files":[{
86 763b7f49 2024-03-28 op "action":"modified",
87 763b7f49 2024-03-28 op "file":"alpha",
88 763b7f49 2024-03-28 op "added":1,
89 763b7f49 2024-03-28 op "removed":1
90 763b7f49 2024-03-28 op }],
91 763b7f49 2024-03-28 op "total":{
92 763b7f49 2024-03-28 op "added":1,
93 763b7f49 2024-03-28 op "removed":1
94 763b7f49 2024-03-28 op }
95 763b7f49 2024-03-28 op }
96 ea5e974d 2024-03-28 op }]}
97 ea5e974d 2024-03-28 op .
98 ea5e974d 2024-03-28 op ,j
99 ea5e974d 2024-03-28 op w
100 ea5e974d 2024-03-28 op EOF
101 ea5e974d 2024-03-28 op
102 ea5e974d 2024-03-28 op cmp -s $testroot/stdout.expected $testroot/stdout
103 ea5e974d 2024-03-28 op ret=$?
104 ea5e974d 2024-03-28 op if [ $ret -ne 0 ]; then
105 ea5e974d 2024-03-28 op diff -u $testroot/stdout.expected $testroot/stdout
106 ea5e974d 2024-03-28 op test_done "$testroot" "$ret"
107 ea5e974d 2024-03-28 op return 1
108 ea5e974d 2024-03-28 op fi
109 c3cc85a3 2024-04-30 stsp
110 c3cc85a3 2024-04-30 stsp # Try the same thing again with 'git push' instead of 'got send'
111 c3cc85a3 2024-04-30 stsp echo "change alpha once more" > $testroot/wt/alpha
112 c3cc85a3 2024-04-30 stsp (cd $testroot/wt && got commit -m 'make more changes' > /dev/null)
113 c3cc85a3 2024-04-30 stsp local commit_id=`git_show_head $testroot/repo-clone`
114 c3cc85a3 2024-04-30 stsp local author_time=`git_show_author_time $testroot/repo-clone`
115 c3cc85a3 2024-04-30 stsp
116 c3cc85a3 2024-04-30 stsp timeout 5 ./http-server -a $AUTH -p $GOTD_TEST_HTTP_PORT \
117 c3cc85a3 2024-04-30 stsp > $testroot/stdout &
118 c3cc85a3 2024-04-30 stsp
119 c3cc85a3 2024-04-30 stsp git -C $testroot/repo-clone push -q origin main
120 c3cc85a3 2024-04-30 stsp ret=$?
121 c3cc85a3 2024-04-30 stsp if [ $ret -ne 0 ]; then
122 c3cc85a3 2024-04-30 stsp echo "git push failed unexpectedly" >&2
123 c3cc85a3 2024-04-30 stsp test_done "$testroot" "1"
124 c3cc85a3 2024-04-30 stsp return 1
125 c3cc85a3 2024-04-30 stsp fi
126 c3cc85a3 2024-04-30 stsp
127 c3cc85a3 2024-04-30 stsp wait %1 # wait for the http "server"
128 c3cc85a3 2024-04-30 stsp
129 c3cc85a3 2024-04-30 stsp echo -n > "$testroot/stdout.expected"
130 c3cc85a3 2024-04-30 stsp ed -s "$testroot/stdout.expected" <<-EOF
131 c3cc85a3 2024-04-30 stsp a
132 c3cc85a3 2024-04-30 stsp {"notifications":[{
133 c3cc85a3 2024-04-30 stsp "type":"commit",
134 c3cc85a3 2024-04-30 stsp "short":false,
135 c3cc85a3 2024-04-30 stsp "repo":"test-repo",
136 841969e1 2024-04-30 op "authenticated_user":"${GOTD_DEVUSER}",
137 c3cc85a3 2024-04-30 stsp "id":"$commit_id",
138 c3cc85a3 2024-04-30 stsp "author":{
139 c3cc85a3 2024-04-30 stsp "full":"$GOT_AUTHOR",
140 c3cc85a3 2024-04-30 stsp "name":"$GIT_AUTHOR_NAME",
141 c3cc85a3 2024-04-30 stsp "mail":"$GIT_AUTHOR_EMAIL",
142 c3cc85a3 2024-04-30 stsp "user":"$GOT_AUTHOR_11"
143 c3cc85a3 2024-04-30 stsp },
144 c3cc85a3 2024-04-30 stsp "committer":{
145 c3cc85a3 2024-04-30 stsp "full":"$GOT_AUTHOR",
146 c3cc85a3 2024-04-30 stsp "name":"$GIT_AUTHOR_NAME",
147 c3cc85a3 2024-04-30 stsp "mail":"$GIT_AUTHOR_EMAIL",
148 c3cc85a3 2024-04-30 stsp "user":"$GOT_AUTHOR_11"
149 c3cc85a3 2024-04-30 stsp },
150 c3cc85a3 2024-04-30 stsp "date":$author_time,
151 c3cc85a3 2024-04-30 stsp "short_message":"make more changes",
152 c3cc85a3 2024-04-30 stsp "message":"make more changes\n",
153 c3cc85a3 2024-04-30 stsp "diffstat":{
154 c3cc85a3 2024-04-30 stsp "files":[{
155 c3cc85a3 2024-04-30 stsp "action":"modified",
156 c3cc85a3 2024-04-30 stsp "file":"alpha",
157 c3cc85a3 2024-04-30 stsp "added":1,
158 c3cc85a3 2024-04-30 stsp "removed":1
159 c3cc85a3 2024-04-30 stsp }],
160 c3cc85a3 2024-04-30 stsp "total":{
161 c3cc85a3 2024-04-30 stsp "added":1,
162 c3cc85a3 2024-04-30 stsp "removed":1
163 c3cc85a3 2024-04-30 stsp }
164 c3cc85a3 2024-04-30 stsp }
165 c3cc85a3 2024-04-30 stsp }]}
166 c3cc85a3 2024-04-30 stsp .
167 c3cc85a3 2024-04-30 stsp ,j
168 c3cc85a3 2024-04-30 stsp w
169 c3cc85a3 2024-04-30 stsp EOF
170 ea5e974d 2024-03-28 op
171 c3cc85a3 2024-04-30 stsp cmp -s $testroot/stdout.expected $testroot/stdout
172 c3cc85a3 2024-04-30 stsp ret=$?
173 c3cc85a3 2024-04-30 stsp if [ $ret -ne 0 ]; then
174 c3cc85a3 2024-04-30 stsp diff -u $testroot/stdout.expected $testroot/stdout
175 c3cc85a3 2024-04-30 stsp fi
176 ea5e974d 2024-03-28 op test_done "$testroot" "$ret"
177 ea5e974d 2024-03-28 op }
178 ea5e974d 2024-03-28 op
179 ea5e974d 2024-03-28 op test_bad_utf8() {
180 ea5e974d 2024-03-28 op local testroot=`test_init bad_utf8 1`
181 ea5e974d 2024-03-28 op
182 ea5e974d 2024-03-28 op got clone -a -q ${GOTD_TEST_REPO_URL} $testroot/repo-clone
183 ea5e974d 2024-03-28 op ret=$?
184 ea5e974d 2024-03-28 op if [ $ret -ne 0 ]; then
185 ea5e974d 2024-03-28 op echo "got clone failed unexpectedly" >&2
186 ea5e974d 2024-03-28 op test_done "$testroot" 1
187 ea5e974d 2024-03-28 op return 1
188 ea5e974d 2024-03-28 op fi
189 ea5e974d 2024-03-28 op
190 ea5e974d 2024-03-28 op got checkout -q $testroot/repo-clone $testroot/wt >/dev/null
191 ea5e974d 2024-03-28 op ret=$?
192 ea5e974d 2024-03-28 op if [ $ret -ne 0 ]; then
193 ea5e974d 2024-03-28 op echo "got checkout failed unexpectedly" >&2
194 ea5e974d 2024-03-28 op test_done "$testroot" 1
195 ea5e974d 2024-03-28 op fi
196 ea5e974d 2024-03-28 op
197 cdaefb15 2024-03-28 stsp # invalid utf8 sequence
198 ea5e974d 2024-03-28 op commit_msg="make$(printf '\xED\xA0\x80')changes"
199 ea5e974d 2024-03-28 op
200 ea5e974d 2024-03-28 op echo "changed" > $testroot/wt/alpha
201 ea5e974d 2024-03-28 op (cd $testroot/wt && got commit -m "$commit_msg" > /dev/null)
202 ea5e974d 2024-03-28 op local commit_id=`git_show_head $testroot/repo-clone`
203 ea5e974d 2024-03-28 op local author_time=`git_show_author_time $testroot/repo-clone`
204 ea5e974d 2024-03-28 op
205 050c0b8c 2024-04-16 op timeout 5 ./http-server -a $AUTH -p $GOTD_TEST_HTTP_PORT \
206 ea5e974d 2024-03-28 op > $testroot/stdout &
207 ea5e974d 2024-03-28 op
208 ea5e974d 2024-03-28 op got send -b main -q -r $testroot/repo-clone
209 ea5e974d 2024-03-28 op ret=$?
210 ea5e974d 2024-03-28 op if [ $ret -ne 0 ]; then
211 ea5e974d 2024-03-28 op echo "got send failed unexpectedly" >&2
212 ea5e974d 2024-03-28 op test_done "$testroot" "1"
213 ea5e974d 2024-03-28 op return 1
214 ea5e974d 2024-03-28 op fi
215 ea5e974d 2024-03-28 op
216 ea5e974d 2024-03-28 op wait %1 # wait for the http "server"
217 ea5e974d 2024-03-28 op
218 ea5e974d 2024-03-28 op touch "$testroot/stdout.expected"
219 ea5e974d 2024-03-28 op ed -s "$testroot/stdout.expected" <<-EOF
220 ea5e974d 2024-03-28 op a
221 ea5e974d 2024-03-28 op {"notifications":[{
222 93623901 2024-03-28 op "type":"commit",
223 ea5e974d 2024-03-28 op "short":false,
224 c1003102 2024-04-15 op "repo":"test-repo",
225 841969e1 2024-04-30 op "authenticated_user":"${GOTD_DEVUSER}",
226 ea5e974d 2024-03-28 op "id":"$commit_id",
227 ac0a4dfc 2024-03-28 op "author":{
228 ac0a4dfc 2024-03-28 op "full":"$GOT_AUTHOR",
229 ac0a4dfc 2024-03-28 op "name":"$GIT_AUTHOR_NAME",
230 ac0a4dfc 2024-03-28 op "mail":"$GIT_AUTHOR_EMAIL",
231 ac0a4dfc 2024-03-28 op "user":"$GOT_AUTHOR_11"
232 ac0a4dfc 2024-03-28 op },
233 ac0a4dfc 2024-03-28 op "committer":{
234 ac0a4dfc 2024-03-28 op "full":"$GOT_AUTHOR",
235 ac0a4dfc 2024-03-28 op "name":"$GIT_AUTHOR_NAME",
236 ac0a4dfc 2024-03-28 op "mail":"$GIT_AUTHOR_EMAIL",
237 ac0a4dfc 2024-03-28 op "user":"$GOT_AUTHOR_11"
238 ac0a4dfc 2024-03-28 op },
239 939d3016 2024-04-23 op "date":$author_time,
240 ac0a4dfc 2024-03-28 op "short_message":"make\uFFFD\uFFFDchanges",
241 ea5e974d 2024-03-28 op "message":"make\uFFFD\uFFFDchanges\n",
242 763b7f49 2024-03-28 op "diffstat":{
243 763b7f49 2024-03-28 op "files":[{
244 763b7f49 2024-03-28 op "action":"modified",
245 763b7f49 2024-03-28 op "file":"alpha",
246 763b7f49 2024-03-28 op "added":1,
247 763b7f49 2024-03-28 op "removed":1
248 763b7f49 2024-03-28 op }],
249 763b7f49 2024-03-28 op "total":{
250 763b7f49 2024-03-28 op "added":1,
251 763b7f49 2024-03-28 op "removed":1
252 763b7f49 2024-03-28 op }
253 763b7f49 2024-03-28 op }
254 87890bc2 2024-03-28 op }]}
255 87890bc2 2024-03-28 op .
256 87890bc2 2024-03-28 op ,j
257 87890bc2 2024-03-28 op w
258 5565365c 2024-03-27 op EOF
259 5565365c 2024-03-27 op
260 5565365c 2024-03-27 op cmp -s $testroot/stdout.expected $testroot/stdout
261 5565365c 2024-03-27 op ret=$?
262 5565365c 2024-03-27 op if [ $ret -ne 0 ]; then
263 5565365c 2024-03-27 op diff -u $testroot/stdout.expected $testroot/stdout
264 5565365c 2024-03-27 op test_done "$testroot" "$ret"
265 5565365c 2024-03-27 op return 1
266 5565365c 2024-03-27 op fi
267 5565365c 2024-03-27 op
268 5565365c 2024-03-27 op test_done "$testroot" "$ret"
269 5565365c 2024-03-27 op }
270 5565365c 2024-03-27 op
271 5565365c 2024-03-27 op test_many_commits_not_summarized() {
272 5565365c 2024-03-27 op local testroot=`test_init many_commits_not_summarized 1`
273 5565365c 2024-03-27 op
274 5565365c 2024-03-27 op got clone -a -q ${GOTD_TEST_REPO_URL} $testroot/repo-clone
275 5565365c 2024-03-27 op ret=$?
276 5565365c 2024-03-27 op if [ $ret -ne 0 ]; then
277 5565365c 2024-03-27 op echo "got clone failed unexpectedly" >&2
278 5565365c 2024-03-27 op test_done "$testroot" 1
279 5565365c 2024-03-27 op return 1
280 5565365c 2024-03-27 op fi
281 5565365c 2024-03-27 op
282 5565365c 2024-03-27 op got checkout -q $testroot/repo-clone $testroot/wt >/dev/null
283 5565365c 2024-03-27 op ret=$?
284 5565365c 2024-03-27 op if [ $ret -ne 0 ]; then
285 5565365c 2024-03-27 op echo "got checkout failed unexpectedly" >&2
286 5565365c 2024-03-27 op test_done "$testroot" 1
287 5565365c 2024-03-27 op return 1
288 5565365c 2024-03-27 op fi
289 5565365c 2024-03-27 op
290 5565365c 2024-03-27 op for i in `seq 1 24`; do
291 5565365c 2024-03-27 op echo "alpha $i" > $testroot/wt/alpha
292 5565365c 2024-03-27 op (cd $testroot/wt && got commit -m 'make changes' > /dev/null)
293 5565365c 2024-03-27 op local commit_id=`git_show_head $testroot/repo-clone`
294 5565365c 2024-03-27 op local author_time=`git_show_author_time $testroot/repo-clone`
295 939d3016 2024-04-23 op set -- "$@" "$commit_id $author_time"
296 5565365c 2024-03-27 op done
297 5565365c 2024-03-27 op
298 050c0b8c 2024-04-16 op timeout 5 ./http-server -a $AUTH -p "$GOTD_TEST_HTTP_PORT" \
299 5565365c 2024-03-27 op > $testroot/stdout &
300 5565365c 2024-03-27 op
301 5565365c 2024-03-27 op got send -b main -q -r $testroot/repo-clone
302 5565365c 2024-03-27 op ret=$?
303 5565365c 2024-03-27 op if [ $ret -ne 0 ]; then
304 5565365c 2024-03-27 op echo "got send failed unexpectedly" >&2
305 5565365c 2024-03-27 op test_done "$testroot" "1"
306 5565365c 2024-03-27 op return 1
307 5565365c 2024-03-27 op fi
308 5565365c 2024-03-27 op
309 5565365c 2024-03-27 op wait %1 # wait for the http "server"
310 5565365c 2024-03-27 op
311 9e88f9d9 2024-03-28 op printf '{"notifications":[' > $testroot/stdout.expected
312 5565365c 2024-03-27 op comma=""
313 5565365c 2024-03-27 op for i in `seq 1 24`; do
314 5565365c 2024-03-27 op s=`pop_idx $i "$@"`
315 5565365c 2024-03-27 op commit_id=$(echo $s | cut -d' ' -f1)
316 166674b8 2024-04-09 stsp commit_time=$(echo "$s" | sed -e "s/^$commit_id //g")
317 87890bc2 2024-03-28 op
318 87890bc2 2024-03-28 op echo "$comma"
319 87890bc2 2024-03-28 op comma=','
320 87890bc2 2024-03-28 op
321 87890bc2 2024-03-28 op cat <<-EOF
322 87890bc2 2024-03-28 op {
323 93623901 2024-03-28 op "type":"commit",
324 87890bc2 2024-03-28 op "short":false,
325 c1003102 2024-04-15 op "repo":"test-repo",
326 841969e1 2024-04-30 op "authenticated_user":"${GOTD_DEVUSER}",
327 87890bc2 2024-03-28 op "id":"$commit_id",
328 ac0a4dfc 2024-03-28 op "author":{
329 ac0a4dfc 2024-03-28 op "full":"$GOT_AUTHOR",
330 ac0a4dfc 2024-03-28 op "name":"$GIT_AUTHOR_NAME",
331 ac0a4dfc 2024-03-28 op "mail":"$GIT_AUTHOR_EMAIL",
332 ac0a4dfc 2024-03-28 op "user":"$GOT_AUTHOR_11"
333 ac0a4dfc 2024-03-28 op },
334 ac0a4dfc 2024-03-28 op "committer":{
335 ac0a4dfc 2024-03-28 op "full":"$GOT_AUTHOR",
336 ac0a4dfc 2024-03-28 op "name":"$GIT_AUTHOR_NAME",
337 ac0a4dfc 2024-03-28 op "mail":"$GIT_AUTHOR_EMAIL",
338 ac0a4dfc 2024-03-28 op "user":"$GOT_AUTHOR_11"
339 ac0a4dfc 2024-03-28 op },
340 939d3016 2024-04-23 op "date":$commit_time,
341 ac0a4dfc 2024-03-28 op "short_message":"make changes",
342 87890bc2 2024-03-28 op "message":"make changes\n",
343 763b7f49 2024-03-28 op "diffstat":{
344 763b7f49 2024-03-28 op "files":[{
345 763b7f49 2024-03-28 op "action":"modified",
346 763b7f49 2024-03-28 op "file":"alpha",
347 763b7f49 2024-03-28 op "added":1,
348 763b7f49 2024-03-28 op "removed":1
349 763b7f49 2024-03-28 op }],
350 763b7f49 2024-03-28 op "total":{
351 763b7f49 2024-03-28 op "added":1,
352 763b7f49 2024-03-28 op "removed":1
353 763b7f49 2024-03-28 op }
354 763b7f49 2024-03-28 op }
355 87890bc2 2024-03-28 op }
356 87890bc2 2024-03-28 op EOF
357 5565365c 2024-03-27 op done >> $testroot/stdout.expected
358 5565365c 2024-03-27 op echo "]}" >> $testroot/stdout.expected
359 87890bc2 2024-03-28 op ed -s "$testroot/stdout.expected" <<-EOF
360 87890bc2 2024-03-28 op ,j
361 87890bc2 2024-03-28 op w
362 87890bc2 2024-03-28 op EOF
363 5565365c 2024-03-27 op
364 5565365c 2024-03-27 op cmp -s $testroot/stdout.expected $testroot/stdout
365 5565365c 2024-03-27 op ret=$?
366 5565365c 2024-03-27 op if [ $ret -ne 0 ]; then
367 5565365c 2024-03-27 op diff -u $testroot/stdout.expected $testroot/stdout
368 5565365c 2024-03-27 op test_done "$testroot" "$ret"
369 5565365c 2024-03-27 op return 1
370 5565365c 2024-03-27 op fi
371 5565365c 2024-03-27 op
372 5565365c 2024-03-27 op test_done "$testroot" "$ret"
373 5565365c 2024-03-27 op }
374 5565365c 2024-03-27 op
375 5565365c 2024-03-27 op test_many_commits_summarized() {
376 5565365c 2024-03-27 op local testroot=`test_init many_commits_summarized 1`
377 5565365c 2024-03-27 op
378 5565365c 2024-03-27 op got clone -a -q ${GOTD_TEST_REPO_URL} $testroot/repo-clone
379 5565365c 2024-03-27 op ret=$?
380 5565365c 2024-03-27 op if [ $ret -ne 0 ]; then
381 5565365c 2024-03-27 op echo "got clone failed unexpectedly" >&2
382 5565365c 2024-03-27 op test_done "$testroot" 1
383 5565365c 2024-03-27 op return 1
384 5565365c 2024-03-27 op fi
385 5565365c 2024-03-27 op
386 5565365c 2024-03-27 op got checkout -q $testroot/repo-clone $testroot/wt >/dev/null
387 5565365c 2024-03-27 op ret=$?
388 5565365c 2024-03-27 op if [ $ret -ne 0 ]; then
389 5565365c 2024-03-27 op echo "got checkout failed unexpectedly" >&2
390 5565365c 2024-03-27 op test_done "$testroot" 1
391 5565365c 2024-03-27 op return 1
392 5565365c 2024-03-27 op fi
393 5565365c 2024-03-27 op
394 5565365c 2024-03-27 op for i in `seq 1 51`; do
395 5565365c 2024-03-27 op echo "alpha $i" > $testroot/wt/alpha
396 5565365c 2024-03-27 op (cd $testroot/wt && got commit -m 'make changes' > /dev/null)
397 5565365c 2024-03-27 op local commit_id=`git_show_head $testroot/repo-clone`
398 5565365c 2024-03-27 op local short_commit_id=`trim_obj_id 33 $commit_id`
399 5565365c 2024-03-27 op local author_time=`git_show_author_time $testroot/repo-clone`
400 939d3016 2024-04-23 op set -- "$@" "$short_commit_id $author_time"
401 5565365c 2024-03-27 op done
402 5565365c 2024-03-27 op
403 050c0b8c 2024-04-16 op timeout 5 ./http-server -a $AUTH -p "$GOTD_TEST_HTTP_PORT" \
404 5565365c 2024-03-27 op > $testroot/stdout &
405 5565365c 2024-03-27 op
406 5565365c 2024-03-27 op got send -b main -q -r $testroot/repo-clone
407 5565365c 2024-03-27 op ret=$?
408 5565365c 2024-03-27 op if [ $ret -ne 0 ]; then
409 5565365c 2024-03-27 op echo "got send failed unexpectedly" >&2
410 5565365c 2024-03-27 op test_done "$testroot" "1"
411 5565365c 2024-03-27 op return 1
412 5565365c 2024-03-27 op fi
413 5565365c 2024-03-27 op
414 5565365c 2024-03-27 op wait %1 # wait for the http "server"
415 5565365c 2024-03-27 op
416 9e88f9d9 2024-03-28 op printf '{"notifications":[' > $testroot/stdout.expected
417 5565365c 2024-03-27 op comma=""
418 5565365c 2024-03-27 op for i in `seq 1 51`; do
419 5565365c 2024-03-27 op s=`pop_idx $i "$@"`
420 5565365c 2024-03-27 op commit_id=$(echo $s | cut -d' ' -f1)
421 939d3016 2024-04-23 op commit_time=$(echo "$s" | cut -d' ' -f2)
422 87890bc2 2024-03-28 op
423 87890bc2 2024-03-28 op echo "$comma"
424 87890bc2 2024-03-28 op comma=','
425 87890bc2 2024-03-28 op
426 87890bc2 2024-03-28 op cat <<-EOF
427 87890bc2 2024-03-28 op {
428 93623901 2024-03-28 op "type":"commit",
429 87890bc2 2024-03-28 op "short":true,
430 c1003102 2024-04-15 op "repo":"test-repo",
431 841969e1 2024-04-30 op "authenticated_user":"${GOTD_DEVUSER}",
432 87890bc2 2024-03-28 op "id":"$commit_id",
433 ac0a4dfc 2024-03-28 op "committer":{
434 ac0a4dfc 2024-03-28 op "user":"$GOT_AUTHOR_8"
435 ac0a4dfc 2024-03-28 op },
436 939d3016 2024-04-23 op "date":$commit_time,
437 ac0a4dfc 2024-03-28 op "short_message":"make changes"
438 87890bc2 2024-03-28 op }
439 87890bc2 2024-03-28 op EOF
440 5565365c 2024-03-27 op done >> $testroot/stdout.expected
441 5565365c 2024-03-27 op echo "]}" >> $testroot/stdout.expected
442 914bfd3d 2024-03-28 op ed -s "$testroot/stdout.expected" <<-EOF
443 914bfd3d 2024-03-28 op ,j
444 914bfd3d 2024-03-28 op w
445 914bfd3d 2024-03-28 op EOF
446 914bfd3d 2024-03-28 op
447 914bfd3d 2024-03-28 op cmp -s $testroot/stdout.expected $testroot/stdout
448 914bfd3d 2024-03-28 op ret=$?
449 914bfd3d 2024-03-28 op if [ $ret -ne 0 ]; then
450 914bfd3d 2024-03-28 op diff -u $testroot/stdout.expected $testroot/stdout
451 914bfd3d 2024-03-28 op test_done "$testroot" "$ret"
452 914bfd3d 2024-03-28 op return 1
453 914bfd3d 2024-03-28 op fi
454 914bfd3d 2024-03-28 op
455 914bfd3d 2024-03-28 op test_done "$testroot" "$ret"
456 914bfd3d 2024-03-28 op }
457 914bfd3d 2024-03-28 op
458 914bfd3d 2024-03-28 op test_branch_created() {
459 914bfd3d 2024-03-28 op local testroot=`test_init branch_created 1`
460 914bfd3d 2024-03-28 op
461 914bfd3d 2024-03-28 op got clone -a -q ${GOTD_TEST_REPO_URL} $testroot/repo-clone
462 914bfd3d 2024-03-28 op ret=$?
463 914bfd3d 2024-03-28 op if [ $ret -ne 0 ]; then
464 914bfd3d 2024-03-28 op echo "got clone failed unexpectedly" >&2
465 914bfd3d 2024-03-28 op test_done "$testroot" 1
466 914bfd3d 2024-03-28 op return 1
467 914bfd3d 2024-03-28 op fi
468 914bfd3d 2024-03-28 op
469 914bfd3d 2024-03-28 op got checkout -q $testroot/repo-clone $testroot/wt >/dev/null
470 914bfd3d 2024-03-28 op ret=$?
471 914bfd3d 2024-03-28 op if [ $ret -ne 0 ]; then
472 914bfd3d 2024-03-28 op echo "got checkout failed unexpectedly" >&2
473 914bfd3d 2024-03-28 op test_done "$testroot" 1
474 914bfd3d 2024-03-28 op return 1
475 914bfd3d 2024-03-28 op fi
476 914bfd3d 2024-03-28 op
477 914bfd3d 2024-03-28 op (cd $testroot/wt && got branch newbranch > /dev/null)
478 914bfd3d 2024-03-28 op
479 914bfd3d 2024-03-28 op echo "change alpha on branch" > $testroot/wt/alpha
480 914bfd3d 2024-03-28 op (cd $testroot/wt && got commit -m 'newbranch' > /dev/null)
481 914bfd3d 2024-03-28 op local commit_id=`git_show_branch_head $testroot/repo-clone newbranch`
482 914bfd3d 2024-03-28 op local author_time=`git_show_author_time $testroot/repo-clone $commit_id`
483 914bfd3d 2024-03-28 op
484 050c0b8c 2024-04-16 op timeout 5 ./http-server -a $AUTH -p "$GOTD_TEST_HTTP_PORT" \
485 914bfd3d 2024-03-28 op > $testroot/stdout &
486 914bfd3d 2024-03-28 op
487 914bfd3d 2024-03-28 op got send -b newbranch -q -r $testroot/repo-clone
488 914bfd3d 2024-03-28 op ret=$?
489 914bfd3d 2024-03-28 op if [ $ret -ne 0 ]; then
490 914bfd3d 2024-03-28 op echo "got send failed unexpectedly" >&2
491 914bfd3d 2024-03-28 op test_done "$testroot" "1"
492 914bfd3d 2024-03-28 op return 1
493 914bfd3d 2024-03-28 op fi
494 914bfd3d 2024-03-28 op
495 914bfd3d 2024-03-28 op wait %1 # wait for the http "server"
496 914bfd3d 2024-03-28 op
497 914bfd3d 2024-03-28 op # in the future it should contain something like this too
498 914bfd3d 2024-03-28 op # {
499 914bfd3d 2024-03-28 op # "type":"new-branch",
500 914bfd3d 2024-03-28 op # "user":"${GOTD_DEVUSER}",
501 914bfd3d 2024-03-28 op # "ref":"refs/heads/newbranch"
502 914bfd3d 2024-03-28 op # },
503 914bfd3d 2024-03-28 op
504 914bfd3d 2024-03-28 op touch "$testroot/stdout.expected"
505 87890bc2 2024-03-28 op ed -s "$testroot/stdout.expected" <<-EOF
506 914bfd3d 2024-03-28 op a
507 914bfd3d 2024-03-28 op {"notifications":[
508 914bfd3d 2024-03-28 op {
509 914bfd3d 2024-03-28 op "type":"commit",
510 914bfd3d 2024-03-28 op "short":false,
511 c1003102 2024-04-15 op "repo":"test-repo",
512 841969e1 2024-04-30 op "authenticated_user":"${GOTD_DEVUSER}",
513 914bfd3d 2024-03-28 op "id":"$commit_id",
514 914bfd3d 2024-03-28 op "author":{
515 914bfd3d 2024-03-28 op "full":"$GOT_AUTHOR",
516 914bfd3d 2024-03-28 op "name":"$GIT_AUTHOR_NAME",
517 914bfd3d 2024-03-28 op "mail":"$GIT_AUTHOR_EMAIL",
518 914bfd3d 2024-03-28 op "user":"$GOT_AUTHOR_11"
519 914bfd3d 2024-03-28 op },
520 914bfd3d 2024-03-28 op "committer":{
521 914bfd3d 2024-03-28 op "full":"$GOT_AUTHOR",
522 914bfd3d 2024-03-28 op "name":"$GIT_AUTHOR_NAME",
523 914bfd3d 2024-03-28 op "mail":"$GIT_AUTHOR_EMAIL",
524 914bfd3d 2024-03-28 op "user":"$GOT_AUTHOR_11"
525 914bfd3d 2024-03-28 op },
526 939d3016 2024-04-23 op "date":$author_time,
527 914bfd3d 2024-03-28 op "short_message":"newbranch",
528 914bfd3d 2024-03-28 op "message":"newbranch\n",
529 763b7f49 2024-03-28 op "diffstat":{
530 763b7f49 2024-03-28 op "files":[{
531 763b7f49 2024-03-28 op "action":"modified",
532 763b7f49 2024-03-28 op "file":"alpha",
533 763b7f49 2024-03-28 op "added":1,
534 763b7f49 2024-03-28 op "removed":1
535 763b7f49 2024-03-28 op }],
536 763b7f49 2024-03-28 op "total":{
537 763b7f49 2024-03-28 op "added":1,
538 763b7f49 2024-03-28 op "removed":1
539 763b7f49 2024-03-28 op }
540 763b7f49 2024-03-28 op }
541 914bfd3d 2024-03-28 op }
542 914bfd3d 2024-03-28 op ]}
543 914bfd3d 2024-03-28 op .
544 87890bc2 2024-03-28 op ,j
545 87890bc2 2024-03-28 op w
546 87890bc2 2024-03-28 op EOF
547 5565365c 2024-03-27 op
548 5565365c 2024-03-27 op cmp -s $testroot/stdout.expected $testroot/stdout
549 5565365c 2024-03-27 op ret=$?
550 5565365c 2024-03-27 op if [ $ret -ne 0 ]; then
551 5565365c 2024-03-27 op diff -u $testroot/stdout.expected $testroot/stdout
552 5565365c 2024-03-27 op test_done "$testroot" "$ret"
553 5565365c 2024-03-27 op return 1
554 5565365c 2024-03-27 op fi
555 5565365c 2024-03-27 op
556 5565365c 2024-03-27 op test_done "$testroot" "$ret"
557 5565365c 2024-03-27 op }
558 d6057084 2024-03-28 op
559 d6057084 2024-03-28 op test_branch_removed() {
560 d6057084 2024-03-28 op local testroot=`test_init branch_removed 1`
561 d6057084 2024-03-28 op
562 d6057084 2024-03-28 op got clone -a -q ${GOTD_TEST_REPO_URL} $testroot/repo-clone
563 d6057084 2024-03-28 op ret=$?
564 d6057084 2024-03-28 op if [ $ret -ne 0 ]; then
565 d6057084 2024-03-28 op echo "got clone failed unexpectedly" >&2
566 d6057084 2024-03-28 op test_done "$testroot" 1
567 d6057084 2024-03-28 op return 1
568 d6057084 2024-03-28 op fi
569 5565365c 2024-03-27 op
570 050c0b8c 2024-04-16 op timeout 5 ./http-server -a $AUTH -p "$GOTD_TEST_HTTP_PORT" \
571 d6057084 2024-03-28 op > $testroot/stdout &
572 d6057084 2024-03-28 op
573 d6057084 2024-03-28 op local commit_id=`git_show_branch_head $testroot/repo-clone newbranch`
574 d6057084 2024-03-28 op
575 d6057084 2024-03-28 op got send -d newbranch -q -r $testroot/repo-clone
576 d6057084 2024-03-28 op ret=$?
577 d6057084 2024-03-28 op if [ $ret -ne 0 ]; then
578 d6057084 2024-03-28 op echo "got send failed unexpectedly" >&2
579 d6057084 2024-03-28 op test_done "$testroot" "1"
580 d6057084 2024-03-28 op return 1
581 d6057084 2024-03-28 op fi
582 d6057084 2024-03-28 op
583 d6057084 2024-03-28 op wait %1 # wait for the http "server"
584 d6057084 2024-03-28 op
585 d6057084 2024-03-28 op touch "$testroot/stdout.expected"
586 d6057084 2024-03-28 op ed -s "$testroot/stdout.expected" <<-EOF
587 d6057084 2024-03-28 op a
588 d6057084 2024-03-28 op {"notifications":[{
589 d6057084 2024-03-28 op "type":"branch-deleted",
590 c1003102 2024-04-15 op "repo":"test-repo",
591 841969e1 2024-04-30 op "authenticated_user":"${GOTD_DEVUSER}",
592 d6057084 2024-03-28 op "ref":"refs/heads/newbranch",
593 d6057084 2024-03-28 op "id":"$commit_id"
594 553d8347 2024-03-28 op }]}
595 553d8347 2024-03-28 op .
596 553d8347 2024-03-28 op ,j
597 553d8347 2024-03-28 op w
598 553d8347 2024-03-28 op EOF
599 553d8347 2024-03-28 op
600 553d8347 2024-03-28 op cmp -s $testroot/stdout.expected $testroot/stdout
601 553d8347 2024-03-28 op ret=$?
602 553d8347 2024-03-28 op if [ $ret -ne 0 ]; then
603 553d8347 2024-03-28 op diff -u $testroot/stdout.expected $testroot/stdout
604 553d8347 2024-03-28 op test_done "$testroot" "$ret"
605 553d8347 2024-03-28 op return 1
606 553d8347 2024-03-28 op fi
607 553d8347 2024-03-28 op
608 553d8347 2024-03-28 op test_done "$testroot" "$ret"
609 553d8347 2024-03-28 op }
610 553d8347 2024-03-28 op
611 553d8347 2024-03-28 op test_tag_created() {
612 553d8347 2024-03-28 op local testroot=`test_init tag_created 1`
613 553d8347 2024-03-28 op
614 553d8347 2024-03-28 op got clone -a -q ${GOTD_TEST_REPO_URL} $testroot/repo-clone
615 553d8347 2024-03-28 op ret=$?
616 553d8347 2024-03-28 op if [ $ret -ne 0 ]; then
617 553d8347 2024-03-28 op echo "got clone failed unexpectedly" >&2
618 553d8347 2024-03-28 op test_done "$testroot" 1
619 553d8347 2024-03-28 op return 1
620 553d8347 2024-03-28 op fi
621 553d8347 2024-03-28 op
622 553d8347 2024-03-28 op got tag -r $testroot/repo-clone -m "new tag" 1.0 > /dev/null
623 553d8347 2024-03-28 op local commit_id=`git_show_head $testroot/repo-clone`
624 553d8347 2024-03-28 op local tagger_time=`git_show_tagger_time $testroot/repo-clone 1.0`
625 553d8347 2024-03-28 op
626 050c0b8c 2024-04-16 op timeout 5 ./http-server -a $AUTH -p "$GOTD_TEST_HTTP_PORT" \
627 553d8347 2024-03-28 op >$testroot/stdout &
628 553d8347 2024-03-28 op
629 553d8347 2024-03-28 op got send -t 1.0 -q -r $testroot/repo-clone
630 553d8347 2024-03-28 op ret=$?
631 553d8347 2024-03-28 op if [ $ret -ne 0 ]; then
632 553d8347 2024-03-28 op echo "got send failed unexpectedly" >&2
633 553d8347 2024-03-28 op test_done "$testroot" "1"
634 553d8347 2024-03-28 op return 1
635 553d8347 2024-03-28 op fi
636 553d8347 2024-03-28 op
637 553d8347 2024-03-28 op wait %1 # wait for the http "server"
638 553d8347 2024-03-28 op
639 553d8347 2024-03-28 op touch "$testroot/stdout.expected"
640 553d8347 2024-03-28 op ed -s "$testroot/stdout.expected" <<-EOF
641 553d8347 2024-03-28 op a
642 553d8347 2024-03-28 op {"notifications":[{
643 553d8347 2024-03-28 op "type":"tag",
644 c1003102 2024-04-15 op "repo":"test-repo",
645 841969e1 2024-04-30 op "authenticated_user":"${GOTD_DEVUSER}",
646 553d8347 2024-03-28 op "tag":"refs/tags/1.0",
647 553d8347 2024-03-28 op "tagger":{
648 553d8347 2024-03-28 op "full":"$GOT_AUTHOR",
649 553d8347 2024-03-28 op "name":"$GIT_AUTHOR_NAME",
650 553d8347 2024-03-28 op "mail":"$GIT_AUTHOR_EMAIL",
651 553d8347 2024-03-28 op "user":"$GOT_AUTHOR_11"
652 553d8347 2024-03-28 op },
653 939d3016 2024-04-23 op "date":$tagger_time,
654 553d8347 2024-03-28 op "object":{
655 553d8347 2024-03-28 op "type":"commit",
656 553d8347 2024-03-28 op "id":"$commit_id"
657 553d8347 2024-03-28 op },
658 553d8347 2024-03-28 op "message":"new tag\n\n"
659 d6057084 2024-03-28 op }]}
660 d6057084 2024-03-28 op .
661 d6057084 2024-03-28 op ,j
662 d6057084 2024-03-28 op w
663 d6057084 2024-03-28 op EOF
664 d6057084 2024-03-28 op
665 d6057084 2024-03-28 op cmp -s $testroot/stdout.expected $testroot/stdout
666 d6057084 2024-03-28 op ret=$?
667 d6057084 2024-03-28 op if [ $ret -ne 0 ]; then
668 d6057084 2024-03-28 op diff -u $testroot/stdout.expected $testroot/stdout
669 d6057084 2024-03-28 op test_done "$testroot" "$ret"
670 d6057084 2024-03-28 op return 1
671 d6057084 2024-03-28 op fi
672 d6057084 2024-03-28 op
673 d6057084 2024-03-28 op test_done "$testroot" "$ret"
674 d6057084 2024-03-28 op }
675 cd182532 2024-03-28 op
676 cd182532 2024-03-28 op test_tag_changed() {
677 cd182532 2024-03-28 op local testroot=`test_init tag_changed 1`
678 cd182532 2024-03-28 op
679 cd182532 2024-03-28 op got clone -a -q ${GOTD_TEST_REPO_URL} $testroot/repo-clone
680 cd182532 2024-03-28 op ret=$?
681 cd182532 2024-03-28 op if [ $ret -ne 0 ]; then
682 cd182532 2024-03-28 op echo "got clone failed unexpectedly" >&2
683 cd182532 2024-03-28 op test_done "$testroot" 1
684 cd182532 2024-03-28 op return 1
685 cd182532 2024-03-28 op fi
686 cd182532 2024-03-28 op
687 cd182532 2024-03-28 op got checkout -q $testroot/repo-clone $testroot/wt >/dev/null
688 cd182532 2024-03-28 op ret=$?
689 cd182532 2024-03-28 op if [ $ret -ne 0 ]; then
690 cd182532 2024-03-28 op echo "got checkout failed unexpectedly" >&2
691 cd182532 2024-03-28 op test_done "$testroot" 1
692 cd182532 2024-03-28 op return 1
693 cd182532 2024-03-28 op fi
694 cd182532 2024-03-28 op
695 cd182532 2024-03-28 op echo "change alpha" > $testroot/wt/alpha
696 cd182532 2024-03-28 op (cd $testroot/wt && got commit -m 'make changes' > /dev/null)
697 cd182532 2024-03-28 op local commit_id=`git_show_head $testroot/repo-clone`
698 d6057084 2024-03-28 op
699 cd182532 2024-03-28 op got ref -r $testroot/repo-clone -d refs/tags/1.0 >/dev/null
700 cd182532 2024-03-28 op got tag -r $testroot/repo-clone -m "new tag" 1.0 > /dev/null
701 cd182532 2024-03-28 op local tagger_time=`git_show_tagger_time $testroot/repo-clone 1.0`
702 cd182532 2024-03-28 op
703 050c0b8c 2024-04-16 op timeout 5 ./http-server -a $AUTH -p "$GOTD_TEST_HTTP_PORT" \
704 cd182532 2024-03-28 op > $testroot/stdout &
705 cd182532 2024-03-28 op
706 cd182532 2024-03-28 op got send -f -t 1.0 -q -r $testroot/repo-clone
707 cd182532 2024-03-28 op ret=$?
708 cd182532 2024-03-28 op if [ $ret -ne 0 ]; then
709 cd182532 2024-03-28 op echo "got send failed unexpectedly" >&2
710 cd182532 2024-03-28 op test_done "$testroot" "1"
711 cd182532 2024-03-28 op return 1
712 cd182532 2024-03-28 op fi
713 cd182532 2024-03-28 op
714 cd182532 2024-03-28 op wait %1 # wait for the http "server"
715 cd182532 2024-03-28 op
716 cd182532 2024-03-28 op # XXX: at the moment this is exactly the same as the "new tag"
717 cd182532 2024-03-28 op # notification
718 cd182532 2024-03-28 op
719 cd182532 2024-03-28 op touch "$testroot/stdout.expected"
720 cd182532 2024-03-28 op ed -s "$testroot/stdout.expected" <<-EOF
721 cd182532 2024-03-28 op a
722 cd182532 2024-03-28 op {"notifications":[{
723 cd182532 2024-03-28 op "type":"tag",
724 c1003102 2024-04-15 op "repo":"test-repo",
725 841969e1 2024-04-30 op "authenticated_user":"${GOTD_DEVUSER}",
726 cd182532 2024-03-28 op "tag":"refs/tags/1.0",
727 cd182532 2024-03-28 op "tagger":{
728 cd182532 2024-03-28 op "full":"$GOT_AUTHOR",
729 cd182532 2024-03-28 op "name":"$GIT_AUTHOR_NAME",
730 cd182532 2024-03-28 op "mail":"$GIT_AUTHOR_EMAIL",
731 cd182532 2024-03-28 op "user":"$GOT_AUTHOR_11"
732 cd182532 2024-03-28 op },
733 939d3016 2024-04-23 op "date":$tagger_time,
734 cd182532 2024-03-28 op "object":{
735 cd182532 2024-03-28 op "type":"commit",
736 cd182532 2024-03-28 op "id":"$commit_id"
737 cd182532 2024-03-28 op },
738 cd182532 2024-03-28 op "message":"new tag\n\n"
739 cd182532 2024-03-28 op }]}
740 cd182532 2024-03-28 op .
741 cd182532 2024-03-28 op ,j
742 cd182532 2024-03-28 op w
743 cd182532 2024-03-28 op EOF
744 cd182532 2024-03-28 op
745 cd182532 2024-03-28 op cmp -s $testroot/stdout.expected $testroot/stdout
746 cd182532 2024-03-28 op ret=$?
747 cd182532 2024-03-28 op if [ $ret -ne 0 ]; then
748 cd182532 2024-03-28 op diff -u $testroot/stdout.expected $testroot/stdout
749 cd182532 2024-03-28 op test_done "$testroot" "$ret"
750 cd182532 2024-03-28 op return 1
751 cd182532 2024-03-28 op fi
752 cd182532 2024-03-28 op
753 cd182532 2024-03-28 op test_done "$testroot" "$ret"
754 cd182532 2024-03-28 op }
755 cd182532 2024-03-28 op
756 5565365c 2024-03-27 op test_parseargs "$@"
757 5565365c 2024-03-27 op run_test test_file_changed
758 ea5e974d 2024-03-28 op run_test test_bad_utf8
759 5565365c 2024-03-27 op run_test test_many_commits_not_summarized
760 5565365c 2024-03-27 op run_test test_many_commits_summarized
761 914bfd3d 2024-03-28 op run_test test_branch_created
762 d6057084 2024-03-28 op run_test test_branch_removed
763 553d8347 2024-03-28 op run_test test_tag_created
764 cd182532 2024-03-28 op run_test test_tag_changed