Files
wehub-resource-sync 4b6817381b
Benchmark image — build + push to ECR (any adapter) / build + push (push) Waiting to run
CI / quality (ubuntu-latest) (push) Waiting to run
CI / test (tools-runtime) (push) Waiting to run
CI / test (e2e-general) (push) Waiting to run
CI / test (cli-runtime) (push) Waiting to run
CI / test (e2e-provider-and-openclaw) (push) Waiting to run
CI / test (integrations-and-misc) (push) Waiting to run
CI / coverage-report (push) Blocked by required conditions
CI / test-kubernetes (push) Waiting to run
CI / should-run-thorough (push) Waiting to run
CI / test-thorough (cloudwatch-demo) (push) Blocked by required conditions
CI / test-thorough (flink-ecs) (push) Blocked by required conditions
CI / test-thorough (upstream-lambda) (push) Blocked by required conditions
CI / test-thorough (prefect-ecs-fargate) (push) Blocked by required conditions
CodeQL / Analyze (python) (push) Waiting to run
Release / build-binaries (zip, opensre.exe, onefile, windows-latest, windows-x64) (push) Blocked by required conditions
Release / publish-release (push) Blocked by required conditions
Release / publish-main-release (push) Blocked by required conditions
Release / prepare (push) Waiting to run
Release / verify (push) Blocked by required conditions
Release / build-python-dist (push) Blocked by required conditions
Release / build-binaries (tar.gz, opensre, onedir, macos-15-intel, darwin-x64) (push) Blocked by required conditions
Release / build-binaries (tar.gz, opensre, onedir, macos-latest, darwin-arm64) (push) Blocked by required conditions
Release / build-binaries (tar.gz, opensre, onedir, ubuntu-22.04, linux-x64) (push) Blocked by required conditions
Release / build-binaries (tar.gz, opensre, onedir, ubuntu-22.04-arm, linux-arm64) (push) Blocked by required conditions
Synthetic Deterministic Tests / Synthetic offline (deterministic) (push) Waiting to run
Interactive Shell Live (PR + post-merge) / turn-checks (no-LLM) (push) Waiting to run
Interactive Shell Live (PR + post-merge) / turn-live shard ${{ matrix.shard_index }} (push) Waiting to run
CI (OpenClaw E2E) / openclaw test (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 13:10:45 +08:00

82 lines
3.0 KiB
Python

"""Catalog wiring for the Temporal integration.
Regression coverage for the classifier path: a stored/remote Temporal record
must be flattened into a typed config whose fields the Temporal tools can read.
Before the classifier existed, a missing ``_CLASSIFIERS["temporal"]`` entry meant
records fell through the generic passthrough, leaving ``base_url`` nested under
``credentials`` so ``is_available``/``extract_params`` silently saw nothing.
"""
from __future__ import annotations
from integrations.catalog import classify_integrations
from integrations.temporal import classify
from integrations.temporal.client import TemporalConfig
from integrations.temporal.tools import TemporalWorkflowsTool
from tools.investigation.stages.gather_evidence.tools import availability_view
class TestClassify:
def test_returns_typed_config_with_required_fields(self) -> None:
cfg, key = classify(
{"base_url": "http://localhost:7243", "namespace": "production"},
record_id="rec-1",
)
assert key == "temporal"
assert isinstance(cfg, TemporalConfig)
assert cfg.base_url == "http://localhost:7243"
assert cfg.namespace == "production"
assert cfg.integration_id == "rec-1"
def test_defaults_namespace_when_absent(self) -> None:
cfg, key = classify({"base_url": "http://localhost:7243"}, record_id="rec-1")
assert key == "temporal"
assert cfg is not None
assert cfg.namespace == "default"
def test_skips_record_without_base_url(self) -> None:
cfg, key = classify({"namespace": "production"}, record_id="rec-1")
assert cfg is None
assert key is None
class TestCatalogEndToEnd:
"""The real wiring tools depend on: store record -> resolved -> tool params."""
def test_stored_record_reaches_tool_flattened(self) -> None:
resolved = classify_integrations(
[
{
"service": "temporal",
"id": "tmprl-1",
"status": "active",
"credentials": {
"base_url": "http://localhost:7243",
"namespace": "production",
"api_key": "",
},
}
]
)
view = availability_view(resolved)
tool = TemporalWorkflowsTool()
assert tool.is_available(view) is True
params = tool.extract_params(view)
assert params["base_url"] == "http://localhost:7243"
assert params["namespace"] == "production"
def test_unconfigured_record_is_not_advertised(self) -> None:
resolved = classify_integrations(
[
{
"service": "temporal",
"id": "tmprl-1",
"status": "active",
"credentials": {"namespace": "default"},
}
]
)
assert resolved.get("temporal") is None
assert TemporalWorkflowsTool().is_available(availability_view(resolved)) is False