autoland: add integration tests for Dockerflow api calls (bug 1337501) r?smacleod draft
authorMāris Fogels <mars@mozilla.com>
Tue, 07 Feb 2017 15:59:39 -0500
changeset 112 fd951d778cde51fe671441cc42daaeab20fab092
parent 110 3ccb9b0e9b58aeb0b0b8cb492fb0b91b10b48555
push id69
push usermfogels@mozilla.com
push dateWed, 08 Feb 2017 22:09:34 +0000
reviewerssmacleod
bugs1337501
autoland: add integration tests for Dockerflow api calls (bug 1337501) r?smacleod Add integration tests for Ops' Dockerflow API calls. MozReview-Commit-ID: 8cpNjYXy8C3
autoland/public-web-api/test-requirements.txt
autoland/public-web-api/tests/test_dockerflow_container_api.py
--- a/autoland/public-web-api/test-requirements.txt
+++ b/autoland/public-web-api/test-requirements.txt
@@ -1,3 +1,45 @@
-flake8
-pytest
-yapf
+py==1.4.32 \
+    --hash=sha256:2d4bba2e25fff58140e6bdce1e485e89bb59776adbe01d490baa6b1f37a3dd6b
+
+pycodestyle==2.2.0 \
+    --hash=sha256:60c4e1c36f301ac539a550a29e9d16862069ec240472d86e5e71c4fc645829cb
+
+pyflakes==1.3.0 \
+    --hash=sha256:ad89dafee8ca32282116209a0ca4dff050bdc343af958721d5517d242c1215d5
+
+six==1.10.0 \
+    --hash=sha256:0ff78c403d9bccf5a425a6d31a12aa6b47f1c21ca4dc2573a7e2f32a97335eb1
+
+yapf==0.16.0 \
+    --hash=sha256:3a3c2c6e70a5d4fd2acbc290de7aaa64c6a65efd63a476c44a875eb1b2eef606 \
+    --hash=sha256:7d88facd0ff248a853eaadda3c0a11d51ca9677f93720e60d711d42125b9838a
+
+packaging==16.8 \
+    --hash=sha256:99276dc6e3a7851f32027a68f1095cd3f77c148091b092ea867a351811cfe388
+
+mccabe==0.5.3 \
+    --hash=sha256:f9b58bf366c1506dcd6117b33e5c4874746f0de859c9c7cab8b516cb6be1d22e
+
+pytest==3.0.6 \
+    --hash=sha256:da0ab50c7eec0683bc24f1c1137db1f4111752054ecdad63125e7ec71316b813 \
+    --hash=sha256:643434a9f1a188271da35e20064cb8b6c5440976c5bb541dc7b5b0e3cf75d940
+
+setuptools==34.1.1 \
+    --hash=sha256:5f74aabe68c441b99dca68c22796d5cbf532cb38b0aeada17d1d3988809de6e6
+
+pyparsing==2.1.10 \
+    --hash=sha256:67101d7acee692962f33dd30b5dce079ff532dd9aa99ff48d52a3dad51d2fe84
+
+pytest-tornado==0.4.5 \
+    --hash=sha256:28b772d8dbea3d98da94d6697f739652a373b35123e0ed60af77557c6a2c392c \
+    --hash=sha256:16aa582dc2638ba8e5a7e44ab0f6a6480a86c8b0aeda7b18f3aa0539d3256647
+
+appdirs==1.4.0 \
+    --hash=sha256:85e58578db8f29538f3109c11250c2a5514a2fcdc9890d9b2fe777eb55517736
+
+flake8==3.3.0 \
+    --hash=sha256:83905eadba99f73fbfe966598aaf1682b3eb6755d2263c5b33a4e8367d60b0d1 \
+    --hash=sha256:b907a26dcf5580753d8f80f1be0ec1d5c45b719f7bac441120793d1a70b03f12
+
+requests==2.13.0 \
+    --hash=sha256:1a720e8862a41aa22e339373b526f508ef0c8988baf48b84d3fc891a8e237efb
\ No newline at end of file
new file mode 100644
--- /dev/null
+++ b/autoland/public-web-api/tests/test_dockerflow_container_api.py
@@ -0,0 +1,29 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+"""
+Tests to ensure we honour the Dockerflow container API specification.
+
+See https://github.com/mozilla-services/Dockerflow for details.
+"""
+
+import pytest
+
+# FIXME: need to get pycharm test runner to add /app to the container PYTHONPATH
+import sys
+sys.path.insert(0, '/app')
+
+from autolandweb.server import make_app
+
+
+@pytest.fixture
+def app():
+    return make_app(False)
+
+
+@pytest.mark.gen_test
+def test_loadbalancer_heartbeat_returns_200(http_client, base_url):
+    lb_heartbeat_url = base_url + '/__lbheartbeat__'
+    response = yield http_client.fetch(lb_heartbeat_url)
+    assert response.code == 200