File: run-tests-via-docker.sh

package info (click to toggle)
s3ql 5.2.3%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,416 kB
  • sloc: python: 19,027; cpp: 408; makefile: 147; sh: 133
file content (20 lines) | stat: -rwxr-xr-x 592 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/env bash

# always use S3QL source root as working dir
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
cd "$DIR/.." || exit 1

set -e

# build a fresh container (with current sources, will mostly get cached in subsequent calls)
docker build -f ./tests/Dockerfile  -t s3ql-tests .
# run tests in docker, pass down arguments to pytest
if [ "$#" -eq 0 ]; then
  PY_TEST_ARGS=( tests )
else
  PY_TEST_ARGS=( "$@" )
fi
docker run --rm \
           --device /dev/fuse \
           --cap-add SYS_ADMIN \
           s3ql-tests python -m pytest "${PY_TEST_ARGS[@]}"