Revert "feat(lvl5): P1 — 5-rung ladder (L5=abra recipe lint) + de-capped level semantics"
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This reverts commit e219a7891d.
This commit is contained in:
@ -28,6 +28,7 @@ def _row(**kw):
|
||||
"ref": "db9a9502",
|
||||
"version": "db9a95024e9d",
|
||||
"level": 4,
|
||||
"level_cap_reason": "",
|
||||
"has_screenshot": True,
|
||||
"flags": {"clean_teardown": True, "no_secret_leak": True},
|
||||
"finished": 0,
|
||||
@ -39,7 +40,7 @@ def _row(**kw):
|
||||
|
||||
def test_level_color_ramp_and_fallback():
|
||||
assert dashboard.level_color(0) == "#e5534b"
|
||||
assert dashboard.level_color(5) == "#3fb950" # full 5-rung climb (phase lvl5)
|
||||
assert dashboard.level_color(6) == "#3fb950"
|
||||
assert dashboard.level_color(4) == "#a0b93f"
|
||||
assert dashboard.level_color(99) == "#8b949e"
|
||||
assert dashboard.level_color(None) == "#8b949e"
|
||||
@ -60,12 +61,20 @@ def test_overview_grid_mirrors_results():
|
||||
def test_overview_never_greener_than_data():
|
||||
# A failed run at level 0 must show level 0 + the failure pill — never a green/high level.
|
||||
out = dashboard.render_overview(
|
||||
[_row(status="failure", level=0, has_screenshot=False, flags={})]
|
||||
[
|
||||
_row(
|
||||
status="failure",
|
||||
level=0,
|
||||
has_screenshot=False,
|
||||
flags={},
|
||||
level_cap_reason="L1 install FAILED",
|
||||
)
|
||||
]
|
||||
)
|
||||
assert "level 0" in out
|
||||
assert dashboard.level_color(0) in out # red
|
||||
assert dashboard._COLORS["failure"] in out
|
||||
assert "level 4" not in out and "level 5" not in out
|
||||
assert "level 4" not in out and "level 5" not in out and "level 6" not in out
|
||||
assert "no screenshot" in out # placeholder, no broken image
|
||||
|
||||
|
||||
@ -95,6 +104,7 @@ def test_build_row_projects_results(monkeypatch):
|
||||
lambda n: {
|
||||
"version": "1.2.3",
|
||||
"level": 2,
|
||||
"level_cap_reason": "cap",
|
||||
"screenshot": "screenshot.png",
|
||||
"flags": {"clean_teardown": True},
|
||||
},
|
||||
@ -113,38 +123,6 @@ def test_build_row_projects_results(monkeypatch):
|
||||
assert r["url"].endswith("/cc-ci/7")
|
||||
|
||||
|
||||
def test_build_row_old_schema1_artifact_renders(monkeypatch):
|
||||
# History compatibility (phase lvl5): pre-lvl5 results.json still carries cap fields and a
|
||||
# 4-rung ladder — it must project + render without KeyError, level shown VERBATIM (no
|
||||
# retroactive relabeling), and the old cap text simply isn't resurfaced anywhere.
|
||||
monkeypatch.setattr(
|
||||
dashboard,
|
||||
"_results_for",
|
||||
lambda n: {
|
||||
"schema": 1,
|
||||
"version": "0.9.1",
|
||||
"level": 2,
|
||||
"level_cap_reason": "L3 backup/restore (data integrity) N/A",
|
||||
"level_cap_rung": "backup_restore",
|
||||
"screenshot": "screenshot.png",
|
||||
"flags": {"clean_teardown": True, "no_secret_leak": True},
|
||||
},
|
||||
)
|
||||
b = {
|
||||
"number": 11,
|
||||
"status": "success",
|
||||
"event": "custom",
|
||||
"params": {"RECIPE": "legacy", "REF": "abc123"},
|
||||
"finished": 5,
|
||||
}
|
||||
r = dashboard._build_row(b)
|
||||
out = dashboard.render_overview([r])
|
||||
assert "level 2" in out and dashboard.level_color(2) in out
|
||||
assert "N/A" not in out and "capped" not in out # cap language gone from the surface
|
||||
hist = dashboard.render_history("legacy", [r])
|
||||
assert "L2" in hist
|
||||
|
||||
|
||||
def test_build_row_degrades_without_results(monkeypatch):
|
||||
# No results.json (e.g. an old run): grid still renders from Drone fields, level absent.
|
||||
monkeypatch.setattr(dashboard, "_results_for", lambda n: {})
|
||||
|
||||
Reference in New Issue
Block a user