Index: lnt/trunk/lnt/server/reporting/analysis.py
===================================================================
--- lnt/trunk/lnt/server/reporting/analysis.py
+++ lnt/trunk/lnt/server/reporting/analysis.py
@@ -273,7 +273,7 @@
compare_to = []
return self.get_comparison_result([run], compare_to, test_id, field)
- def get_samples(self, runs, test_id, field):
+ def get_samples(self, runs, test_id):
all_samples = []
for run in runs:
samples = self.sample_map.get((run.id, test_id))
@@ -287,8 +287,8 @@
# Load the sample data for the current and previous runs and the
# comparison window.
- run_samples = self.get_samples(runs, test_id, field)
- prev_samples = self.get_samples(compare_runs, test_id, field)
+ run_samples = self.get_samples(runs, test_id)
+ prev_samples = self.get_samples(compare_runs, test_id)
# Determine whether this (test,pset) passed or failed in the current and
# previous runs.
Index: lnt/trunk/lnt/server/reporting/dailyreport.py
===================================================================
--- lnt/trunk/lnt/server/reporting/dailyreport.py
+++ lnt/trunk/lnt/server/reporting/dailyreport.py
@@ -94,6 +94,7 @@
self.reporting_machines = None
self.reporting_tests = None
self.result_table = None
+ self.nr_tests_table = None
def get_query_parameters_string(self):
query_params = [
@@ -283,6 +284,7 @@
return (-int(had_failures), -sum_abs_day0_deltas, test.name)
self.result_table = []
+ self.nr_tests_table = []
for field in self.fields:
field_results = []
for test in self.reporting_tests:
@@ -297,7 +299,7 @@
day_has_samples = []
for i in range(0, self.num_prior_days_to_include):
runs = self.machine_past_runs.get((machine.id, i), ())
- samples = sri.get_samples(runs, test.id, field)
+ samples = sri.get_samples(runs, test.id)
day_has_samples.append(len(samples) > 0)
def find_most_recent_run_with_samples(day_nr):
@@ -346,9 +348,21 @@
# Order the field results by "priority".
field_results.sort(key=compute_visible_results_priority)
-
self.result_table.append((field, field_results))
+ for machine in self.reporting_machines:
+ nr_tests_for_machine = []
+ for i in range(0, self.num_prior_days_to_include):
+ # get all runs with the same largest "order" on a given day
+ day_runs = machine_runs.get((machine.id, i), ())
+ nr_tests_seen = 0
+ for test in self.reporting_tests:
+ samples = sri.get_samples(day_runs, test.id)
+ if len(samples)>0:
+ nr_tests_seen += 1
+ nr_tests_for_machine.append(nr_tests_seen)
+ self.nr_tests_table.append((machine, nr_tests_for_machine))
+
def render(self, ts_url, only_html_body=True):
# Strip any trailing slash on the testsuite URL.
if ts_url.endswith('/'):
Index: lnt/trunk/lnt/server/ui/templates/reporting/daily_report.html
===================================================================
--- lnt/trunk/lnt/server/ui/templates/reporting/daily_report.html
+++ lnt/trunk/lnt/server/ui/templates/reporting/daily_report.html
@@ -61,22 +61,24 @@
{%- endfor %}
+
{%- for machine in report.reporting_machines %}
-
- {{machine.name}} |
+
+ {{machine.name}} |
{%- for i in range(report.num_prior_days_to_include)|reverse %}
{%- set key_run = report.get_key_run(machine, i) -%}
{%- if key_run -%}
- {# FIXME: Don't hard code field name. #}
-
- {{
- key_run.order.llvm_project_revision}} |
+ {# FIXME: Don't hard code field name. #}
+
+ {{
+ key_run.order.llvm_project_revision}} |
{%- else -%}
- N/A |
+ N/A |
{%- endif -%}
{%- endfor %}
-
+
{% endfor %}
+
{% macro get_initial_cell_value(day_result) %}
@@ -192,9 +194,9 @@
{% for field,field_results in report.result_table|reverse %}
Result Table ({{ field.name }})
-{{ result_header() if not report.for_mail }}
+{{ result_header()+"\n " if not report.for_mail }}
{%- for test,visible_results in field_results -%}
-{{ result_header() if report.for_mail }}
+{{ result_header()+"\n " if report.for_mail }}
{{test.name}} |
|
@@ -223,11 +225,40 @@
{{ spark_plot(day_results) }} |
{%- endfor %}
-{{ "" if report.for_mail }}
+{{ "
" if report.for_mail }}
{%- endfor %}
-{{ "" if not report.for_mail }}
+{{ "" if not report.for_mail }}
{%- endfor -%}
+
Number of Tests Seen
+
+
+
+ Machine Name |
+ {% for i in range(report.num_prior_days_to_include)|reverse %}
+ Day - {{i}} |
+ {% endfor %}
+
+
+
+ {% for machine, nr_tests_for_machine in report.nr_tests_table %}
+
+ {{machine.name}} |
+ {% set nr_tests_prev = None %}
+ {% for nr_tests in nr_tests_for_machine|reverse %}
+ {{nr_tests}} |
+ {% set nr_tests_prev = nr_tests %}
+ {% endfor %}
+
+ {% endfor %}
+
+
+
{% endif %}
{% if not only_html_body %}
Index: lnt/trunk/tests/server/ui/V4Pages.py
===================================================================
--- lnt/trunk/tests/server/ui/V4Pages.py
+++ lnt/trunk/tests/server/ui/V4Pages.py
@@ -96,7 +96,7 @@
if reported_machine_order_table is None:
nr_machines = 0
else:
- nr_machines = len(reported_machine_order_table.findall("./tr"))
+ nr_machines = len(reported_machine_order_table.findall("./tbody/tr"))
assert expected_nr_machines == nr_machines
@@ -104,39 +104,51 @@
return ("".join(element.itertext()))
-def get_results_table(client, url, fieldname):
+def get_table_by_header(client, url, table_header):
resp = check_code(client, url)
html = resp.data
tree = get_xml_tree(html)
- table_header = "Result Table (%s)" % fieldname
table = find_table_with_heading(tree, table_header)
assert table is not None, \
"Couldn't find table with header '%s'" % table_header
return table
-def check_body_result_table(client, url, fieldname,
- expected_table_body_content):
- table = get_results_table(client, url, fieldname)
+def get_results_table(client, url, fieldname):
+ table_header = "Result Table (%s)" % fieldname
+ return get_table_by_header(client, url, table_header)
+
+
+def check_table_content(table, expected_content):
body_content = [[convert_html_to_text(cell).strip()
for cell in row.findall("./td")]
- for row in table.findall("./tr")]
- assert expected_table_body_content == body_content, \
+ for row in table.findall("./tbody/tr")]
+ assert expected_content == body_content, \
"Expected table content %s, found %s" % \
- (expected_table_body_content, body_content)
+ (expected_content, body_content)
+
+
+def check_body_result_table(client, url, fieldname, expected_content):
+ table = get_results_table(client, url, fieldname)
+ check_table_content(table, expected_content)
+
+
+def check_body_nr_tests_table(client, url, expected_content):
+ table_header = "Number of Tests Seen"
+ table = get_table_by_header(client, url, table_header)
+ check_table_content(table, expected_content)
def get_sparkline(client, url, fieldname, testname, machinename):
table = get_results_table(client, url, fieldname)
body_content = [[cell
for cell in row.findall("./td")]
- for row in table.findall("./tr")]
+ for row in table.findall("./tbody/tr")]
txt_body_content = [[convert_html_to_text(cell).strip()
for cell in row.findall("./td")]
- for row in table.findall("./tr")]
+ for row in table.findall("./tbody/tr")]
cur_test_name = ""
for rownr, row_content in enumerate(txt_body_content):
- nr_columns = len(row_content)
for colnr, col_content in enumerate(row_content):
if colnr == 0 and col_content != "":
cur_test_name = col_content
@@ -285,6 +297,13 @@
assert 2 == nr_sample_points, \
"Expected 2 sample points, found %d" % nr_sample_points
+ check_body_nr_tests_table(
+ client, '/v4/nts/daily_report/2012/5/04',
+ [['machine2', '2', '0', '1']])
+
+
+
+
# Now check the compile report
# Get the V4 overview page.
check_code(client, '/v4/compile/')