gyli commented on code in PR #47592:
URL: https://github.com/apache/airflow/pull/47592#discussion_r2214919441
##########
airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_backfills.py:
##########
@@ -92,10 +95,16 @@ def to_iso(val):
class TestBackfillEndpoint:
@provide_session
def _create_dag_models(self, *, count=1, dag_id_prefix="TEST_DAG",
is_paused=False, session=None):
+ bundle_name = "dags-folder"
+ orm_dag_bundle = DagBundleModel(name=bundle_name)
Review Comment:
For this one, I think adding dag bundle with the model class here provides a
good balance.
Other options have some cons:
1. Adding the fixture to the class - causing all tests to add create the
testing bundle, even if many of them don't need it
2. Using the fixture as a method argument in each test - there could be
multiple tests calling `_create_dag_models` as well, and the impacted lines
could be more than these 4 lines.
But I agree that fixture should be used in other fixture or single tests, as
you commented above.
##########
airflow-core/tests/unit/api_fastapi/common/db/test_dags.py:
##########
@@ -52,11 +54,17 @@ def setup_teardown(self):
def dag_with_queued_run(self, session):
"""Returns a DAG with a QUEUED DagRun and null start_date."""
+ bundle_name = "testing"
+ orm_dag_bundle = DagBundleModel(name=bundle_name)
Review Comment:
will update
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]