Finalize phase one of #50
This commit is contained in:
Родитель
e5c26c7cb6
Коммит
87a1f909cd
|
@ -25,7 +25,7 @@ def camelcase(string):
|
|||
class_ = string.__class__
|
||||
return class_.join('', map(class_.capitalize, splitted_string))
|
||||
|
||||
class DBTable:
|
||||
class DBTable(object):
|
||||
globalcache = {}
|
||||
|
||||
def __init__(self, id):
|
||||
|
@ -698,6 +698,14 @@ class Breakdown(RegressionTools):
|
|||
def table():
|
||||
return "awfy_breakdown"
|
||||
|
||||
def get(self, field):
|
||||
if field == "build_id":
|
||||
return self.get("score").get("build_id")
|
||||
if field == "build":
|
||||
return self.get("score").get("build")
|
||||
|
||||
return super(Breakdown, self).get(field)
|
||||
|
||||
def sane(self):
|
||||
if self.get("suite_test_id") == 0:
|
||||
return False
|
||||
|
|
|
@ -103,8 +103,8 @@ if (GET_string('name') == '__total__') {
|
|||
} else {
|
||||
$test_id = find_or_add_test($suite_version_id, GET_string('name'));
|
||||
mysql_query("INSERT INTO awfy_breakdown
|
||||
(score_id, build_id, suite_test_id, score)
|
||||
(score_id, suite_test_id, score)
|
||||
VALUES
|
||||
($score,$build, $test_id, $time)")
|
||||
($score, $test_id, $time)")
|
||||
or die("ERROR: " . mysql_error());
|
||||
}
|
||||
|
|
|
@ -82,8 +82,9 @@ while($row = mysql_fetch_array($tests)) {
|
|||
$scores = Array();
|
||||
for ($j = 0; $j < count($buildIds); $j++) {
|
||||
$query = "SELECT score FROM `awfy_breakdown`
|
||||
LEFT JOIN awfy_score ON awfy_score.id = score_id
|
||||
WHERE suite_test_id = ".$suiteTestId." AND
|
||||
build_id = ".$buildIds[$j]."
|
||||
awfy_score.build_id = ".$buildIds[$j]."
|
||||
LIMIT 1";
|
||||
$results = mysql_query($query);
|
||||
if (!$results || mysql_num_rows($results) != 1)
|
||||
|
|
|
@ -61,7 +61,8 @@ function prev_suite_test($stamp, $machine, $mode, $suite_test, $limit = 1) {
|
|||
$limit = (int) $limit;
|
||||
$query = "SELECT awfy_breakdown.id, score, cset
|
||||
FROM awfy_breakdown
|
||||
INNER JOIN awfy_build ON awfy_build.id = awfy_breakdown.build_id
|
||||
INNER JOIN awfy_score ON awfy_score.id = score_id
|
||||
INNER JOIN awfy_build ON awfy_build.id = awfy_score.build_id
|
||||
INNER JOIN awfy_run ON awfy_run.id = awfy_build.run_id
|
||||
WHERE stamp < $1 AND
|
||||
stamp >= $2 AND
|
||||
|
@ -133,7 +134,8 @@ function next_($stamp, $machine, $mode, $suite, $limit = 1) {
|
|||
function next_suite_test($stamp, $machine, $mode, $suite_test, $limit = 1) {
|
||||
$query = mysql_query("SELECT awfy_breakdown.id, score, cset
|
||||
FROM awfy_breakdown
|
||||
INNER JOIN awfy_build ON awfy_build.id = awfy_breakdown.build_id
|
||||
INNER JOIN awfy_score ON awfy_score.id = score_id
|
||||
INNER JOIN awfy_build ON awfy_build.id = awfy_score.build_id
|
||||
INNER JOIN awfy_run ON awfy_run.id = awfy_build.run_id
|
||||
WHERE stamp > ".(int)$stamp." AND
|
||||
machine = ".(int)$machine." AND
|
||||
|
|
|
@ -25,7 +25,7 @@ $data = array();
|
|||
for ($i=0; $i < count($ids); $i++) {
|
||||
|
||||
$query = mysql_query("SELECT awfy_regression.id, machine, mode_id, awfy_run.stamp,
|
||||
build_id, cset, bug, awfy_regression.status, detector
|
||||
build_id, prev_build_id, cset, bug, awfy_regression.status, detector
|
||||
FROM awfy_regression
|
||||
INNER JOIN awfy_build ON build_id = awfy_build.id
|
||||
INNER JOIN awfy_run ON run_id = awfy_run.id
|
||||
|
@ -55,14 +55,19 @@ for ($i=0; $i < count($ids); $i++) {
|
|||
"noise" => $scores["noise"]
|
||||
);
|
||||
|
||||
if (!$minimal) {
|
||||
$prev = prev_($output["stamp"], $output["machine"],
|
||||
$output["mode_id"], $suite_version_id);
|
||||
if (count($prev) == 1) {
|
||||
$score["prev_score"] = $prev[0]["score"];
|
||||
$score["prev_cset"] = $prev[0]["cset"];
|
||||
}
|
||||
}
|
||||
//if (!$minimal) { // minimal outdated. Used to be slow. Not anymore.
|
||||
if ($output["prev_build_id"]) {
|
||||
$qPrevScore = mysql_query("SELECT score
|
||||
FROM awfy_score
|
||||
WHERE build_id = ".$output["prev_build_id"]." AND
|
||||
suite_version_id = ".$suite_version_id."
|
||||
LIMIT 1") or die(mysql_error());
|
||||
if (mysql_num_rows($qPrevScore) == 1) {
|
||||
$prevScore = mysql_fetch_assoc($qPrevScore);
|
||||
$score["prev_score"] = $prevScore["score"];
|
||||
$score["prev_cset"] = get("build", $output["prev_build_id"], "cset");
|
||||
}
|
||||
}
|
||||
|
||||
$regression["scores"][] = $score;
|
||||
}
|
||||
|
@ -79,14 +84,20 @@ for ($i=0; $i < count($ids); $i++) {
|
|||
"noise" => $scores["noise"]
|
||||
);
|
||||
|
||||
if (!$minimal) {
|
||||
$prev = prev_suite_test($output["stamp"], $output["machine"],
|
||||
$output["mode_id"], $suite_test_id);
|
||||
if (count($prev) == 1) {
|
||||
$score["prev_score"] = $prev[0]["score"];
|
||||
$score["prev_cset"] = $prev[0]["cset"];
|
||||
}
|
||||
}
|
||||
//if (!$minimal) { // minimal outdated. Used to be slow. Not anymore.
|
||||
if ($output["prev_build_id"]) {
|
||||
$qPrevScore = mysql_query("SELECT awfy_breakdown.score
|
||||
FROM awfy_breakdown
|
||||
LEFT JOIN awfy_score ON score_id = awfy_score.id
|
||||
WHERE awfy_score.build_id = ".$output["prev_build_id"]." AND
|
||||
suite_test_id = ".$suite_test_id."
|
||||
LIMIT 1") or die(mysql_error());
|
||||
if (mysql_num_rows($qPrevScore) == 1) {
|
||||
$prevScore = mysql_fetch_assoc($qPrevScore);
|
||||
$score["prev_score"] = $prevScore["score"];
|
||||
$score["prev_cset"] = get("build", $output["prev_build_id"], "cset");
|
||||
}
|
||||
}
|
||||
|
||||
$regression["scores"][] = $score;
|
||||
}
|
||||
|
|
|
@ -17,7 +17,8 @@ if (!isset($request->subtest))
|
|||
if ($request->subtest == 1 || $request->subtest == 'true') {
|
||||
$query = mysql_query("SELECT mode_id, machine, stamp, score, suite_test_id
|
||||
FROM `awfy_breakdown`
|
||||
LEFT JOIN awfy_build ON awfy_build.id = build_id
|
||||
LEFT JOIN awfy_score ON awfy_score.id = score_id
|
||||
LEFT JOIN awfy_build ON awfy_build.id = awfy_score.build_id
|
||||
LEFT JOIN awfy_run ON awfy_run.id = run_id
|
||||
WHERE awfy_breakdown.id = ".$request->id) or die(mysql_error());
|
||||
$data = mysql_fetch_assoc($query);
|
||||
|
|
Загрузка…
Ссылка в новой задаче