From f6bdaa787cfa2d2a4d7661d88f66314ea45dc30f Mon Sep 17 00:00:00 2001 From: Cameron Yick Date: Tue, 16 Oct 2018 01:34:55 -0400 Subject: [PATCH] Relax Permissions for Python3 Run as root user due to changes in python logging --- .travis.yml | 9 +++++---- tests/airflow1.8-py2/docker-compose.yml | 1 - tests/airflow1.9-py3/airflow/build/Dockerfile | 5 ++++- tests/test_metrics_up.sh | 5 ++++- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 89630ac..5fc7e83 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,4 @@ -sudo: required +sudo: false services: - docker @@ -16,14 +16,15 @@ before_install: - chmod +x docker-compose - sudo mv docker-compose /usr/local/bin - chmod +x tests/test_metrics_up.sh + script: # Test Airflow 1.8 with Python 2 - cd tests/airflow1.8-py2 && docker-compose up -d - - ../${INTEGRATION_TEST_SCRIPT} + - ${TRAVIS_BUILD_DIR}/tests/${INTEGRATION_TEST_SCRIPT} - docker-compose down # Test Airflow 1.9 with Python 3 - - cd ../../tests/airflow1.9-py3 && docker-compose up -d - - ../${INTEGRATION_TEST_SCRIPT} + - cd ${TRAVIS_BUILD_DIR}/tests/airflow1.9-py3 && docker-compose up -d + - ${TRAVIS_BUILD_DIR}/tests/${INTEGRATION_TEST_SCRIPT} - docker-compose down diff --git a/tests/airflow1.8-py2/docker-compose.yml b/tests/airflow1.8-py2/docker-compose.yml index d8ae9ac..e99eaaa 100644 --- a/tests/airflow1.8-py2/docker-compose.yml +++ b/tests/airflow1.8-py2/docker-compose.yml @@ -1,6 +1,5 @@ version: '2' - services: exporter_postgresql: diff --git a/tests/airflow1.9-py3/airflow/build/Dockerfile b/tests/airflow1.9-py3/airflow/build/Dockerfile index 0c0f864..e5695a9 100644 --- a/tests/airflow1.9-py3/airflow/build/Dockerfile +++ b/tests/airflow1.9-py3/airflow/build/Dockerfile @@ -4,4 +4,7 @@ USER root RUN pip3 install prometheus_client -USER airflow +# RUN mkdir -p /usr/local/airflow/logs && chown airflow -R /usr/local/airflow/logs +# # RUN chown -R airflow /usr/local/airflow + +# USER airflow diff --git a/tests/test_metrics_up.sh b/tests/test_metrics_up.sh index 109987f..34be915 100644 --- a/tests/test_metrics_up.sh +++ b/tests/test_metrics_up.sh @@ -4,13 +4,16 @@ # 2. Ensures the Metrics endpoint returned a valid response # Depends on Curl -AIRFLOW_SLEEP_DURATION=70 # Number of seconds to wait for airflow to start +AIRFLOW_SLEEP_DURATION=90 # Number of seconds to wait for airflow to start +ADMIN_ENDPOINT="http://localhost:8080/admin/" METRICS_ENDPOINT="http://localhost:8080/admin/metrics/" # Return nonzero status code if endpoint does not return 200 CURL_FLAGS="--show-error --fail" +echo "Waiting ${AIRFLOW_SLEEP_DURATION} seconds for Airflow to start before pinging" sleep ${AIRFLOW_SLEEP_DURATION} +curl ${CURL_FLAGS} --silent ${ADMIN_ENDPOINT} && echo 'Admin console is up' curl ${CURL_FLAGS} ${METRICS_ENDPOINT} # TODO: validate the contents of the CURLed data