diff options
| author | georg | 2019-07-22 13:39:06 -0700 |
|---|---|---|
| committer | jvoisin | 2019-07-22 13:39:06 -0700 |
| commit | a81ea65d44a31e33307ed3b6a9ce3b2c0057d550 (patch) | |
| tree | 296d56038afb8ef50f428656ea801a6816bf6fe8 | |
| parent | 8bb2826f7a396cdc49542bf3bb868a9c61848ed2 (diff) | |
CI: Run bubblewrap tests as different user than 'root' to fix errors
It seems, there is a bug somewhere if the test suite is invoked as
'root', and bubblewrap is available.
| -rw-r--r-- | .gitlab-ci.yml | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4d1f844..1ed155c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml | |||
| @@ -5,6 +5,11 @@ stages: | |||
| 5 | - linting | 5 | - linting |
| 6 | - test | 6 | - test |
| 7 | 7 | ||
| 8 | .prepare_env: &prepare_env | ||
| 9 | before_script: # This is needed to not run the testsuite as root | ||
| 10 | - useradd --home-dir ${CI_PROJECT_DIR} mat2 | ||
| 11 | - chown -R mat2 . | ||
| 12 | |||
| 8 | linting:bandit: | 13 | linting:bandit: |
| 9 | image: $CONTAINER_REGISTRY:linting | 14 | image: $CONTAINER_REGISTRY:linting |
| 10 | stage: linting | 15 | stage: linting |
| @@ -60,9 +65,10 @@ tests:debian_with_bubblewrap: | |||
| 60 | image: $CONTAINER_REGISTRY:debian | 65 | image: $CONTAINER_REGISTRY:debian |
| 61 | stage: test | 66 | stage: test |
| 62 | allow_failure: true | 67 | allow_failure: true |
| 68 | <<: *prepare_env | ||
| 63 | script: | 69 | script: |
| 64 | - python3-coverage run --branch -m unittest discover -s tests/ | 70 | - su - mat2 -c "python3-coverage run --branch -m unittest discover -s tests/" |
| 65 | - python3-coverage report --fail-under=100 -m --include 'libmat2/*' | 71 | - su - mat2 -c "python3-coverage report --fail-under=100 -m --include 'libmat2/*'" |
| 66 | 72 | ||
| 67 | tests:fedora: | 73 | tests:fedora: |
| 68 | image: $CONTAINER_REGISTRY:fedora | 74 | image: $CONTAINER_REGISTRY:fedora |
| @@ -74,5 +80,6 @@ tests:gentoo: | |||
| 74 | image: $CONTAINER_REGISTRY:gentoo | 80 | image: $CONTAINER_REGISTRY:gentoo |
| 75 | stage: test | 81 | stage: test |
| 76 | allow_failure: true | 82 | allow_failure: true |
| 83 | <<: *prepare_env | ||
| 77 | script: | 84 | script: |
| 78 | - python3 -m unittest discover -v | 85 | - su - mat2 -c "python3 -m unittest discover -v" |
