Skip to content

Commit 5643c8d

Browse files
committed
DONTMERGE: implement integration test
1 parent 872a504 commit 5643c8d

File tree

4 files changed

+10
-2
lines changed

4 files changed

+10
-2
lines changed

.github/jobs/baseinstall.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,4 +139,3 @@ elif [ "$version" = "all" ]; then
139139
mysql_root "UPDATE user SET teamid = 1 WHERE userid = 1;" domjudge
140140
fi
141141
section_end
142-

.github/workflows/integration.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ jobs:
4242
run: sudo misc-tools/dj_make_chroot -a amd64
4343
- name: Check nginx
4444
run: curl -v https://localhost/domjudge/
45+
- name: Test printing
46+
working-directory: submit
47+
run: curl --fail -u "admin:$(cat ../etc/initial_admin_password.secret)" -X 'PUT' -d 'print_command=cp [file] /tmp/dj-printfile' "http://localhost/domjudge/api/v4/config?strict=false"
4548
- name: Testing submit client
4649
working-directory: submit
4750
run: make check-full

submit/submit_online.bats

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,3 +136,9 @@ setup() {
136136
assert_regex "Submission received: id = s[0-9]*, time = [0-9]{2}:[0-9]{2}:[0-9]{2}"
137137
assert_regex "Check http[^ ]*/[0-9]* for the result."
138138
}
139+
140+
@test "submit print job" {
141+
run ./submit -P -l C ../example_problems/hello/submissions/accepted/test-hello.c
142+
assert_success
143+
assert_regex "DOMjudge reported a successful print job."
144+
}

submit/submit_standalone.bats

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ setup() {
4040
@test "display basic usage information" {
4141
run ./submit --help
4242
assert_success
43-
assert_line "usage: submit [--version] [-h] [-c CONTEST] [-p PROBLEM] [-l LANGUAGE] [-e ENTRY_POINT]"
43+
assert_line "usage: submit [--version] [-h] [-c CONTEST] [-P] [-p PROBLEM] [-l LANGUAGE] [-e ENTRY_POINT]"
4444
assert_line " [-v [{DEBUG,INFO,WARNING,ERROR,CRITICAL}]] [-q] [-y] [-u URL]"
4545
# The help printer does print this differently on versions of argparse for nargs=*.
4646
assert_regex " (filename )?[filename ...]"

0 commit comments

Comments
 (0)