Files
the-littlest-jupyterhub/.circleci/config.yml

151 lines
4.5 KiB
YAML
Raw Normal View History

2020-02-17 10:38:53 +02:00
version: 2.1
2020-02-17 10:58:53 +02:00
2020-02-17 10:38:53 +02:00
commands:
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: |
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 \
--bootstrap-pip-spec "$BOOTSTRAP_PIP_SPEC" \
2020-06-08 11:42:10 +03:00
basic-tests test_hub.py test_proxy.py \
test_install.py test_extensions.py \
2020-02-19 11:57:11 +02:00
<< parameters.upgrade >>
2020-06-08 11:42:10 +03:00
2020-02-18 15:51:33 +02:00
admin_tests:
parameters:
upgrade:
type: string
default: ""
steps:
- run:
name: Run admin tests
command: |
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" \
--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: |
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 \
--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: |
2020-08-22 15:57:40 +03:00
py.test integration-tests/test_bootstrap.py -s
2020-02-18 15:51:33 +02:00
2020-02-18 16:32:45 +02:00
jobs:
integration-test:
docker:
- image: docker:18.05.0-ce-git
steps:
2020-02-24 14:20:37 +02:00
- run:
name: setup python3
command: |
apk add --no-cache python3 pytest
2020-02-17 10:38:53 +02:00
- checkout
2020-02-18 15:51:33 +02:00
- setup_remote_docker
2020-02-18 15:51:33 +02:00
- build_systemd_image
2020-08-22 00:13:16 +03:00
- bootstrap_checks
2020-02-19 11:57:11 +02:00
- basic_tests
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
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"
2020-02-18 15:51:33 +02:00
- plugin_tests:
upgrade: "--upgrade"
workflows:
version: 2
all-tests:
jobs:
- unit-test
- integration-test
2020-02-18 16:47:18 +02:00
- upgrade-test