Download tests/test_simulator.py from NeerjaK/OnCallEnv: direct link, hf CLI and curl.
- Browser
- Download file 910 Bytes
-
https://huggingface.co/spaces/NeerjaK/OnCallEnv/resolve/main/tests/test_simulator.py
- Command line
-
hf download hf://spaces/NeerjaK/OnCallEnv/tests/test_simulator.py
-
curl -L -o test_simulator.py https://huggingface.co/spaces/NeerjaK/OnCallEnv/resolve/main/tests/test_simulator.py
910 Bytes
| import pytest | |
| from oncallenv.core.types import ScenarioSpec | |
| from oncallenv.simulation.faults import FAULTS | |
| from oncallenv.simulation.scenario_compiler import compile_scenario | |
| from oncallenv.telemetry.otlp import json_logs, prometheus_metrics | |
| def test_fault_primitives_emit_recognizable_telemetry(fault_name): | |
| spec = ScenarioSpec( | |
| task_id=f"test_{fault_name}", | |
| topology="simple_fanout", | |
| fault_primary=fault_name, | |
| inject_service="payment-service", | |
| latency_ms=1000, | |
| blast_radius=0.5, | |
| metric_noise=0.0, | |
| seed=1, | |
| ) | |
| graph = compile_scenario(spec) | |
| logs = json_logs(graph, "payment-service") | |
| metrics = prometheus_metrics(graph, "payment-service") | |
| assert fault_name == graph.root_cause_category | |
| assert "service.name" in logs | |
| assert "http_requests_total" in metrics | |