diff --git a/.dockerignore b/.dockerignore index f673a52ccf4070..795f0842d6aea8 100644 --- a/.dockerignore +++ b/.dockerignore @@ -40,6 +40,7 @@ !.rat-excludes !.flake8 !pylintrc +!pytest.ini !LICENSE !MANIFEST.in !NOTICE diff --git a/Dockerfile b/Dockerfile index a485c0f9b9a0a2..0498a31c1839a7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -340,7 +340,7 @@ COPY docs/ ${AIRFLOW_SOURCES}/docs/ COPY tests/ ${AIRFLOW_SOURCES}/tests/ COPY airflow/ ${AIRFLOW_SOURCES}/airflow/ COPY .coveragerc .rat-excludes .flake8 pylintrc LICENSE MANIFEST.in NOTICE CHANGELOG.txt \ - .github \ + .github pytest.ini \ setup.cfg setup.py \ ${AIRFLOW_SOURCES}/ diff --git a/tests/pytest.ini b/pytest.ini similarity index 98% rename from tests/pytest.ini rename to pytest.ini index 9eab3b153b0f57..7f838bbb150de9 100644 --- a/tests/pytest.ini +++ b/pytest.ini @@ -26,6 +26,8 @@ addopts = --ignore=tests/dags/test_impersonation_subdag.py --ignore=tests/dags/test_subdag.py norecursedirs = + .eggs + airflow tests/dags_with_system_exit tests/test_utils tests/dags_corrupted diff --git a/scripts/ci/_utils.sh b/scripts/ci/_utils.sh index 5137ce0253c26e..9ad65454eb7372 100644 --- a/scripts/ci/_utils.sh +++ b/scripts/ci/_utils.sh @@ -105,6 +105,7 @@ elif [[ ${AIRFLOW_MOUNT_HOST_VOLUMES_FOR_STATIC_CHECKS} == "true" ]]; then "-v" "${AIRFLOW_SOURCES}/tests:/opt/airflow/tests:cached" \ "-v" "${AIRFLOW_SOURCES}/.flake8:/opt/airflow/.flake8:cached" \ "-v" "${AIRFLOW_SOURCES}/pylintrc:/opt/airflow/pylintrc:cached" \ + "-v" "${AIRFLOW_SOURCES}/pytest.ini:/opt/airflow/pytest.ini:cached" \ "-v" "${AIRFLOW_SOURCES}/setup.cfg:/opt/airflow/setup.cfg:cached" \ "-v" "${AIRFLOW_SOURCES}/setup.py:/opt/airflow/setup.py:cached" \ "-v" "${AIRFLOW_SOURCES}/.rat-excludes:/opt/airflow/.rat-excludes:cached" \ diff --git a/scripts/ci/docker-compose-local.yml b/scripts/ci/docker-compose-local.yml index dc1ba05c2a245a..e44fab57e4ff26 100644 --- a/scripts/ci/docker-compose-local.yml +++ b/scripts/ci/docker-compose-local.yml @@ -50,6 +50,7 @@ services: - ../../.inputrc:/root/.inputrc:cached - ../../.flake8:/opt/airflow/.flake8:cached - ../../pylintrc:/opt/airflow/pylintrc:cached + - ../../pytest.ini:/opt/airflow/pytest.ini:cached - ../../.rat-excludes:/opt/airflow/.rat-excludes:cached - ../../logs:/root/airflow/logs:cached - ../../tmp:/opt/airflow/tmp:cached diff --git a/tests/integration/kubernetes/test_kubernetes_executor.py b/tests/integration/kubernetes/test_kubernetes_executor.py index c335f16f0de110..14fb2958f348ec 100644 --- a/tests/integration/kubernetes/test_kubernetes_executor.py +++ b/tests/integration/kubernetes/test_kubernetes_executor.py @@ -30,7 +30,7 @@ try: check_call(["/usr/local/bin/kubectl", "get", "pods"]) except Exception as e: # pylint: disable=broad-except - if os.environ.get('KUBERNETES_VERSION'): + if os.environ.get('KUBERNETES_VERSION') and os.environ.get('ENV', 'kubernetes') == 'kubernetes': raise e else: raise unittest.SkipTest( diff --git a/tests/integration/kubernetes/test_kubernetes_pod_operator.py b/tests/integration/kubernetes/test_kubernetes_pod_operator.py index 35c414c52cc1ac..2e1f537d85bac7 100644 --- a/tests/integration/kubernetes/test_kubernetes_pod_operator.py +++ b/tests/integration/kubernetes/test_kubernetes_pod_operator.py @@ -40,7 +40,7 @@ try: check_call(["/usr/local/bin/kubectl", "get", "pods"]) except Exception as e: # pylint: disable=broad-except - if os.environ.get('KUBERNETES_VERSION'): + if os.environ.get('KUBERNETES_VERSION') and os.environ.get('ENV', 'kubernetes') == 'kubernetes': raise e else: raise unittest.SkipTest(