From bc19893d90fa8f37bd7bf56a72d6d457e1fc02d8 Mon Sep 17 00:00:00 2001 From: s3lph Date: Tue, 10 Jul 2018 22:08:35 +0200 Subject: [PATCH] Made unit tests unprivileged again (using sudo) --- .gitlab-ci.yml | 10 +++++----- testing/Dockerfile | 5 ++++- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 52cb1fa..441403c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,5 +1,5 @@ --- -image: s3lph/matemat-ci:20180710-02 +image: s3lph/matemat-ci:20180710-03 stages: - test @@ -10,15 +10,15 @@ test: stage: test script: - pip3 install -r requirements.txt - - python3-coverage run --branch -m unittest discover matemat - - python3-coverage report -m --include 'matemat/*' --omit '*/test_*.py' + - sudo -u matemat python3-coverage run --branch -m unittest discover matemat + - sudo -u matemat python3-coverage report -m --include 'matemat/*' --omit '*/test_*.py' codestyle: stage: codestyle script: - pip3 install -r requirements.txt - - pycodestyle matemat -# - mypy --ignore-missing-imports --strict -p matemat + - sudp -u matemat pycodestyle matemat +# - sudp -u matemat mypy --ignore-missing-imports --strict -p matemat docker_build_push: stage: deploy diff --git a/testing/Dockerfile b/testing/Dockerfile index 3bf3604..5c0e1b3 100644 --- a/testing/Dockerfile +++ b/testing/Dockerfile @@ -1,6 +1,9 @@ FROM debian:buster +RUN useradd -d /home/matemat -m matemat RUN apt-get update -qy -RUN apt-get install -y --no-install-recommends git docker.io python3-dev python3-pip python3-coverage python3-setuptools build-essential +RUN apt-get install -y --no-install-recommends sudo git docker.io python3-dev python3-pip python3-coverage python3-setuptools build-essential RUN pip3 install wheel pycodestyle mypy + +WORKDIR /home/matemat