Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
KBorm committed Feb 8, 2024
2 parents c8ef05c + 9e4560c commit 4fcfa54
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 5 deletions.
1 change: 0 additions & 1 deletion changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

change tester uid to value other than 1000 as this causes problems with WSL2


# 4.18.2

* bugfix nginx configuration: large requests
Expand Down
6 changes: 3 additions & 3 deletions nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ server {
listen 80;

# increase upload size to 5 MB (default: 1MB)
client_max_body_size 5M;
client_max_body_size 50M;

# server_name server.domain.org;

Expand Down Expand Up @@ -42,8 +42,8 @@ server {
# ssl_certificate /etc/nginx/certs/server.crt;
# ssl_certificate_key /etc/nginx/certs/server.key;

# increase upload size to 5 MB (default: 1MB)
# client_max_body_size 5M;
# increase upload size to 50 MB (default: 1MB)
# client_max_body_size 50M;

# forward to django
# location / {
Expand Down
2 changes: 1 addition & 1 deletion src/VERSION.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# -*- coding: utf-8 -*-

version = "Version 4.18.3 | 20240208"
version = "Version 4.18.3 | 20240208"
19 changes: 19 additions & 0 deletions src/checker/checker/JUnitChecker.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,22 @@ def remove_deprecated_warning(text):
return text

def run(self, env):
# Special treatment for test cases that want to analyze the original Java student code.
# Normally, all Java files are deleted after compilation to prevent a student from reading the test code.
# If there is only one file in this sandbox folder (student code), then it will be restored after deletion.
# This is only done if the student code consists of exactly one file,
# otherwise there is a risk that the student code contains test files that would overwrite the teacher's tests.
from pathlib import Path
files = list(Path(env.tmpdir()).rglob("*.[jJ][aA][vV][aA]"))
if len(files) == 1:
# create backup file
logger.debug(files[0])
import shutil
shutil.copyfile(str(files[0].absolute()), str(files[0].absolute()) + '__.bak')

self.copy_files(env)


# compile test
logger.debug('JUNIT Checker build')
java_builder = IgnoringJavaBuilder(_flags="", _libs=self.junit_version, _file_pattern=r"^.*\.[jJ][aA][vV][aA]$",
Expand Down Expand Up @@ -181,6 +195,11 @@ def run(self, env):
logger.error(output)
logger.error(error)

if len(files) == 1:
# restore single backup file in case of Java parser testcode
import shutil
shutil.copyfile(str(files[0].absolute()) + '__.bak', str(files[0].absolute()))

# run test
logger.debug('JUNIT Checker run')
environ = {}
Expand Down

0 comments on commit 4fcfa54

Please sign in to comment.