Update JOJ3 Configuration Schema

manuel 2024-10-02 20:55:13 +08:00
parent 641674189a
commit 72dc7711f4

@ -22,6 +22,18 @@ Health check configuration:
**Important:** it should never be possible to disable health check.
```toml
[repo]
owners = ["mac-wang", "jon-lee", "allen_wr"] # teaching team
max_size = 5 # repo max size in MB
[files]
whitelist.patterns = ["*.cpp", "*.c", "*.m", "*.md", "Makefile", "CMakelist.txt", ".gitea"]
whitelist.file = "messenger.json" # IMPORTANT: only use if strictly necessary. Almost no course should use it
immutable.files = [".gitignore", ".gitattributes", ".gitea/workflows/push.yaml"] # readonly files
immutable.hash = ["fafssafds7","kjklhk5hk345", "nvnfjuysf653214"] # hash of readonly files
```
## Task level
Basic idea:
@ -36,16 +48,16 @@ Basic idea:
- test cases can be individually configured if necessary
```toml
stages = [ "compile", "code_quality", "joj" ]
stages = [ "compile", "code_quality", "joj" ] # list of stages, can feature a unique stage
[compile]
command = "cmake"
copyfiles= [ "main.c", "task.h" ]
command = "cmake"
copyfiles= [ "main.c", "task.h" ] # files to include with repo code when compiling
[[code_quality]]
command = "file-length"
tests = [ "max", "recommend"]
weights = [ 50, 20 ]
command = "file-length" # command to run
tests = [ "max", "recommend"] # keywords caught by corresponding JOJ plugin
weights = [ 50, 20 ] # weight of each keyword
[[code_quality]]
command = "clang-tidy-18 -header-filter=.* -quiet -load=/usr/local/lib/libcodequality.so -p build"
@ -63,18 +75,18 @@ tests = [ "runtime", "readability", "build" ]
weights = [ 10, 20, 15]
[joj]
score = 10
limit.cpu = 10000000000
limit.mem = 536870912
score = 10 # default JOJ score for each test case
limit.cpu = 10000000000 # default cpu limit for each test case
limit.mem = 536870912 # default mem limit for each test case
[[test_cases]]
name = "case4"
score = 20
name = "case4" # name of a test case with non-default setup
score = 20 # non-default score
limit.cpu = 5000000000
limit.mem = 53687091
[[test_cases]]
name = "case10"
score = 30
limit.mem = 53687091
limit.mem = 53687091 # limit.cpu is kept as default
```