diff --git a/app/templates/runs/index.html b/app/templates/runs/index.html
index 94f030a1..4f9f8357 100644
--- a/app/templates/runs/index.html
+++ b/app/templates/runs/index.html
@@ -90,11 +90,12 @@
Import
New run
-{# Agents only: a control's trials are a check on the tasks, not results, and
- are shown as their launch's task checks. #}
+{# Runs and trials are agents only: a control's trials are a check on the tasks, not results.
+ The checks are counted apart, as each launch counts them. #}
{{ launches|length }} launch{{ '' if launches|length == 1 else 'es' }}·{{ n_agent_runs }} run{{ '' if n_agent_runs == 1 else 's' }}·{{ n_trials }} trial{{ '' if n_trials == 1 else 's' }}
+ {%- if n_checks %}·{{ n_checks }} check{{ '' if n_checks == 1 else 's' }}{% endif %}
{%- if workspace %}in {{ workspace.label }}{% endif -%}
diff --git a/app/ui_tests/test_controls_apart.py b/app/ui_tests/test_controls_apart.py
index 32933170..f9267afa 100644
--- a/app/ui_tests/test_controls_apart.py
+++ b/app/ui_tests/test_controls_apart.py
@@ -85,6 +85,9 @@ def get(self, path):
self.assertEqual(response.status_code, 200, path)
return response.get_data(as_text=True)
+ def header(self, html):
+ return text_of(re.search(r'
', html, re.S).group(0))
+
def row(self, html, job_id):
rows = [r for r in re.findall(r'
]*>.*?
', html, re.S) if '' % job_id in r]
self.assertEqual(len(rows), 1, job_id)
@@ -112,7 +115,7 @@ def test_a_control_that_failed_before_the_verifier_is_a_setup_failure(self):
def test_the_header_the_chips_and_the_mix_bar_count_the_agent_only(self):
html = self.get("/runs")
self.assertIn('data-runs="1" data-trials="4"', html)
- self.assertIn("· 1 run · 4 trials", text_of(re.search(r' ', html, re.S).group(0)))
+ self.assertEqual(self.header(html), "3 launches · 1 run · 4 trials · 2 checks")
self.assertIn('class="dataset-count">1 run·4 trials', html)
legend = re.search(r' .*? ', html, re.S).group(0)
chips = dict(re.findall(r'data-outcome="([a-z_]+)"[^>]*>[^<]*(\d+)', legend))
@@ -121,6 +124,14 @@ def test_the_header_the_chips_and_the_mix_bar_count_the_agent_only(self):
self.assertEqual(sorted(re.findall(r'style="flex:(\d+)" data-outcome="([a-z_]+)"', bar)),
[("1", "failed_verification"), ("1", "rate_limited"), ("2", "resolved")])
+ def test_the_header_counts_the_checks_apart_and_only_when_there_are_some(self):
+ # each job is a launch of its own here: no start time is recorded
+ for jobs, header in (([self.nop, self.oracle], "2 launches · 0 runs · 0 trials · 2 checks"),
+ ([self.nop], "1 launch · 0 runs · 0 trials · 1 check"),
+ ([self.agent], "1 launch · 1 run · 4 trials")):
+ self.jobs = jobs
+ self.assertEqual(self.header(self.get("/runs")), header)
+
def test_a_controls_line_names_each_control_with_its_verdict(self):
# the controls are their launch's task checks: a row each at the top of its table, with its verdict
html = self.get("/runs")
diff --git a/app/web/runs.py b/app/web/runs.py
index 3361fd2b..a6f4592e 100644
--- a/app/web/runs.py
+++ b/app/web/runs.py
@@ -100,6 +100,7 @@ def index():
datasets=datasets, choices=choices, pulse=_roots_pulse(), preparing=preparing,
launches=groups, view=view, states=states,
n_checked=sum(1 for g in groups if g["checked"]),
+ n_checks=sum(g["n_checks"] for g in groups),
)
|