You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/03/18 12:33:15 UTC
[GitHub] [airflow] uranusjr opened a new pull request #14875: Convert TestDagRunsEndpoint to use module fixture
uranusjr opened a new pull request #14875:
URL: https://github.com/apache/airflow/pull/14875
Quick gain similar to #14746.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] uranusjr commented on a change in pull request #14875: Convert TestDagRunsEndpoint to use module fixture
Posted by GitBox <gi...@apache.org>.
uranusjr commented on a change in pull request #14875:
URL: https://github.com/apache/airflow/pull/14875#discussion_r597830876
##########
File path: tests/www/api/experimental/test_dag_runs_endpoint.py
##########
@@ -27,10 +28,26 @@
from tests.test_utils.decorators import dont_initialize_flask_app_submodules
-class TestDagRunsEndpoint(unittest.TestCase):
- @classmethod
- def setUpClass(cls):
- super().setUpClass()
+@pytest.fixture(scope="module")
Review comment:
My understanding is, the fixuture’s lifeline is not tied to the module *itself*, but pytest internally tracks whether all tests in the module and tears down module-level fixtures after they all run. `scope` means more like “tests in this scope” in the lexical sense, not the actual function/class/module the fixture lives in.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] ashb merged pull request #14875: Convert TestDagRunsEndpoint to use module fixture
Posted by GitBox <gi...@apache.org>.
ashb merged pull request #14875:
URL: https://github.com/apache/airflow/pull/14875
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] ashb commented on a change in pull request #14875: Convert TestDagRunsEndpoint to use module fixture
Posted by GitBox <gi...@apache.org>.
ashb commented on a change in pull request #14875:
URL: https://github.com/apache/airflow/pull/14875#discussion_r597847370
##########
File path: tests/www/api/experimental/test_dag_runs_endpoint.py
##########
@@ -27,10 +28,26 @@
from tests.test_utils.decorators import dont_initialize_flask_app_submodules
-class TestDagRunsEndpoint(unittest.TestCase):
- @classmethod
- def setUpClass(cls):
- super().setUpClass()
+@pytest.fixture(scope="module")
Review comment:
Yeah, this is not tied to the module being imported/unimported, but to what tests Pytest has left to run.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] sfc-gh-kbregula commented on a change in pull request #14875: Convert TestDagRunsEndpoint to use module fixture
Posted by GitBox <gi...@apache.org>.
sfc-gh-kbregula commented on a change in pull request #14875:
URL: https://github.com/apache/airflow/pull/14875#discussion_r597806404
##########
File path: tests/www/api/experimental/test_dag_runs_endpoint.py
##########
@@ -27,10 +28,26 @@
from tests.test_utils.decorators import dont_initialize_flask_app_submodules
-class TestDagRunsEndpoint(unittest.TestCase):
- @classmethod
- def setUpClass(cls):
- super().setUpClass()
+@pytest.fixture(scope="module")
Review comment:
My fear is that the module never closes, so this creates a side effect between all tests. Am I right?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] uranusjr commented on a change in pull request #14875: Convert TestDagRunsEndpoint to use module fixture
Posted by GitBox <gi...@apache.org>.
uranusjr commented on a change in pull request #14875:
URL: https://github.com/apache/airflow/pull/14875#discussion_r597830876
##########
File path: tests/www/api/experimental/test_dag_runs_endpoint.py
##########
@@ -27,10 +28,26 @@
from tests.test_utils.decorators import dont_initialize_flask_app_submodules
-class TestDagRunsEndpoint(unittest.TestCase):
- @classmethod
- def setUpClass(cls):
- super().setUpClass()
+@pytest.fixture(scope="module")
Review comment:
My understanding is, the fixuture’s lifeline is not tied to the module *itself*, but pytest internally tracks whether all tests in the module and tears down the fixture after they all run. `scope` means more like “tests in this scope” in the lexical sense, not the actual function/class/module the fixture lives in.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] ashb commented on a change in pull request #14875: Convert TestDagRunsEndpoint to use module fixture
Posted by GitBox <gi...@apache.org>.
ashb commented on a change in pull request #14875:
URL: https://github.com/apache/airflow/pull/14875#discussion_r597847370
##########
File path: tests/www/api/experimental/test_dag_runs_endpoint.py
##########
@@ -27,10 +28,26 @@
from tests.test_utils.decorators import dont_initialize_flask_app_submodules
-class TestDagRunsEndpoint(unittest.TestCase):
- @classmethod
- def setUpClass(cls):
- super().setUpClass()
+@pytest.fixture(scope="module")
Review comment:
Yeah, this is not tied to the module being imported/unimported, but to what tests Pytest has left to run.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] uranusjr commented on a change in pull request #14875: Convert TestDagRunsEndpoint to use module fixture
Posted by GitBox <gi...@apache.org>.
uranusjr commented on a change in pull request #14875:
URL: https://github.com/apache/airflow/pull/14875#discussion_r597830876
##########
File path: tests/www/api/experimental/test_dag_runs_endpoint.py
##########
@@ -27,10 +28,26 @@
from tests.test_utils.decorators import dont_initialize_flask_app_submodules
-class TestDagRunsEndpoint(unittest.TestCase):
- @classmethod
- def setUpClass(cls):
- super().setUpClass()
+@pytest.fixture(scope="module")
Review comment:
My understanding is, the fixuture’s lifeline is not tied to the module *itself*, but pytest internally tracks whether all tests in the module and tears down module-level fixtures after they all run. `scope` means more like “tests in this scope” in the lexical sense, not the actual function/class/module the fixture lives in.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] github-actions[bot] commented on pull request #14875: Convert TestDagRunsEndpoint to use module fixture
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #14875:
URL: https://github.com/apache/airflow/pull/14875#issuecomment-802141924
The PR is likely OK to be merged with just subset of tests for default Python and Database versions without running the full matrix of tests, because it does not modify the core of Airflow. If the committers decide that the full tests matrix is needed, they will add the label 'full tests needed'. Then you should rebase to the latest master or amend the last commit of the PR, and push it with --force-with-lease.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] ashb commented on pull request #14875: Convert TestDagRunsEndpoint to use module fixture
Posted by GitBox <gi...@apache.org>.
ashb commented on pull request #14875:
URL: https://github.com/apache/airflow/pull/14875#issuecomment-804199144
Nice. 48s -> 10s 😁
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] sfc-gh-kbregula commented on a change in pull request #14875: Convert TestDagRunsEndpoint to use module fixture
Posted by GitBox <gi...@apache.org>.
sfc-gh-kbregula commented on a change in pull request #14875:
URL: https://github.com/apache/airflow/pull/14875#discussion_r597806404
##########
File path: tests/www/api/experimental/test_dag_runs_endpoint.py
##########
@@ -27,10 +28,26 @@
from tests.test_utils.decorators import dont_initialize_flask_app_submodules
-class TestDagRunsEndpoint(unittest.TestCase):
- @classmethod
- def setUpClass(cls):
- super().setUpClass()
+@pytest.fixture(scope="module")
Review comment:
My fear is that the module never closes, so this creates a side effect between all tests. Am I right?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] boring-cyborg[bot] commented on pull request #14875: Convert TestDagRunsEndpoint to use module fixture
Posted by GitBox <gi...@apache.org>.
boring-cyborg[bot] commented on pull request #14875:
URL: https://github.com/apache/airflow/pull/14875#issuecomment-804194403
Awesome work, congrats on your first merged pull request!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org