Skip to content

Commit

Permalink
Change from rust to ICU4X in Summary (unicode-org#135)
Browse files Browse the repository at this point in the history
  • Loading branch information
sven-oly authored Nov 22, 2023
1 parent 38d4633 commit 12e4f0d
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 28 deletions.
15 changes: 11 additions & 4 deletions verifier/summary_template.html
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,9 @@
let exec_set = new Set();
for (const test_type of test_types) {
const tests = exec_summary_json[test_type];
for (node_version of tests) {
exec_set.add(node_version['exec']);
for (const node_version of tests) {
exec_set.add(node_version['version']['platform'])
// exec_set.add(node_version['exec']);
}
}

Expand All @@ -166,6 +167,7 @@
for (const exec of execs) {
td = th.insertCell();
td.innerHTML = exec;
td.style.textAlign = 'center';
td = th.insertCell();
td.innerHTML = "Details";
}
Expand All @@ -184,11 +186,16 @@
let data = [data_groups];
let details = [];
for (const report of tests) {
if (report['exec'] == exec) {
if (report['version']['platform'] == exec) {
// if (report['exec'] == exec) {
reports.push(report);
// Add data for this report.
const version_label = report['version']['platformVersion'] +
'\n' +
report['version']['icuVersion'];
const report_data = [
report['exec_version'],
version_label,
// report['exec_version'],
report['pass_count'],
report['fail_count'],
report['error_count'],
Expand Down
54 changes: 30 additions & 24 deletions verifier/testreport.py
Original file line number Diff line number Diff line change
Expand Up @@ -543,10 +543,10 @@ def characterize_failures_by_options(self, failing_tests):
value = input_data[key]
if key not in results:
results[key] = {}
if value in results[key]:
results[key][value].append(label)
else:
results[key][value] = [label]
if value in results[key]:
results[key][value].append(label)
else:
results[key][value] = [label]
except:
continue

Expand All @@ -557,10 +557,10 @@ def characterize_failures_by_options(self, failing_tests):
value = input_data[key]
if key not in results:
results[key] = {}
if value in results[key]:
results[key][value].append(label)
else:
results[key][value] = [label]
if value in results[key]:
results[key][value].append(label)
else:
results[key][value] = [label]
except:
continue

Expand All @@ -570,10 +570,10 @@ def characterize_failures_by_options(self, failing_tests):
value = test[key]
if key not in results:
results[key] = {}
if value in results[key]:
results[key][value].append(label)
else:
results[key][value] = [label]
if value in results[key]:
results[key][value].append(label)
else:
results[key][value] = [label]
except:
continue

Expand All @@ -592,10 +592,10 @@ def characterize_failures_by_options(self, failing_tests):
value = test['input_data'][key]
if key not in results:
results[key] = {}
if value in results[key]:
results[key][value].append(label)
else:
results[key][value] = [label]
if value in results[key]:
results[key][value].append(label)
else:
results[key][value] = [label]
except:
continue

Expand Down Expand Up @@ -950,7 +950,8 @@ def summarize_reports(self):
'json_file_name': filename,
'html_file_name': relative_html_path, # Relative to the report base
'version': platform,
'icu_version': icu_version
'icu_version': icu_version,
'platform_version': '%s %s' % (platform['platform'], platform['platformVersion'])
}
except BaseException as err:
logging.error('SUMMARIZE REPORTS for file %s. Error: %s' % (filename, err))
Expand Down Expand Up @@ -1012,14 +1013,20 @@ def create_summary_html(self):

# Set of executors
exec_set = set()
platform_version_list = set()
for executor in self.exec_summary:
exec_set.add(executor)
version = self.exec_summary[executor][0]['version']
platform_version_list.add(
'%s %s' % (version['platform'], version['platformVersion']))

exec_list = sorted(list(exec_set))
platform_version_list = sorted(platform_version_list)
# Build the table header

header_list = ['<th>Test type</th>']
for executor in exec_list:
header_vals = {'header_data': executor}
for platform in platform_version_list:
header_vals = {'header_data': platform}
header_list.append(self.header_item_template.safe_substitute(header_vals))

html_map['exec_header_line'] = self.line_template.safe_substitute(
Expand All @@ -1036,22 +1043,21 @@ def create_summary_html(self):
row_items.append('<td>NOT TESTED</td>')

index = 1
for executor in exec_list:
for platform_version in platform_version_list:
# Generate a TD element with the test data
for entry in self.type_summary[test]:
exec_version = entry['exec_version'].split('\n')[0]
# TODO: icu_version = entry['exec_version'].split('\n')[1]
if entry['test_type'] == test and exec_version == executor:
if entry['test_type'] == test and entry['platform_version'] == platform_version:
try:
# TODO: Add ICU version and detail link
link_info = '<a href="%s" target="_blank">Details</a>' % entry['html_file_name']
icu_version_and_link = '%s\n%s' % (entry['icu_version'], link_info)
row_items[index] = self.entry_template.safe_substitute(
{'report_detail': icu_version_and_link})
except BaseException as err:
print('!!!!! Error = %s' % err)
print('&&& TEST: %s, EXEC: %s, row_items: %s, index: %s' %
(test, executor, row_items, index))
logging.error('&&& TEST: %s, EXEC: %s, row_items: %s, index: %s. Error = %s',
test, executor, row_items, index, error)
index += 1

data_rows.append(self.line_template.safe_substitute(
Expand Down

0 comments on commit 12e4f0d

Please sign in to comment.