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