This is an automated email from the git hooks/post-receive script.
Git pushed a commit to branch master
in repository fateserver.
The following commit(s) were added to refs/heads/master by this push:
new db731ed index: do not round the failometer bar widths
db731ed is described below
commit db731eddc4f1d21de2aae141a84dc285e6e5bc13
Author: Kacper Michajłow <[email protected]>
AuthorDate: Sat Aug 15 17:49:57 2026 +0200
Commit: Kacper Michajłow <[email protected]>
CommitDate: Sat Aug 15 18:15:35 2026 +0200
index: do not round the failometer bar widths
Rounding the three percentages could sum to 100.1%, and the progress
element hides what does not fit. Instead just round the values in
tooltips.
Signed-off-by: Kacper Michajłow <[email protected]>
---
index.cgi | 30 +++++++++++++-----------------
1 file changed, 13 insertions(+), 17 deletions(-)
diff --git a/index.cgi b/index.cgi
index 36dc5e1..8b57fc5 100755
--- a/index.cgi
+++ b/index.cgi
@@ -110,17 +110,13 @@ my $clear = '?' . join '&', other_params();
'Clear all search criteria.</a>' :
'No data in $fatedir.';
-# Percentage of $n out of $total, rounded to one decimal for display.
-sub pct {
- my ($n, $total) = @_;
- return int(1000 * $n / $total + 0.5) / 10;
-}
-
-my $nreps = @reps;
-my $warn = $nreps - $allpass - $allfail;
-$allpass = pct($allpass, $nreps);
-$allfail = pct($allfail, $nreps);
-$warn = pct($warn, $nreps);
+my $warn = @reps - $allpass - $allfail;
+$allpass = 100 * $allpass / @reps;
+$allfail = 100 * $allfail / @reps;
+$warn = 100 * $warn / @reps;
+my $passpc = sprintf '%.1f', $allpass;
+my $failpc = sprintf '%.1f', $allfail;
+my $warnpc = sprintf '%.1f', $warn;
my @sort = ('result', 'subarch', 'os', 'cc', 'comment', 'slot');
defined $sort and unshift @sort, split /\/\//, $sort;
@@ -279,22 +275,22 @@ start 'td', colspan => 8, id => 'failometer';
start 'div', class => 'progress';
if ($allpass) {
print <<EOF;
-<div class="progress-bar pass" role="progressbar" title="${allpass}% tests
passed" aria-valuenow="${allpass}" aria-valuemin="0" aria-valuemax="100"
style="width: ${allpass}%">
- <span class="sr-only">${allpass}%</span>
+<div class="progress-bar pass" role="progressbar" title="${passpc}% tests
passed" aria-valuenow="${passpc}" aria-valuemin="0" aria-valuemax="100"
style="width: ${allpass}%">
+ <span class="sr-only">${passpc}%</span>
</div>
EOF
}
if ($warn) {
print <<EOF;
-<div class="progress-bar warn" role="progressbar" title="${warn}% tests
failed" aria-valuenow="${warn}" aria-valuemin="0" aria-valuemax="100"
style="width: ${warn}%">
- <span class="sr-only">${warn}%</span>
+<div class="progress-bar warn" role="progressbar" title="${warnpc}% tests
failed" aria-valuenow="${warnpc}" aria-valuemin="0" aria-valuemax="100"
style="width: ${warn}%">
+ <span class="sr-only">${warnpc}%</span>
</div>
EOF
}
if ($allfail) {
print <<EOF;
-<div class="progress-bar fail" role="progressbar" title="${allfail}% build
failed" aria-valuenow="${allfail}" aria-valuemin="0" aria-valuemax="100"
style="width: ${allfail}%">
- <span class="sr-only">${allfail}%</span>
+<div class="progress-bar fail" role="progressbar" title="${failpc}% build
failed" aria-valuenow="${failpc}" aria-valuemin="0" aria-valuemax="100"
style="width: ${allfail}%">
+ <span class="sr-only">${failpc}%</span>
</div>
EOF
}
_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]