From 476d6f5f76667d850ce20511508195992f670cd3 Mon Sep 17 00:00:00 2001 From: Xavier Petit <32063953+xpetit@users.noreply.github.com> Date: Fri, 3 Apr 2020 21:08:51 +0200 Subject: [PATCH] Update doc --- tests/README.md | 31 +++++++++++++++++++------------ tests/service.sh | 10 ---------- 2 files changed, 19 insertions(+), 22 deletions(-) delete mode 100755 tests/service.sh diff --git a/tests/README.md b/tests/README.md index d0c322200..495603f07 100644 --- a/tests/README.md +++ b/tests/README.md @@ -4,20 +4,27 @@ The tests must be in a Docker image that will be executed with (among others) the following options : -- `--read-only` Mount the container's root filesystem as read only -- `--user 1000:1000` Avoid to give root rights -- `--tmpfs /jail:size=200M,noatime,exec,nodev,nosuid,uid=1000,gid=1000,nr_inodes=5k,mode=1700` Mount a 200MB tmpfs directory to create files and run tests -- `--memory 500M` Memory limit of 500 MB -- `--cpus 2.0` Number of CPUs (2 threads) -- `--mount readonly,type=volume,source=student/username,destination=/app/student` The student's code is available in /app/student -- `--env HOME=/jail` Set the only writable folder as home directory -- `--env TMPDIR=/jail` Set the only writable folder as temporary directory -- `--env USERNAME=` Username -- `--env EXERCISE=` Exercise name -- `--env DOMAIN=` Domain name (e.g. gp.ynov-bordeaux.com) -- `--env EXPECTED_FILES=` A space-separated list of required files +- `--read-only` Mount the container's root filesystem as read only +- `--user 1000:1000` Avoid to give root rights +- `--tmpfs /jail:size=200M,noatime,exec,nodev,nosuid,uid=1000,gid=1000,nr_inodes=5k,mode=1700` Mount a 200MB tmpfs directory to create files and run tests +- `--memory 500M` Memory limit of 500 MB +- `--cpus 2.0` Number of CPUs (2 threads) +- `--mount readonly,type=volume,source=student/username,destination=/app/student` The student's code is available in /app/student +- `--env HOME=/jail` Set the only writable folder as home directory +- `--env TMPDIR=/jail` Set the only writable folder as temporary directory +- `--env USERNAME=` Username +- `--env EXERCISE=` Exercise name +- `--env DOMAIN=` Domain name (e.g. gp.ynov-bordeaux.com) +- `--env EXPECTED_FILES=` A space-separated list of required files The username is the Gitea login. No command or arguments are used, the entrypoint has to run the tests. The exit status of the container will determine whether or not the test has passed. Any output will be printed in the platform but not interpreted. + +### Building + +```console +docker build go -t tests-go +docker build sh -t tests-sh +``` diff --git a/tests/service.sh b/tests/service.sh deleted file mode 100755 index 71ce56d4e..000000000 --- a/tests/service.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash - -. "$WRAPPER" - -check_command docker "https://docs.docker.com/install" - -if test "$1" = "build"; then - docker build go -t tests-go - docker build sh -t tests-sh -fi