2020-02-17 10:38:53 +02:00
|
|
|
version: 2.1
|
2020-02-17 10:58:53 +02:00
|
|
|
executors:
|
|
|
|
|
ubuntu_docker:
|
|
|
|
|
docker:
|
|
|
|
|
# Match target OS of TLJH
|
|
|
|
|
- image: ubuntu:18.04
|
|
|
|
|
working_directory: ~/repo
|
|
|
|
|
|
|
|
|
|
|
2020-02-17 10:38:53 +02:00
|
|
|
commands:
|
|
|
|
|
setup_venv:
|
|
|
|
|
description: Setup hub venv
|
|
|
|
|
steps:
|
|
|
|
|
- run:
|
|
|
|
|
name: Setup venv
|
|
|
|
|
command: |
|
|
|
|
|
python3 -m venv /srv/venv
|
|
|
|
|
echo 'export PATH=/srv/venv/bin:$PATH' >> $BASH_ENV
|
|
|
|
|
|
|
|
|
|
install_python:
|
|
|
|
|
description: Install python3, venv, git and make
|
|
|
|
|
steps:
|
|
|
|
|
- run:
|
|
|
|
|
name: install python
|
|
|
|
|
command: |
|
|
|
|
|
apt-get update --yes && apt-get install --yes python3 python3-venv git make
|
|
|
|
|
|
2020-04-23 13:14:32 +03:00
|
|
|
upgrade_pip:
|
|
|
|
|
description: Upgrade the pip version to 20.0.*
|
|
|
|
|
steps:
|
|
|
|
|
- run:
|
|
|
|
|
name: upgrade pip
|
|
|
|
|
command: |
|
|
|
|
|
python3 -m pip install -U pip==20.0.*
|
|
|
|
|
|
2020-02-18 15:51:33 +02:00
|
|
|
build_systemd_image:
|
|
|
|
|
steps:
|
|
|
|
|
- run:
|
|
|
|
|
name: build systemd image
|
|
|
|
|
command: |
|
|
|
|
|
.circleci/integration-test.py build-image
|
|
|
|
|
|
|
|
|
|
basic_tests:
|
|
|
|
|
parameters:
|
2020-02-20 13:31:17 +02:00
|
|
|
# Whether or not we should run update tests
|
2020-02-18 15:51:33 +02:00
|
|
|
upgrade:
|
|
|
|
|
type: string
|
|
|
|
|
default: ""
|
|
|
|
|
steps:
|
|
|
|
|
- run:
|
|
|
|
|
name: Run basic tests
|
|
|
|
|
command: |
|
2020-03-05 21:04:56 +02:00
|
|
|
if [ $CIRCLE_PR_USERNAME ]; then
|
|
|
|
|
BOOTSTRAP_PIP_SPEC=git+https://github.com/$CIRCLE_PR_USERNAME/the-littlest-jupyterhub.git@$CIRCLE_SHA1
|
|
|
|
|
else
|
|
|
|
|
BOOTSTRAP_PIP_SPEC=git+https://github.com/$CIRCLE_PROJECT_USERNAME/the-littlest-jupyterhub.git@$CIRCLE_SHA1
|
|
|
|
|
fi
|
2020-02-18 15:51:33 +02:00
|
|
|
|
2020-04-30 13:27:04 +03:00
|
|
|
.circleci/integration-test.py run-test \
|
2020-05-04 10:16:41 +02:00
|
|
|
--bootstrap-pip-spec "$BOOTSTRAP_PIP_SPEC" \
|
2020-04-30 13:27:04 +03:00
|
|
|
basic-tests test_hub.py test_install.py test_extensions.py \
|
2020-02-19 11:57:11 +02:00
|
|
|
<< parameters.upgrade >>
|
2020-02-18 15:51:33 +02:00
|
|
|
admin_tests:
|
|
|
|
|
parameters:
|
|
|
|
|
upgrade:
|
|
|
|
|
type: string
|
|
|
|
|
default: ""
|
|
|
|
|
steps:
|
|
|
|
|
- run:
|
|
|
|
|
name: Run admin tests
|
|
|
|
|
command: |
|
2020-03-05 21:04:56 +02:00
|
|
|
if [ $CIRCLE_PR_USERNAME ]; then
|
|
|
|
|
BOOTSTRAP_PIP_SPEC=git+https://github.com/$CIRCLE_PR_USERNAME/the-littlest-jupyterhub.git@$CIRCLE_SHA1
|
|
|
|
|
else
|
|
|
|
|
BOOTSTRAP_PIP_SPEC=git+https://github.com/$CIRCLE_PROJECT_USERNAME/the-littlest-jupyterhub.git@$CIRCLE_SHA1
|
|
|
|
|
fi
|
2020-02-19 11:57:11 +02:00
|
|
|
|
2020-02-18 15:51:33 +02:00
|
|
|
.circleci/integration-test.py run-test \
|
|
|
|
|
--installer-args "--admin admin:admin" \
|
2020-05-04 10:16:41 +02:00
|
|
|
--bootstrap-pip-spec $BOOTSTRAP_PIP_SPEC \
|
2020-04-30 13:27:04 +03:00
|
|
|
basic-tests test_admin_installer.py \
|
2020-02-19 11:57:11 +02:00
|
|
|
<< parameters.upgrade >>
|
2020-02-18 15:51:33 +02:00
|
|
|
|
|
|
|
|
plugin_tests:
|
|
|
|
|
parameters:
|
|
|
|
|
upgrade:
|
|
|
|
|
type: string
|
|
|
|
|
default: ""
|
|
|
|
|
steps:
|
|
|
|
|
- run:
|
|
|
|
|
name: Run plugin tests
|
|
|
|
|
command: |
|
2020-03-05 21:04:56 +02:00
|
|
|
if [ $CIRCLE_PR_USERNAME ]; then
|
|
|
|
|
BOOTSTRAP_PIP_SPEC=git+https://github.com/$CIRCLE_PR_USERNAME/the-littlest-jupyterhub.git@$CIRCLE_SHA1
|
|
|
|
|
else
|
|
|
|
|
BOOTSTRAP_PIP_SPEC=git+https://github.com/$CIRCLE_PROJECT_USERNAME/the-littlest-jupyterhub.git@$CIRCLE_SHA1
|
|
|
|
|
fi
|
2020-02-19 11:57:11 +02:00
|
|
|
|
2020-02-18 15:51:33 +02:00
|
|
|
.circleci/integration-test.py run-test \
|
2020-05-04 10:16:41 +02:00
|
|
|
--bootstrap-pip-spec $BOOTSTRAP_PIP_SPEC \
|
2020-02-18 15:51:33 +02:00
|
|
|
--installer-args "--plugin /srv/src/integration-tests/plugins/simplest" \
|
2020-04-30 13:27:04 +03:00
|
|
|
plugins test_simplest_plugin.py \
|
2020-02-18 15:51:33 +02:00
|
|
|
<< parameters.upgrade >>
|
|
|
|
|
|
|
|
|
|
bootstrap_checks:
|
2020-02-18 16:47:18 +02:00
|
|
|
parameters:
|
2020-02-18 15:51:33 +02:00
|
|
|
steps:
|
|
|
|
|
- run:
|
|
|
|
|
name: Run bootstrap checks
|
|
|
|
|
command: |
|
|
|
|
|
py.test integration-tests/test_bootstrap.py
|
|
|
|
|
|
2020-02-18 16:32:45 +02:00
|
|
|
|
2018-06-29 02:05:36 -07:00
|
|
|
jobs:
|
2018-07-11 12:25:23 -07:00
|
|
|
unit-test:
|
2020-02-17 10:58:53 +02:00
|
|
|
executor: ubuntu_docker
|
2018-07-11 12:25:23 -07:00
|
|
|
steps:
|
|
|
|
|
- checkout
|
2018-06-29 02:05:36 -07:00
|
|
|
|
2018-07-20 11:42:15 -07:00
|
|
|
# Setup Python
|
2020-02-17 10:38:53 +02:00
|
|
|
- install_python
|
2018-07-20 11:42:15 -07:00
|
|
|
|
2018-07-11 12:25:23 -07:00
|
|
|
# Download and cache dependencies
|
|
|
|
|
- restore_cache:
|
|
|
|
|
keys:
|
2018-07-20 11:49:34 -07:00
|
|
|
- v1-dependencies-py3.6-{{ checksum "setup.py" }}-{{ checksum "dev-requirements.txt" }}
|
|
|
|
|
- v1-dependencies-py3.6-
|
2018-06-29 02:05:36 -07:00
|
|
|
|
2020-02-17 10:38:53 +02:00
|
|
|
- setup_venv
|
2020-04-23 13:14:32 +03:00
|
|
|
|
|
|
|
|
- upgrade_pip
|
|
|
|
|
|
2018-07-11 12:25:23 -07:00
|
|
|
- run:
|
|
|
|
|
name: install dependencies
|
|
|
|
|
command: |
|
2018-08-01 16:02:49 +02:00
|
|
|
pip install -r dev-requirements.txt
|
|
|
|
|
pip install -e .
|
2018-06-29 02:05:36 -07:00
|
|
|
|
2018-07-11 12:25:23 -07:00
|
|
|
- save_cache:
|
|
|
|
|
paths:
|
2018-07-23 14:54:25 -07:00
|
|
|
- /srv/venv/
|
2018-07-20 11:49:34 -07:00
|
|
|
key: v1-dependencies-py3.6-{{ checksum "setup.py" }}-{{ checksum "dev-requirements.txt" }}
|
2018-06-29 02:05:36 -07:00
|
|
|
|
2018-07-11 12:25:23 -07:00
|
|
|
- run:
|
|
|
|
|
name: run unit tests
|
|
|
|
|
command: |
|
2018-08-01 16:02:49 +02:00
|
|
|
py.test --cov=tljh tests/
|
2018-07-11 13:15:49 -07:00
|
|
|
|
|
|
|
|
- run:
|
|
|
|
|
name: upload code coverage stats
|
|
|
|
|
command: |
|
2018-08-01 16:02:49 +02:00
|
|
|
codecov
|
2018-06-29 02:26:20 -07:00
|
|
|
|
2018-07-11 12:25:23 -07:00
|
|
|
integration-test:
|
|
|
|
|
docker:
|
|
|
|
|
- image: docker:18.05.0-ce-git
|
2018-07-11 12:16:46 -07:00
|
|
|
|
2018-07-11 12:25:23 -07:00
|
|
|
steps:
|
2020-02-24 14:20:37 +02:00
|
|
|
- run:
|
|
|
|
|
name: setup python3
|
|
|
|
|
command: |
|
|
|
|
|
apk add --no-cache python3 pytest
|
2018-06-29 02:26:20 -07:00
|
|
|
|
2020-02-17 10:38:53 +02:00
|
|
|
- checkout
|
2020-02-18 15:51:33 +02:00
|
|
|
|
2018-07-11 12:25:23 -07:00
|
|
|
- setup_remote_docker
|
2018-06-29 02:26:20 -07:00
|
|
|
|
2020-02-18 15:51:33 +02:00
|
|
|
- build_systemd_image
|
2018-07-11 02:04:41 -07:00
|
|
|
|
2020-02-19 11:57:11 +02:00
|
|
|
- basic_tests
|
2018-06-29 03:12:16 -07:00
|
|
|
|
2020-02-19 11:57:11 +02:00
|
|
|
- admin_tests
|
2019-07-16 20:18:45 +03:00
|
|
|
|
2020-02-19 11:57:11 +02:00
|
|
|
- plugin_tests
|
2020-02-18 15:51:33 +02:00
|
|
|
|
2020-02-19 11:57:11 +02:00
|
|
|
- bootstrap_checks
|
2019-07-16 20:18:45 +03:00
|
|
|
|
2018-07-11 12:33:19 -07:00
|
|
|
|
2020-02-18 15:51:33 +02:00
|
|
|
upgrade-test:
|
|
|
|
|
docker:
|
|
|
|
|
- image: docker:18.05.0-ce-git
|
|
|
|
|
|
|
|
|
|
steps:
|
2020-02-21 11:05:14 +02:00
|
|
|
- run:
|
|
|
|
|
name: Check upgrade testing
|
|
|
|
|
command: |
|
|
|
|
|
if [ "$CIRCLE_BRANCH" == "master" ]; then
|
|
|
|
|
echo "On master, no upgrade to test..."
|
|
|
|
|
circleci-agent step halt
|
|
|
|
|
else
|
|
|
|
|
echo "PR detected, testing upgrade..."
|
|
|
|
|
fi
|
|
|
|
|
|
2020-02-24 14:20:37 +02:00
|
|
|
- run:
|
|
|
|
|
name: setup python3
|
|
|
|
|
command: |
|
|
|
|
|
apk add --no-cache python3 pytest
|
2020-02-18 15:51:33 +02:00
|
|
|
|
|
|
|
|
- checkout
|
|
|
|
|
|
|
|
|
|
- setup_remote_docker
|
|
|
|
|
|
|
|
|
|
- build_systemd_image
|
|
|
|
|
|
2020-02-18 16:47:18 +02:00
|
|
|
- basic_tests:
|
2020-02-18 15:51:33 +02:00
|
|
|
upgrade: "--upgrade"
|
|
|
|
|
|
|
|
|
|
- admin_tests:
|
|
|
|
|
upgrade: "--upgrade"
|
2018-10-30 20:08:47 -07:00
|
|
|
|
2020-02-18 15:51:33 +02:00
|
|
|
- plugin_tests:
|
|
|
|
|
upgrade: "--upgrade"
|
2018-10-30 20:08:47 -07:00
|
|
|
|
2018-07-11 12:21:57 -07:00
|
|
|
|
2018-08-03 15:30:48 +02:00
|
|
|
documentation:
|
2020-02-17 10:58:53 +02:00
|
|
|
executor: ubuntu_docker
|
2018-08-03 15:30:48 +02:00
|
|
|
steps:
|
|
|
|
|
- checkout
|
|
|
|
|
|
|
|
|
|
# Setup Python
|
2020-02-17 10:38:53 +02:00
|
|
|
- install_python
|
2018-08-03 15:30:48 +02:00
|
|
|
|
|
|
|
|
# Download and cache dependencies
|
|
|
|
|
- restore_cache:
|
|
|
|
|
key: v1-dependencies-py3.6-sphinx
|
|
|
|
|
|
2020-02-17 10:38:53 +02:00
|
|
|
- setup_venv
|
2020-04-23 13:14:32 +03:00
|
|
|
|
2018-08-03 15:30:48 +02:00
|
|
|
- run:
|
|
|
|
|
name: install dependencies
|
|
|
|
|
command: |
|
|
|
|
|
pip install sphinx
|
2018-08-12 09:12:46 -07:00
|
|
|
pip install -r docs/requirements.txt
|
2018-08-03 15:30:48 +02:00
|
|
|
|
|
|
|
|
- save_cache:
|
|
|
|
|
paths:
|
|
|
|
|
- /srv/venv/
|
|
|
|
|
key: v1-dependencies-py3.6-sphinx
|
|
|
|
|
|
|
|
|
|
- run:
|
|
|
|
|
name: build documentation
|
|
|
|
|
command: |
|
|
|
|
|
cd docs
|
|
|
|
|
make html
|
|
|
|
|
|
2018-10-17 21:16:30 -07:00
|
|
|
- store_artifacts:
|
|
|
|
|
path: docs/_build/html/
|
|
|
|
|
destination: html
|
|
|
|
|
|
2018-07-11 12:21:57 -07:00
|
|
|
workflows:
|
|
|
|
|
version: 2
|
2018-07-11 12:33:32 -07:00
|
|
|
all-tests:
|
2018-07-11 12:21:57 -07:00
|
|
|
jobs:
|
|
|
|
|
- unit-test
|
|
|
|
|
- integration-test
|
2020-02-18 16:47:18 +02:00
|
|
|
- upgrade-test
|
2018-08-03 15:30:48 +02:00
|
|
|
- documentation
|