test(grpc-data): A2a — rig --conditions overlay (AlarmSubscribe exports + ScalarHigh scripted alarm), probe conditions scenario, conditions_smoke.py; X0/H2 tests move the 'future' bit off 64
This commit is contained in:
@@ -675,6 +675,8 @@ class LocalRig:
|
||||
files.extend(["--file", str(HERE / "compose.history.yml")])
|
||||
if self.environment.get("GRPC_DATA_HISTORY_BACKEND") == "questdb":
|
||||
files.extend(["--file", str(HERE / "compose.history.questdb.yml")])
|
||||
if self.environment.get("GRPC_DATA_CONDITIONS") == "1":
|
||||
files.extend(["--file", str(HERE / "compose.conditions.yml")])
|
||||
return files
|
||||
|
||||
def compose(self, *args, timeout=120):
|
||||
@@ -845,7 +847,7 @@ class LocalRig:
|
||||
self.save(manifest)
|
||||
return manifest
|
||||
|
||||
def up(self, timeout=600, history=False, history_backend="sqlserver"):
|
||||
def up(self, timeout=600, history=False, history_backend="sqlserver", conditions=False):
|
||||
import secrets
|
||||
import credentials
|
||||
if self.folder.exists():
|
||||
@@ -870,6 +872,8 @@ class LocalRig:
|
||||
raise RigError("unknown history backend")
|
||||
settings["GRPC_DATA_HISTORY"] = "1"
|
||||
settings["GRPC_DATA_HISTORY_BACKEND"] = history_backend
|
||||
if conditions:
|
||||
settings["GRPC_DATA_CONDITIONS"] = "1"
|
||||
atomic_write_secret(self.folder / "environment.json", json.dumps(settings))
|
||||
self.environment.update(settings)
|
||||
credentials.provision_tls(self.folder / "security", NODES[2:])
|
||||
@@ -1337,6 +1341,7 @@ def main(argv=None):
|
||||
parser.add_argument("action", choices=("preflight", "up", "seed", "deploy", "status", "down"))
|
||||
parser.add_argument("--run-id")
|
||||
parser.add_argument("--timeout", type=float, default=None)
|
||||
parser.add_argument("--conditions", action="store_true", help="up only: add the A2a conditions overlay (AlarmSubscribe exports + one scripted alarm)")
|
||||
parser.add_argument("--history", action="store_true", help="up only: add the H2 history overlay (SOURCE historian + history seed profile)")
|
||||
parser.add_argument("--history-backend", choices=HISTORY_BACKENDS, default=None,
|
||||
help="up --history only: the SOURCE historian backend (sqlserver = the run's SQL container, default; questdb = a run-owned QuestDB)")
|
||||
@@ -1366,6 +1371,10 @@ def main(argv=None):
|
||||
options["history_backend"] = arguments.history_backend
|
||||
elif arguments.history_backend is not None:
|
||||
raise RigError("--history-backend needs up --history")
|
||||
if arguments.conditions:
|
||||
if arguments.action != "up":
|
||||
raise RigError("--conditions applies to up only; the run remembers it")
|
||||
options["conditions"] = True
|
||||
result = action(**options)
|
||||
print(json.dumps({"run_id": result["run_id"], "state": result.get("state"), "manifest": str(rig.path), "healthy": result.get("healthy")}))
|
||||
return 0
|
||||
|
||||
Reference in New Issue
Block a user