Skip to content

Commit

Permalink
Revision information returned by querying measurement set api with an…
Browse files Browse the repository at this point in the history
…alysis 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.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@230940 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
[email protected] committed Apr 24, 2018
1 parent 7f8d276 commit 2d13154
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 2 deletions.
12 changes: 12 additions & 0 deletions Websites/perf.webkit.org/ChangeLog
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
4 changes: 2 additions & 2 deletions Websites/perf.webkit.org/public/api/measurement-set.php
Original file line number Diff line number Diff line change
Expand Up @@ -262,14 +262,14 @@ function fetch()

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));
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));
}
}

Expand Down
45 changes: 45 additions & 0 deletions Websites/perf.webkit.org/server-tests/api-measurement-set-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -500,4 +500,49 @@ describe("/api/measurement-set", function () {
});
});

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']]);
});

});

0 comments on commit 2d13154

Please sign in to comment.