From 7b1efbf16ecee543ddc1459dc11efa8bebd55ff6 Mon Sep 17 00:00:00 2001 From: Min RK Date: Mon, 16 Jul 2018 17:52:44 -0700 Subject: [PATCH 1/2] run integration tests with pytest adds integration-tests directory --- .circleci/config.yml | 9 +++++++-- integration-tests/requirements.txt | 2 ++ integration-tests/test_hub.py | 5 +++++ 3 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 integration-tests/requirements.txt create mode 100644 integration-tests/test_hub.py diff --git a/.circleci/config.yml b/.circleci/config.yml index 2137945..5c75ef6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -72,9 +72,14 @@ jobs: python3 .circleci/integration-test.py run 'systemctl --no-pager status jupyterhub configurable-http-proxy' - run: - name: check jupyterhub is up + name: install integration test requirements command: | - python3 .circleci/integration-test.py run 'curl -L --fail http://127.0.0.1' + python3 .circleci/integration-test.py run 'python3 -m pip install -r /srv/src/integration-tests/requirements.txt' + + - run: + name: run integration tests + command: | + python3 .circleci/integration-test.py run 'python3 -m pytest -v /srv/src/integration-tests' workflows: version: 2 diff --git a/integration-tests/requirements.txt b/integration-tests/requirements.txt new file mode 100644 index 0000000..547de5c --- /dev/null +++ b/integration-tests/requirements.txt @@ -0,0 +1,2 @@ +pytest +requests diff --git a/integration-tests/test_hub.py b/integration-tests/test_hub.py new file mode 100644 index 0000000..d5d6cb0 --- /dev/null +++ b/integration-tests/test_hub.py @@ -0,0 +1,5 @@ +import requests + +def test_hub_up(): + r = requests.get('http://127.0.0.1') + r.raise_for_status() From 26ebc61a7916855ed3a718baa28d1a7d430c3da6 Mon Sep 17 00:00:00 2001 From: Min RK Date: Mon, 16 Jul 2018 18:07:17 -0700 Subject: [PATCH 2/2] move integration-test dockerfile to integration-tests directory --- .circleci/integration-test.py | 5 +++-- Dockerfile => integration-tests/Dockerfile | 0 2 files changed, 3 insertions(+), 2 deletions(-) rename Dockerfile => integration-tests/Dockerfile (100%) diff --git a/.circleci/integration-test.py b/.circleci/integration-test.py index 68b51f0..6751563 100644 --- a/.circleci/integration-test.py +++ b/.circleci/integration-test.py @@ -87,8 +87,9 @@ def main(): image_name = 'tljh-systemd' container_name = 'tljh-ci-run' - - source_path = os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) + source_path = os.path.abspath( + os.path.join(os.path.dirname(__file__), os.pardir, 'integration-tests') + ) if args.action == 'build-image': build_systemd_image(image_name, source_path) diff --git a/Dockerfile b/integration-tests/Dockerfile similarity index 100% rename from Dockerfile rename to integration-tests/Dockerfile