Blame


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