diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 516d529a..d653f83e 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -78,16 +78,29 @@ jobs: - name: Run examples/internal-ssl tests if: matrix.test-variation == 'internal-ssl' + # FIXME: --cov=dockerspawner is omitted as the tested code lives inside + # the built dockerspawner image, so --cov=dockerspawner + # referencing the local source code doesn't get us test coverage. + # run: | - pytest examples/internal-ssl --capture=no --cov=dockerspawner + pytest examples/internal-ssl --capture=no - name: Prepare for user-mode podman tests if: matrix.test-variation == 'podman' + # Docker is stopped, and podman's system service is started in user-mode + # aka. rootless. + # + # ref: https://docs.podman.io/en/latest/markdown/podman-system-service.1.html + # run: | sudo systemctl stop docker + # Default is unix://$XDG_RUNTIME_DIR/podman/podman.sock but XDG_RUNTIME_DIR may not be set export DOCKER_HOST=unix://$HOME/podman.sock + echo "DOCKER_HOST=$DOCKER_HOST" >> $GITHUB_ENV + podman system service --time=0 $DOCKER_HOST & + for n in $(seq 1 10); do if ! docker version; then sleep 2 @@ -102,5 +115,10 @@ jobs: run: | pytest tests/test_dockerspawner.py --cov=dockerspawner + - name: Run user-mode podman tests + if: always() && matrix.test-variation == 'podman' + run: | + pytest tests/test_dockerspawner.py --cov=dockerspawner + # GitHub action reference: https://github.com/codecov/codecov-action - uses: codecov/codecov-action@v3 diff --git a/pyproject.toml b/pyproject.toml index 01536167..53ebc757 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -26,7 +26,7 @@ target_version = [ # ref: https://docs.pytest.org/en/stable/ # [tool.pytest.ini_options] -addopts = "--verbose --color=yes --durations=10" +addopts = "--verbose --color=yes --durations=10 --maxfail=2" asyncio_mode = "auto" testpaths = ["tests"] # These markers are registered to avoid warnings triggered by importing from