From 4a1c9e8942841ce2f635afca4ea76ac80aaf504f Mon Sep 17 00:00:00 2001 From: Dan Fandrich Date: Mon, 15 Sep 2014 21:44:23 +0200 Subject: Display those failing builds that appear to be flaky The flakiness algorithm is tuned for packages that are >20% flaky over the past ~6 months, which may turn out to be too high a threshold. --- autobuild/results.php | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) (limited to 'autobuild/results.php') diff --git a/autobuild/results.php b/autobuild/results.php index 9172a57..053d4b2 100644 --- a/autobuild/results.php +++ b/autobuild/results.php @@ -10,6 +10,7 @@ function parse_package($rpm) { } } +$db = new SQLite3('autobuild.db'); $runs = Array(); $handle = opendir('cauldron/x86_64/core/'); while (false !== ($entry = readdir($handle))) { @@ -163,6 +164,54 @@ function toggle(titleid, contentid){
= 5) + return false; + + # Next older 5 builds + $num_bad_older = 0; + for ($i = 5; $i < 10; $i++) { + if ($history[$i] === 'build_failure') + $num_bad_older++; + } + if ($num_bad_older < 1 || $num_bad_older >= 5) + return false; + + $num_bad = $num_bad + $num_bad_older; + if ($num_bad < 2 || $num_bad > 7) + return false; + + return true; +} + +function get_build_history($package) { + global $db; + $package_id = $db->querySingle("SELECT Id FROM Packages WHERE Name = '$package'"); + if ($package_id) { + $result = $db->query("SELECT ResultValues.Name FROM Runs, Results, ResultValues WHERE Runs.Id = Results.Run AND Results.Result = ResultValues.Id AND Results.Package = '$package_id' ORDER BY Start DESC LIMIT 10"); + if ($result) { + $build_stats = Array(); + while ($entry = $result->fetchArray(SQLITE3_ASSOC)) { + array_push($build_stats, $entry['Name']); + } + return $build_stats; + } + } + return false; +} + echo "