Modified: trunk/Websites/perf.webkit.org/ChangeLog (230939 => 230940)
--- trunk/Websites/perf.webkit.org/ChangeLog 2018-04-24 02:30:20 UTC (rev 230939)
+++ trunk/Websites/perf.webkit.org/ChangeLog 2018-04-24 02:34:11 UTC (rev 230940)
@@ -1,3 +1,15 @@
+2018-04-23 Dewei Zhu <[email protected]>
+
+ Revision information returned by querying measurement set api with analysis task id should contain commit order.
+ https://bugs.webkit.org/show_bug.cgi?id=184902
+
+ Reviewed by Ryosuke Niwa.
+
+ This is a bug fix for r230719 which does not cover the case while querying `measurement-set.php?analysisTask=$task_id`
+
+ * public/api/measurement-set.php: AnalysisResultsFetcher.fetch_commits results should contains commit order.
+ * server-tests/api-measurement-set-tests.js: Added unit test for this change.
+
2018-04-19 Dewei Zhu <[email protected]>
Add a bisect button to automatically schedule bisecting A/B tasks.
Modified: trunk/Websites/perf.webkit.org/public/api/measurement-set.php (230939 => 230940)
--- trunk/Websites/perf.webkit.org/public/api/measurement-set.php 2018-04-24 02:30:20 UTC (rev 230939)
+++ trunk/Websites/perf.webkit.org/public/api/measurement-set.php 2018-04-24 02:34:11 UTC (rev 230940)
@@ -262,7 +262,7 @@
function fetch_commits()
{
- $query = $this->db->query('SELECT commit_id, commit_build, commit_repository, commit_revision, commit_time
+ $query = $this->db->query('SELECT commit_id, commit_build, commit_repository, commit_revision, commit_order, commit_time
FROM commits, build_commits, build_requests, analysis_test_groups
WHERE commit_id = build_commit AND commit_build = request_build
AND request_group = testgroup_id AND testgroup_task = $1', array($this->task_id));
@@ -269,7 +269,7 @@
while ($row = $this->db->fetch_next_row($query)) {
$commit_time = Database::to_js_time($row['commit_time']);
array_push(array_ensure_item_has_array($this->build_to_commits, $row['commit_build']),
- array($row['commit_id'], $row['commit_repository'], $row['commit_revision'], $commit_time));
+ array($row['commit_id'], $row['commit_repository'], $row['commit_revision'], $row['commit_order'], $commit_time));
}
}
Modified: trunk/Websites/perf.webkit.org/server-tests/api-measurement-set-tests.js (230939 => 230940)
--- trunk/Websites/perf.webkit.org/server-tests/api-measurement-set-tests.js 2018-04-24 02:30:20 UTC (rev 230939)
+++ trunk/Websites/perf.webkit.org/server-tests/api-measurement-set-tests.js 2018-04-24 02:34:11 UTC (rev 230940)
@@ -500,4 +500,49 @@
});
});
+ async function reportAfterAddingBuilderAndAggregatorsWithResponse(report)
+ {
+ await addBuilderForReport(report);
+ const db = TestServer.database();
+ await Promise.all([
+ db.insert('aggregators', {name: 'Arithmetic'}),
+ db.insert('aggregators', {name: 'Geometric'}),
+ ]);
+ return await TestServer.remoteAPI().postJSON('/api/report/', [report]);
+ }
+
+ const reportWithBuildRequest = {
+ "buildNumber": "123",
+ "buildTime": "2013-02-28T10:12:03.388304",
+ "builderName": "someBuilder",
+ "builderPassword": "somePassword",
+ "platform": "Mountain Lion",
+ "buildRequest": "700",
+ "tests": {
+ "test": {
+ "metrics": {"FrameRate": { "current": [[[0, 4], [100, 5], [205, 3]]] }}
+ },
+ },
+ "revisions": {
+ "macOS": {
+ "revision": "10.8.2 12C60"
+ },
+ "WebKit": {
+ "revision": "141977",
+ "timestamp": "2013-02-06T08:55:20.9Z"
+ }
+ }
+ };
+
+ it("should allow to report a build request", async () => {
+ await MockData.addMockData(TestServer.database());
+ let response = await reportAfterAddingBuilderAndAggregatorsWithResponse(reportWithBuildRequest);
+ assert.equal(response['status'], 'OK');
+ response = await TestServer.remoteAPI().getJSONWithStatus('/api/measurement-set/?analysisTask=500');
+ assert.equal(response['status'], 'OK');
+ assert.deepEqual(response['measurements'], [[1, 4, 3, 12, 50, [
+ ['1', '9', '10.8.2 12C60', null, 0], ['2', '11', '141977', null, 1360140920900]],
+ 1, 1362046323388, '123', 1, 1, 'current']]);
+ });
+
});