pierrejeambrun commented on code in PR #48239:
URL: https://github.com/apache/airflow/pull/48239#discussion_r2014749929
##########
airflow-core/tests/unit/jobs/test_triggerer_job.py:
##########
@@ -589,3 +594,97 @@ def test_failed_trigger(session, dag_maker,
supervisor_builder):
assert task_instance.next_method == "__fail__"
assert task_instance.next_kwargs["error"] == "Trigger failure"
assert task_instance.next_kwargs["traceback"][-1] == "ModuleNotFoundError:
No module named 'fake'\n"
+
+
+class CustomTrigger(BaseTrigger):
+ """Custom Trigger that will access one Variable and one Connection."""
+
+ async def run(self) -> AsyncIterator[TriggerEvent]:
+ import attrs
+
+ from airflow.sdk import Variable
+
+ conn = await sync_to_async(BaseHook.get_connection)("test_connection")
+
+ self.log.info("Loaded conn %s", conn.conn_id)
+
+ variable = await sync_to_async(Variable.get)("test_variable")
+
+ self.log.info("Loaded variable %s", variable)
+
+ yield TriggerEvent({"connection": attrs.asdict(conn), "variable":
variable})
+
+ def serialize(self) -> tuple[str, dict[str, Any]]:
+ return (
+ f"{type(self).__module__}.{type(self).__qualname__}",
+ {},
+ )
+
+
+class TestTriggerRunnerSupervisor(TriggerRunnerSupervisor):
Review Comment:
```suggestion
class DummyTriggerRunnerSupervisor(TriggerRunnerSupervisor):
```
--
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]