diff --git a/airflow/dag_processing/manager.py b/airflow/dag_processing/manager.py index a4e99e06a9dd2..b5429a484e9ea 100644 --- a/airflow/dag_processing/manager.py +++ b/airflow/dag_processing/manager.py @@ -407,7 +407,7 @@ def run(self): DagBundlesManager().sync_bundles_to_db() self.log.info("Getting all DAG bundles") - self._dag_bundles = DagBundlesManager().get_all_dag_bundles() + self._dag_bundles = list(DagBundlesManager().get_all_dag_bundles()) return self._run_parsing_loop() diff --git a/tests/conftest.py b/tests/conftest.py index 7194e8f307eae..8806dc1e8c1ad 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -104,13 +104,14 @@ def configure_testing_dag_bundle(): @contextmanager def _config_bundle(path_to_parse: Path | str): - bundle_config = { - "classpath": "airflow.dag_processing.bundles.local.LocalDagBundle", - "kwargs": {"local_folder": str(path_to_parse), "refresh_interval": 30}, - } - with conf_vars( - {("dag_bundles", "testing"): json.dumps(bundle_config), ("dag_bundles", "dags_folder"): ""} - ): + bundle_config = [ + { + "name": "testing", + "classpath": "airflow.dag_processing.bundles.local.LocalDagBundle", + "kwargs": {"local_folder": str(path_to_parse), "refresh_interval": 30}, + } + ] + with conf_vars({("dag_bundles", "backends"): json.dumps(bundle_config)}): yield return _config_bundle diff --git a/tests_common/test_utils/db.py b/tests_common/test_utils/db.py index d8abb8cda1a38..58ad46372d711 100644 --- a/tests_common/test_utils/db.py +++ b/tests_common/test_utils/db.py @@ -72,7 +72,7 @@ def _bootstrap_dagbag(): dagbag = DagBag() # Save DAGs in the ORM if AIRFLOW_V_3_0_PLUS: - dagbag.sync_to_db(bundle_name="dags_folder", bundle_version=None, session=session) + dagbag.sync_to_db(bundle_name="dags-folder", bundle_version=None, session=session) else: dagbag.sync_to_db(session=session) @@ -120,7 +120,7 @@ def parse_and_sync_to_db(folder: Path | str, include_examples: bool = False): dagbag = DagBag(dag_folder=folder, include_examples=include_examples) if AIRFLOW_V_3_0_PLUS: - dagbag.sync_to_db("dags_folder", None, session) + dagbag.sync_to_db("dags-folder", None, session) else: dagbag.sync_to_db(session=session) # type: ignore[call-arg] session.commit()