fix(verifier): recognize rollout success evidence
This commit is contained in:
@@ -142,6 +142,12 @@ class TestClassifyTool:
|
||||
h in reg.incident_type_hints for h in ["Pod", "Deploy", "Node"]
|
||||
)
|
||||
|
||||
def test_rollout_tool_is_high_priority_d1(self):
|
||||
reg = _classify_tool(_make_tool("k8s_watch_rollout"), self._provider())
|
||||
assert SensorDimension.D1_K8S_STATE in reg.dimensions
|
||||
assert reg.priority == 1
|
||||
assert "Deploy" in reg.incident_type_hints
|
||||
|
||||
def test_ssh_type_hints(self):
|
||||
reg = _classify_tool(_make_tool("ssh_run"), self._provider())
|
||||
assert any(h in reg.incident_type_hints for h in ["Host", "Docker"])
|
||||
|
||||
@@ -76,6 +76,16 @@ class TestAssessRecovery:
|
||||
post = {"pod": {"containers": "1/1"}}
|
||||
assert _assess_recovery(None, post, "scale_up") == "success"
|
||||
|
||||
def test_rollout_success_is_success(self):
|
||||
post = {
|
||||
"k8s_watch_rollout": {
|
||||
"deployment": "awoooi-auto-repair-canary",
|
||||
"success": True,
|
||||
"status": 'deployment "awoooi-auto-repair-canary" successfully rolled out',
|
||||
}
|
||||
}
|
||||
assert _assess_recovery(None, post, "auto_repair_playbook:PB-CANARY") == "success"
|
||||
|
||||
def test_crashloopbackoff_is_failed(self):
|
||||
post = {"pod": {"status": "CrashLoopBackOff"}}
|
||||
assert _assess_recovery(None, post, "restart_service") == "failed"
|
||||
|
||||
Reference in New Issue
Block a user