Skip to content

Commit

Permalink
DONTMERGE: implement integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevinjil committed Nov 24, 2024
1 parent 872a504 commit 5643c8d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
1 change: 0 additions & 1 deletion .github/jobs/baseinstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -139,4 +139,3 @@ elif [ "$version" = "all" ]; then
mysql_root "UPDATE user SET teamid = 1 WHERE userid = 1;" domjudge
fi
section_end

3 changes: 3 additions & 0 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ jobs:
run: sudo misc-tools/dj_make_chroot -a amd64
- name: Check nginx
run: curl -v https://localhost/domjudge/
- name: Test printing
working-directory: submit
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"
- name: Testing submit client
working-directory: submit
run: make check-full
Expand Down
6 changes: 6 additions & 0 deletions submit/submit_online.bats
Original file line number Diff line number Diff line change
Expand Up @@ -136,3 +136,9 @@ setup() {
assert_regex "Submission received: id = s[0-9]*, time = [0-9]{2}:[0-9]{2}:[0-9]{2}"
assert_regex "Check http[^ ]*/[0-9]* for the result."
}

@test "submit print job" {
run ./submit -P -l C ../example_problems/hello/submissions/accepted/test-hello.c
assert_success
assert_regex "DOMjudge reported a successful print job."
}
2 changes: 1 addition & 1 deletion submit/submit_standalone.bats
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ setup() {
@test "display basic usage information" {
run ./submit --help
assert_success
assert_line "usage: submit [--version] [-h] [-c CONTEST] [-p PROBLEM] [-l LANGUAGE] [-e ENTRY_POINT]"
assert_line "usage: submit [--version] [-h] [-c CONTEST] [-P] [-p PROBLEM] [-l LANGUAGE] [-e ENTRY_POINT]"
assert_line " [-v [{DEBUG,INFO,WARNING,ERROR,CRITICAL}]] [-q] [-y] [-u URL]"
# The help printer does print this differently on versions of argparse for nargs=*.
assert_regex " (filename )?[filename ...]"
Expand Down

0 comments on commit 5643c8d

Please sign in to comment.