Skip to content

Commit 8665dc8

Browse files
authored
Revamp overall report UI and improve report navigation (#1102)
This PR overhauls the overall report UI (layout and template/sample pages) and adds a few improvements including: - A dark mode theme for all three pages - Navigation breadcrumbs - Toggle-able table of content for the index page (located top right of the screen) - Dedicated header showing aggregated results for the index and benchmark pages - A function to create a unified JSON file out of experimental results that preserves the hierarchical relationships between projects, benchmarks, and samples
1 parent 8c881cb commit 8665dc8

File tree

10 files changed

+1412
-213
lines changed

10 files changed

+1412
-213
lines changed

report/common.py

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -485,14 +485,29 @@ def get_macro_insights(self,
485485
benchmarks: list[Benchmark]) -> AccumulatedResult:
486486
"""Returns macro insights from the aggregated benchmark results."""
487487
accumulated_results = AccumulatedResult()
488-
for benchmark in benchmarks:
489-
accumulated_results.compiles += int(
490-
benchmark.result.build_success_rate > 0.0)
491-
accumulated_results.crashes += int(benchmark.result.found_bug > 0)
492-
accumulated_results.total_coverage += benchmark.result.max_coverage
493-
accumulated_results.total_runs += 1
494-
accumulated_results.total_line_coverage_diff += (
495-
benchmark.result.max_line_coverage_diff)
488+
if len(benchmarks) == 1:
489+
benchmark = benchmarks[0]
490+
results, targets = self.get_results(benchmark.id)
491+
samples = self.get_samples(results, targets)
492+
493+
for sample in samples:
494+
if sample.result and sample.result.finished:
495+
accumulated_results.compiles += int(sample.result.compiles)
496+
accumulated_results.crashes += int(sample.result.crashes)
497+
accumulated_results.crash_cases += int(sample.result.crashes)
498+
accumulated_results.total_coverage += sample.result.coverage
499+
accumulated_results.total_runs += 1
500+
accumulated_results.total_line_coverage_diff += (
501+
sample.result.line_coverage_diff)
502+
else:
503+
for benchmark in benchmarks:
504+
accumulated_results.compiles += int(
505+
benchmark.result.build_success_rate > 0.0)
506+
accumulated_results.crashes += int(benchmark.result.found_bug > 0)
507+
accumulated_results.total_coverage += benchmark.result.max_coverage
508+
accumulated_results.total_runs += 1
509+
accumulated_results.total_line_coverage_diff += (
510+
benchmark.result.max_line_coverage_diff)
496511
return accumulated_results
497512

498513
def get_coverage_language_gains(self):

0 commit comments

Comments
 (0)