Skip to content

Commit

Permalink
workflows: add testing to wf callback failure
Browse files Browse the repository at this point in the history
  • Loading branch information
DonHaul committed Dec 19, 2024
1 parent c1e251c commit 348744d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
params={
"workflow_id": Param(type="string", default=""),
"data": Param(type="object", default={}),
"collection": Param(type="string", default=AUTHORS),
},
start_date=datetime.datetime(2024, 5, 5),
schedule=None,
Expand Down
15 changes: 13 additions & 2 deletions workflows/tests/test_dags_integrity.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
from airflow.models import DagBag


def test_dagbag():
class TestDagsIntegrity:
dag_bag = DagBag(include_examples=False)
assert not dag_bag.import_errors

def test_dagbag(self):
assert not self.dag_bag.import_errors

def test_on_failure_callback(self):
for dag_id, dag in self.dag_bag.dags.items():
if (
dag.__dict__.get("on_failure_callback")
and dag.__dict__.get("on_failure_callback").__name__
== "set_workflow_status_to_error"
):
assert "collection" in dag.__dict__["params"], dag_id

0 comments on commit 348744d

Please sign in to comment.