Skip to content

Commit 458ff3d

Browse files
author
Nissan Pow
committed
fix: skip trigger tests when event infra not available
@trigger_on_finish requires Argo Events / EventBridge / Airflow sensors which aren't in the CI devstack yet.
1 parent 4f63262 commit 458ff3d

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

test/ux/core/test_triggers.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import os
12
import uuid
23
import pytest
34

@@ -11,6 +12,29 @@
1112
)
1213

1314

15+
def _require_trigger_infra(scheduler_config):
16+
"""Skip if the backend lacks event/trigger infrastructure.
17+
18+
@trigger_on_finish requires:
19+
- argo-kubernetes: Argo Events (sensor + eventsource CRDs)
20+
- sfn-batch: EventBridge rules
21+
- airflow-kubernetes: Airflow sensors
22+
The devstack CI does not yet include these components.
23+
"""
24+
sched_type = scheduler_config.scheduler_type
25+
if sched_type is None:
26+
pytest.skip("No scheduler configured")
27+
28+
if "argo" in sched_type:
29+
webhook_url = os.environ.get("ARGO_EVENTS_WEBHOOK_URL", "")
30+
if not webhook_url:
31+
pytest.skip("Argo Events not configured (ARGO_EVENTS_WEBHOOK_URL unset)")
32+
elif "step-functions" in sched_type:
33+
pytest.skip("@trigger_on_finish not yet supported on sfn-batch in CI")
34+
elif "airflow" in sched_type:
35+
pytest.skip("@trigger_on_finish not yet supported on airflow in CI")
36+
37+
1438
def verify_param(expected, actual, param_name):
1539
"""Verify a single parameter value matches expected."""
1640
if actual != expected:
@@ -42,6 +66,7 @@ def verify_pathspec(expected, actual):
4266

4367
def setup_test_deployment(test_name, exec_mode, decospecs, tag, scheduler_config):
4468
"""Common test setup for deployment tests."""
69+
_require_trigger_infra(scheduler_config)
4570
test_unique_tag = f"{test_name}_{exec_mode}"
4671
combined_tags = tag + [test_unique_tag]
4772
disp_test(exec_mode, decospecs, tag, scheduler_config)

0 commit comments

Comments
 (0)