BuildRequest should have a method to fetch all in-progress and pending requests for...
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 30 Mar 2016 19:46:23 +0000 (19:46 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 30 Mar 2016 19:46:23 +0000 (19:46 +0000)
commit46c2abfbabb6c3cebcccff2f507b61e13f516cdb
treeaf6e8bcd16b06559ca07b6e4df2dd4df9034163c
parent655794710837702f84445917b5171fba53ec87ff
BuildRequest should have a method to fetch all in-progress and pending requests for a triggerable
https://bugs.webkit.org/show_bug.cgi?id=156008

Reviewed by Darin Adler.

Add a method to BuildRequest that fetches all pending and in-progress requests for a triggerable.

Now, new syncing scripts must be able to figure out the build slave the first build requests in
a given test group had used in order to schedule subsequent build requests in the test group.

For this purpose, /api/build-requests has been modified to return all build requests whose test
group had not finished yet. A test group is finished if all build requests in the test group had
finished (completed, failed, or canceled).

* public/include/build-requests-fetcher.php:
(BuildRequestFetcher::fetch_incomplete_requests_for_triggerable): Return all build requests in test
groups that have not been finished.
* public/v3/models/build-request.js:
(BuildRequest):
(BuildRequest.prototype.testGroupId): Added.
(BuildRequest.prototype.isPending): Renamed from hasPending to fix a bad grammar.
(BuildRequest.fetchForTriggerable): Added.
(BuildRequest.constructBuildRequestsFromData): Extracted from _createModelsFromFetchedTestGroups in
TestGroup.
* public/v3/models/manifest.js:
(Manifest.fetch): Use the full path from root so that it works in server tests.
* public/v3/models/test-group.js:
(TestGroup.hasPending):
(TestGroup._createModelsFromFetchedTestGroups):
* server-tests/api-build-requests-tests.js: Added tests to ensure all build requests for a test group
is present in the response returned by /api/build-requests iff any build request in the group had not
finished yet.
(.addMockData):
(.addAnotherMockTestGroup): Added.
* unit-tests/test-groups-tests.js:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198853 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Websites/perf.webkit.org/ChangeLog
Websites/perf.webkit.org/public/include/build-requests-fetcher.php
Websites/perf.webkit.org/public/v3/models/build-request.js
Websites/perf.webkit.org/public/v3/models/manifest.js
Websites/perf.webkit.org/public/v3/models/test-group.js
Websites/perf.webkit.org/server-tests/api-build-requests-tests.js
Websites/perf.webkit.org/unit-tests/test-groups-tests.js