Skip to content

Commit 38bc4c6

Browse files
committed
DONTMERGE: implement integration test
1 parent 872a504 commit 38bc4c6

File tree

4 files changed

+16
-1
lines changed

4 files changed

+16
-1
lines changed

.github/jobs/baseinstall.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,3 +140,6 @@ elif [ "$version" = "all" ]; then
140140
fi
141141
section_end
142142

143+
section_start "Setup printing"
144+
mysql_root "UPDATE configuration SET value = '\"cp [file] /tmp/dj-printfile\"' WHERE name = 'print_command';" domjudge
145+
section_end

.github/workflows/integration.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@ 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: |
48+
export SUBMITCONTEST="demo"
49+
export SUBMITBASEURL="$(grep '^BASEURL' ../paths.mk | tr -s ' ' | cut -d ' ' -f 3)"
50+
./submit -v DEBUG -P -l C ../example_problems/hello/submissions/accepted/test-hello.c
4551
- name: Testing submit client
4652
working-directory: submit
4753
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)