mirror of
https://github.com/jupyterhub/the-littlest-jupyterhub.git
synced 2025-12-18 21:54:05 +08:00
Use a venv to run unit tests
- Can cache entire venv directory. When installing with system pip3, /usr/local/bin/ also needs caching - maybe other places too! - Matches how the installer does things more closely
This commit is contained in:
@@ -14,7 +14,7 @@ jobs:
|
|||||||
- run:
|
- run:
|
||||||
name: install python
|
name: install python
|
||||||
command: |
|
command: |
|
||||||
apt-get update --yes && apt-get install --yes python3 python3-pip
|
apt-get update --yes && apt-get install --yes python3 python3-venv
|
||||||
|
|
||||||
# Download and cache dependencies
|
# Download and cache dependencies
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
@@ -22,26 +22,31 @@ jobs:
|
|||||||
- v1-dependencies-py3.6-{{ checksum "setup.py" }}-{{ checksum "dev-requirements.txt" }}
|
- v1-dependencies-py3.6-{{ checksum "setup.py" }}-{{ checksum "dev-requirements.txt" }}
|
||||||
- v1-dependencies-py3.6-
|
- v1-dependencies-py3.6-
|
||||||
|
|
||||||
|
- run:
|
||||||
|
name: Setup venv
|
||||||
|
command: |
|
||||||
|
python3 -m venv /srv/venv
|
||||||
|
|
||||||
- run:
|
- run:
|
||||||
name: install dependencies
|
name: install dependencies
|
||||||
command: |
|
command: |
|
||||||
pip3 install -r dev-requirements.txt
|
/srv/venv/bin/pip install -r dev-requirements.txt
|
||||||
pip3 install -e .
|
/srv/venv/bin/pip install -e .
|
||||||
|
|
||||||
- save_cache:
|
- save_cache:
|
||||||
paths:
|
paths:
|
||||||
- /usr/local/lib/python3.6
|
- /srv/venv/
|
||||||
key: v1-dependencies-py3.6-{{ checksum "setup.py" }}-{{ checksum "dev-requirements.txt" }}
|
key: v1-dependencies-py3.6-{{ checksum "setup.py" }}-{{ checksum "dev-requirements.txt" }}
|
||||||
|
|
||||||
- run:
|
- run:
|
||||||
name: run unit tests
|
name: run unit tests
|
||||||
command: |
|
command: |
|
||||||
py.test --cov=tljh tests/
|
/srv/venv/bin/py.test --cov=tljh tests/
|
||||||
|
|
||||||
- run:
|
- run:
|
||||||
name: upload code coverage stats
|
name: upload code coverage stats
|
||||||
command: |
|
command: |
|
||||||
codecov
|
/srv/venv/bin/codecov
|
||||||
|
|
||||||
integration-test:
|
integration-test:
|
||||||
docker:
|
docker:
|
||||||
|
|||||||
Reference in New Issue
Block a user