Skip to content

Experiment: Configure test suite to use Jupyterhub Pytest Plugin #198

Experiment: Configure test suite to use Jupyterhub Pytest Plugin

Experiment: Configure test suite to use Jupyterhub Pytest Plugin #198

Workflow file for this run

# This is a GitHub workflow defining a set of jobs with a set of steps.
# ref: https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions
#
name: Tests
on:
pull_request:
push:
workflow_dispatch:
jobs:
# Run tests
test:
runs-on: ubuntu-20.04
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
include:
- python: 3.8
test: internal-ssl
- python: 3.8
jupyterhub: 2.0
- python: 3.9
jupyterhub: 2.2
- python: "3.10"
jupyterhub: "2.1"
test: podman
- python: 3.9
jupyterhub: 3.1.1
- python: 3.11
jupyterhub: 3.1.1
steps:
- uses: actions/checkout@v2
- name: setup docker swarm
run: docker swarm init
- name: Install Python ${{ matrix.python }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
# preserve pip cache to speed up installation
- name: Cache pip
uses: actions/cache@v2
with:
path: ~/.cache/pip
# Look to see if there is a cache hit for the corresponding requirements file
key: ${{ runner.os }}-pip-${{ hashFiles('*requirements.txt') }}
- name: Install Python dependencies
run: |
pip install --upgrade pip
pip install --upgrade --pre -r dev-requirements.txt
if [[ ! -z "${{ matrix.jupyterhub }}" ]]; then
pip install jupyterhub==${{ matrix.jupyterhub }}.*
fi
pip install -e .
pip freeze
- name: Install Node
uses: actions/setup-node@v1
with:
node-version: "14"
- name: Install Node dependencies
run: |
npm install -g configurable-http-proxy
- name: Pull images
if: matrix.test != 'podman'
run: |
for v in 1.0 1.1 1.2 1.3; do
docker pull jupyterhub/singleuser:$v
# preserve the layers with a different tag
docker tag jupyterhub/singleuser:$v jupyterhub/singleuser:${v}-cache
# untag so that pull actions are still required
docker rmi jupyterhub/singleuser:$v
done
- name: Run tests
if: matrix.test != 'internal-ssl' && matrix.test != 'podman'
run: |
py.test --cov dockerspawner tests -v
- name: Run internal-ssl tests
if: matrix.test == 'internal-ssl'
run: |
cd examples/internal-ssl
pytest -vsx
- name: Run user-mode podman tests
if: matrix.test == 'podman'
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
podman system service --time=0 $DOCKER_HOST &
for n in $(seq 1 10); do
if ! docker version; then
sleep 2
else
break
fi
done
docker ps
py.test --cov dockerspawner tests/test_dockerspawner.py -v
- name: Submit codecov report
run: |
codecov