|
| 1 | +import os |
1 | 2 | import uuid |
2 | 3 | import pytest |
3 | 4 |
|
|
11 | 12 | ) |
12 | 13 |
|
13 | 14 |
|
| 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 | + |
14 | 38 | def verify_param(expected, actual, param_name): |
15 | 39 | """Verify a single parameter value matches expected.""" |
16 | 40 | if actual != expected: |
@@ -42,6 +66,7 @@ def verify_pathspec(expected, actual): |
42 | 66 |
|
43 | 67 | def setup_test_deployment(test_name, exec_mode, decospecs, tag, scheduler_config): |
44 | 68 | """Common test setup for deployment tests.""" |
| 69 | + _require_trigger_infra(scheduler_config) |
45 | 70 | test_unique_tag = f"{test_name}_{exec_mode}" |
46 | 71 | combined_tags = tag + [test_unique_tag] |
47 | 72 | disp_test(exec_mode, decospecs, tag, scheduler_config) |
|
0 commit comments