2018-06-29 02:05:36 -07:00
|
|
|
version: 2
|
|
|
|
|
jobs:
|
2018-07-11 12:25:23 -07:00
|
|
|
unit-test:
|
|
|
|
|
docker:
|
|
|
|
|
- image: continuumio/miniconda3:4.5.4
|
2018-06-29 02:05:36 -07:00
|
|
|
|
2018-07-11 12:25:23 -07:00
|
|
|
working_directory: ~/repo
|
2018-06-29 02:05:36 -07:00
|
|
|
|
2018-07-11 12:25:23 -07:00
|
|
|
steps:
|
|
|
|
|
- checkout
|
2018-06-29 02:05:36 -07:00
|
|
|
|
2018-07-11 12:25:23 -07:00
|
|
|
# Download and cache dependencies
|
|
|
|
|
- restore_cache:
|
|
|
|
|
keys:
|
|
|
|
|
- v1-dependencies-miniconda3-4.5.4-{{ checksum "setup.py" }}-{{ checksum "dev-requirements.txt" }}
|
|
|
|
|
- v1-dependencies-miniconda3-4.5.4-
|
2018-06-29 02:05:36 -07:00
|
|
|
|
2018-07-11 12:25:23 -07:00
|
|
|
- run:
|
|
|
|
|
name: install dependencies
|
|
|
|
|
command: |
|
|
|
|
|
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:
|
|
|
|
|
- /opt/conda
|
|
|
|
|
key: v1-dependencies-miniconda3-4.5.4-{{ 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-07-11 13:15:49 -07:00
|
|
|
py.test --cov=tljh tests/
|
|
|
|
|
|
|
|
|
|
- run:
|
|
|
|
|
name: upload code coverage stats
|
|
|
|
|
command: |
|
|
|
|
|
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:
|
|
|
|
|
- run:
|
|
|
|
|
name: setup python3
|
|
|
|
|
command: |
|
|
|
|
|
apk add --no-cache python3
|
2018-06-29 02:26:20 -07:00
|
|
|
|
2018-07-11 12:27:01 -07:00
|
|
|
- checkout
|
2018-07-11 12:25:23 -07:00
|
|
|
- setup_remote_docker
|
2018-06-29 02:26:20 -07:00
|
|
|
|
2018-07-11 12:25:23 -07:00
|
|
|
- run:
|
|
|
|
|
name: build systemd image
|
|
|
|
|
command: |
|
|
|
|
|
python3 .circleci/integration-test.py build-image
|
2018-07-11 02:04:41 -07:00
|
|
|
|
2018-07-11 12:25:23 -07:00
|
|
|
- run:
|
|
|
|
|
name: start systemd image
|
|
|
|
|
command: |
|
|
|
|
|
python3 .circleci/integration-test.py start-container
|
2018-06-29 03:12:16 -07:00
|
|
|
|
2018-07-11 12:25:23 -07:00
|
|
|
- run:
|
|
|
|
|
name: run tljh installer
|
|
|
|
|
command: |
|
|
|
|
|
python3 .circleci/integration-test.py copy . /srv/src
|
|
|
|
|
python3 .circleci/integration-test.py run 'python3 /srv/src/bootstrap/bootstrap.py'
|
2018-07-11 12:21:57 -07:00
|
|
|
|
2018-07-11 12:33:19 -07:00
|
|
|
- run:
|
2018-07-11 12:39:06 -07:00
|
|
|
name: print systemd status + logs
|
2018-07-11 12:33:19 -07:00
|
|
|
command: |
|
|
|
|
|
python3 .circleci/integration-test.py run 'journalctl --no-pager'
|
2018-07-11 12:43:40 -07:00
|
|
|
python3 .circleci/integration-test.py run 'systemctl --no-pager status jupyterhub configurable-http-proxy'
|
2018-07-11 12:33:19 -07:00
|
|
|
|
2018-07-11 12:25:23 -07:00
|
|
|
- run:
|
|
|
|
|
name: check jupyterhub is up
|
|
|
|
|
command: |
|
|
|
|
|
python3 .circleci/integration-test.py run 'curl -L --fail http://127.0.0.1'
|
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
|