fix(docker): the overview's failed count sits in the heading of the list it counts, no tile row beside it; stale moves into the verdict (#5214)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -72,10 +72,10 @@ async def test_a_crash_loop_comes_first_and_a_stale_row_says_so(app):
|
||||
page = await _rows(app, attention=attention, restarting=1, stale=1, running=1, stopped=1, docker_hosts=1,
|
||||
containers=[_crow(loop, exit_failed=True), _crow(old, stale=True)], containers_total=2)
|
||||
|
||||
# #5298: the verdict first; only the tiles that aren't zero.
|
||||
# #5298: the verdict first; each problem section carries its own count (#5214).
|
||||
assert page.index('class="docker-verdict"') < page.index("Needs attention")
|
||||
assert "1 needs attention" in page and "1 container running, 1 stopped" in page
|
||||
assert "Unhealthy</span>" not in page and "Failed (24h)" not in page
|
||||
assert "unhealthy</span>" not in page and "Failed in the last 24h" not in page and "stat-strip" not in page
|
||||
card = page[page.index("Needs attention"):page.index("</section>")]
|
||||
assert '<span class="badge badge-crit">Restarting</span>' in card
|
||||
assert 'href="/plugins/docker/container/h1/api" title="api">api</a>' in card
|
||||
@@ -84,8 +84,9 @@ async def test_a_crash_loop_comes_first_and_a_stale_row_says_so(app):
|
||||
assert "cache" not in card
|
||||
assert page.index("Needs attention") < page.index("<table")
|
||||
|
||||
assert '<span class="stat-tile-label">Restarting</span><span class="stat-tile-value">1</span>' in page
|
||||
assert '<span class="stat-tile-label">Stale</span><span class="stat-tile-value">1</span>' in page
|
||||
assert ('Needs attention <span class="tone-crit">1</span> '
|
||||
'<span class="tone-muted">· 1 restarting</span></h2>') in card
|
||||
assert '">1 stale</span>' in page[:page.index("</p>")] # stale sits in the verdict
|
||||
assert 'class="badge badge-warn" title="Last report' in page # the stale row
|
||||
# CPU in cores, toned by its share of the host's CPUs through Settings → Thresholds.
|
||||
assert ('<span class="tone-crit" title="Docker counts CPU per core: 95% of one core, '
|
||||
@@ -149,7 +150,9 @@ async def test_a_failing_service_leads_and_the_failures_are_listed_once_with_the
|
||||
assert "9 failures · last: task: non-zero exit (1) · nas" in listed
|
||||
assert f'/plugins/docker/service/codex_db?task={"t" * 25}#logs"' in listed and "Logs of that task" in listed
|
||||
assert 'href="/plugins/docker/container/h1/backup/logs"' in listed
|
||||
assert '<span class="stat-tile-label">Failed (24h)</span><span class="stat-tile-value">2</span>' in page
|
||||
# The count sits in the heading of the list it counts: one widget, not a tile beside it.
|
||||
assert 'Failed in the last 24h <span class="tone-warn">2</span></h2>' in page
|
||||
assert "stat-tile" not in page
|
||||
|
||||
|
||||
async def test_services_and_containers_are_tables_that_sort_and_filter(app):
|
||||
|
||||
Reference in New Issue
Block a user