One page only shows the failure patterns of the Windows TestBot machines, and another just the Wine TestBot machines. This also cleanly separates the Windows and Wine failure modes.
Signed-off-by: Francois Gouget fgouget@codeweavers.com --- winetest/build-index | 4 ++-- winetest/build-patterns | 48 ++++++++++++++++++++++++++++++++--------- 2 files changed, 40 insertions(+), 12 deletions(-)
diff --git a/winetest/build-index b/winetest/build-index index 6a3356a25..e69ea1f28 100755 --- a/winetest/build-index +++ b/winetest/build-index @@ -220,7 +220,7 @@ foreach my $build (readdir(DIR)) { if ($build !~ /^[0-9a-f]{40}$/) { - if ($build !~ /^(?:..?|(?:errors|index|patterns).html|tests)$/) + if ($build !~ /^(?:..?|(?:errors|index|patterns.*).html|tests)$/) { error("'data/$build' is not a valid build directory\n"); } @@ -430,7 +430,7 @@ print OUT <<"EOF"; <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> </head> <body> -<div class="navbar"><a href="patterns.html">failure patterns</a></div> +<div class="navbar">Failure patterns: <a href="patterns.html">all</a> | <a href="patterns-tb-win.html">testbot windows</a> | <a href="patterns-tb-wine.html">testbot wine</a></div> <div class="main"> <h2>Wine test runs</h2> EOF diff --git a/winetest/build-patterns b/winetest/build-patterns index 9dc25816f..e87fabc2f 100755 --- a/winetest/build-patterns +++ b/winetest/build-patterns @@ -168,6 +168,8 @@ Actions:
Generated files: $workdir/data/patterns.html + $workdir/data/patterns-tb-win.html + $workdir/data/patterns-tb-wine.html
Exit: 0 - success @@ -206,7 +208,7 @@ foreach my $build (readdir(DIR)) { if ($build !~ /^[0-9a-f]{40}$/) { - if ($build !~ /^(?:..?|(?:errors|index|patterns).html|tests)$/) + if ($build !~ /^(?:..?|(?:errors|index|patterns.*).html|tests)$/) { error("'data/$build' is not a valid build directory\n"); } @@ -521,9 +523,9 @@ sub get_status_html($$) return ("?", "", "unknown status $status", "report", ""); }
-sub write_patterns_list($$) +sub write_patterns_list($$$$) { - my ($html, $testnames) = @_; + my ($html, $pagereports, $mainpage, $testnames) = @_;
for my $i (0..@$testnames-1) { @@ -532,6 +534,7 @@ sub write_patterns_list($$)
print $html "<div class='testfile' id='$testname'>\n"; print $html "<div class='updownbar'><a href='tests/$testname.html'>$testname</a>"; + print $html " <small>(<a href='$mainpage#$testname'>see all results</a></small>)" if ($mainpage); print $html "<div class='ralign'>";
my $href = $i ? $testnames->[$i-1] : ""; @@ -546,6 +549,7 @@ sub write_patterns_list($$) print $html "<div class='test'>\n"; foreach my $reportdir (@sortedreports) { + next if (!$pagereports->{$reportdir}); my $testreport = $test->{testreports}->{$reportdir}; next if (!$testreport->{failed}); print $html "<div class='pattern'>"; @@ -644,11 +648,11 @@ sub write_patterns_list($$) } }
-sub write_patterns_page($) +sub write_patterns_page($$$) { - my ($title) = (@_); + my ($pagereports, $subpage, $title) = (@_);
- my $filename = "data/patterns.html"; + my $filename = "data/patterns$subpage.html"; open(my $html, ">", "$filename.new") or die "could not open '$filename.new' for writing: $!";
print $html <<"EOF"; @@ -661,7 +665,7 @@ sub write_patterns_page($) <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> </head> <body> -<div class="navbar"><a href="..">index</a></div> +<div class="navbar"><a href="..">index</a> | Failure patterns: <a href="patterns.html">all</a> | <a href="patterns-tb-win.html">testbot windows</a> | <a href="patterns-tb-wine.html">testbot wine</a></div> <div class="main"> EOF
@@ -672,8 +676,9 @@ EOF { my $test = $tests{$testname}; my $addtest; - foreach my $testreport (values %{$test->{testreports}}) + foreach my $reportdir (keys %$pagereports) { + my $testreport = $test->{testreports}->{$reportdir}; next if (!$testreport->{failed}); $addtest = 1;
@@ -687,8 +692,9 @@ EOF push @$testnames, $testname if ($addtest); }
+ my $mainpage = $subpage ? "patterns.html" : ""; print $html "<h2>$title</h2>\n"; - write_patterns_list($html, $testnames); + write_patterns_list($html, $pagereports, $mainpage, $testnames); print $html "</div></body></html>\n"; close($html);
@@ -699,6 +705,28 @@ EOF } }
-write_patterns_page("Test failure patterns"); +write_patterns_page(%reports, "", "All test patterns"); + +my %tbreports; +foreach my $report (values %reports) +{ + next if ($report->{tag} !~ /^newtb-/); # ignore non-TestBot reports + if ($report->{is_rerun}) + { + # Skip reruns because they are infrequent and thus usually do not + # meaningfully contribute to the patterns. + # They can still be checked on the 'all reports' page. + next; + } + # Windows and Wine have different failure modes so put them on separate + # pages. + my $page = ($report->{platform} =~ /^(?:linux|mac|bsd|solaris|wine)$/) ? "wine" : "win"; + $tbreports{$page}->{$report->{dir}} = 1; +} + +write_patterns_page($tbreports{win}, "-tb-win", + "Windows test patterns (TestBot only)"); +write_patterns_page($tbreports{wine}, "-tb-wine", + "Wine test patterns (TestBot only)");
exit 0;