Skip to content

Commit 0dcf4d2

Browse files
committed
fix
1 parent cdf1172 commit 0dcf4d2

File tree

1 file changed

+2
-28
lines changed

1 file changed

+2
-28
lines changed

.github/workflows/integration.yml

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -33,33 +33,6 @@ jobs:
3333
run: cat /proc/cmdline && echo && cat /proc/mounts && echo && ls -al /sys/fs/cgroup && echo && uname -a && echo && stat -fc %T /sys/fs/cgroup && echo && cat /proc/self/cgroup
3434
- name: Install DOMjudge
3535
run: .github/jobs/baseinstall.sh all
36-
- name: Verifying submissions
37-
shell: bash
38-
run: |
39-
set -x
40-
export CURLOPTS="--fail -sq -m 30 -b /tmp/cookiejar"
41-
# Make an initial request which will get us a session id, and grab the csrf token from it
42-
CSRFTOKEN=$(curl $CURLOPTS -c /tmp/cookiejar "http://localhost/domjudge/login" | sed -n 's/.*_csrf_token.*value="\(.*\)".*/\1/p')
43-
# Make a second request with our session + csrf token to actually log in
44-
curl $CURLOPTS -c /tmp/cookiejar -F "_csrf_token=$CSRFTOKEN" -F "_username=admin" -F "_password=password" "http://localhost/domjudge/login"
45-
# Send a general clarification to later test if we see the event.
46-
curl $CURLOPTS -F "sendto=" -F "problem=1-" -F "bodytext=Testing" -F "submit=Send" \
47-
"http://localhost/domjudge/jury/clarifications/send" -o /dev/null
48-
NUMNOTVERIFIED=$(curl $CURLOPTS "http://localhost/domjudge/jury/judging-verifier" | grep "submissions checked" | sed -r 's/^.* ([0-9]+) submissions checked.*$/\1/')
49-
NUMVERIFIED=$( curl $CURLOPTS "http://localhost/domjudge/jury/judging-verifier" | grep "submissions not checked" | sed -r 's/^.* ([0-9]+) submissions not checked.*$/\1/')
50-
NUMNOMAGIC=$( curl $CURLOPTS "http://localhost/domjudge/jury/judging-verifier" | grep "without magic string" | sed -r 's/^.* ([0-9]+) without magic string.*$/\1/')
51-
NUMSUBS=$(curl $CURLOPTS http://localhost/domjudge/api/contests/demo/submissions | python3 -mjson.tool | grep -c '"id":')
52-
# We expect
53-
# - two submissions with ambiguous outcome,
54-
# - one submissions submitted through the submit client, and thus the magic string ignored,
55-
# - and all submissions to be judged.
56-
if [ $NUMNOTVERIFIED -ne 2 ] || [ $NUMNOMAGIC -ne 1 ] || [ $NUMSUBS -gt $((NUMVERIFIED+NUMNOTVERIFIED)) ]; then
57-
echo "verified subs: $NUMVERIFIED, unverified subs: $NUMNOTVERIFIED, total subs: $NUMSUBS"
58-
echo "(expected 2 submissions to be unverified, but all to be processed)"
59-
echo "Of these $NUMNOMAGIC do not have the EXPECTED_RESULTS string (should be 1)."
60-
curl $CURLOPTS "http://localhost/domjudge/jury/judging-verifier?verify_multiple=1" | w3m -dump -T text/html
61-
exit 1
62-
fi
6336
- name: Set up chroot
6437
run: sudo misc-tools/dj_make_chroot -a amd64
6538
- name: Check nginx
@@ -98,6 +71,7 @@ jobs:
9871
- name: Verifying submissions
9972
shell: bash
10073
run: |
74+
set -x
10175
export CURLOPTS="--fail -sq -m 30 -b /tmp/cookiejar"
10276
# Make an initial request which will get us a session id, and grab the csrf token from it
10377
CSRFTOKEN=$(curl $CURLOPTS -c /tmp/cookiejar "http://localhost/domjudge/login" | sed -n 's/.*_csrf_token.*value="\(.*\)".*/\1/p')
@@ -109,7 +83,7 @@ jobs:
10983
NUMNOTVERIFIED=$(curl $CURLOPTS "http://localhost/domjudge/jury/judging-verifier" | grep "submissions checked" | sed -r 's/^.* ([0-9]+) submissions checked.*$/\1/')
11084
NUMVERIFIED=$( curl $CURLOPTS "http://localhost/domjudge/jury/judging-verifier" | grep "submissions not checked" | sed -r 's/^.* ([0-9]+) submissions not checked.*$/\1/')
11185
NUMNOMAGIC=$( curl $CURLOPTS "http://localhost/domjudge/jury/judging-verifier" | grep "without magic string" | sed -r 's/^.* ([0-9]+) without magic string.*$/\1/')
112-
NUMSUBS=$(curl $CURLOPTS http://localhost/domjudge/api/contests/1/submissions | python3 -mjson.tool | grep -c '"id":')
86+
NUMSUBS=$(curl $CURLOPTS http://localhost/domjudge/api/contests/demo/submissions | python3 -mjson.tool | grep -c '"id":')
11387
# We expect
11488
# - two submissions with ambiguous outcome,
11589
# - one submissions submitted through the submit client, and thus the magic string ignored,

0 commit comments

Comments
 (0)