From f656f988ee43f775d29a09fd53eb388f92fb311b Mon Sep 17 00:00:00 2001 From: Kaxil Naik Date: Wed, 10 Mar 2021 15:00:02 +0000 Subject: [PATCH] Separate out tests to cater of changes in Python 3.8.8 https://github.com/python/cpython/pull/24297 change was included in Python 3.8.8 to fix a vulnerability (bpo-42967) Depending on which Base Python Image is run in our CI, two of the tests can fail or succeed. Our Previous two attempts: - https://github.com/apache/airflow/commit/061cd236deb22567e4de36af11025f028d787989# - https://github.com/apache/airflow/commit/49952e79b04da932242ebf3981883e591b467994 We might for a while get different base python version depending on the changes of a PR (whether or not it includes a change to dockerfiler). a) when you have PR which do not have changes in the Dockerfile, they will use the older python version as base (for example Python 3.8.7) b) when you have PR that touches the Dockerfile and have setup.py changes in master, it should pull Python 3.8.8 first. --- tests/www/test_views.py | 72 +++++++++++++++++++++++++++++++++++++---- 1 file changed, 66 insertions(+), 6 deletions(-) diff --git a/tests/www/test_views.py b/tests/www/test_views.py index ef05f6b1e675..517d4bc56f99 100644 --- a/tests/www/test_views.py +++ b/tests/www/test_views.py @@ -2784,7 +2784,38 @@ def test_trigger_dag_form(self): ("%2Fgraph%3Fdag_id%3Dexample_bash_operator", "/graph?dag_id=example_bash_operator"), ] ) - def test_trigger_dag_form_origin_url(self, test_origin, expected_origin): + @pytest.mark.skipif( + sys.version_info < (3, 8, 8), + reason='Vulnerability was fixed in Python 3.8.8 which changed the query string separator: bpo-42967', + ) + def test_trigger_dag_form_origin_url_py_lte_387(self, test_origin, expected_origin): + test_dag_id = "example_bash_operator" + + resp = self.client.get(f'trigger?dag_id={test_dag_id}&origin={test_origin}') + self.check_content_in_response( + '