Diff
Modified: trunk/Websites/perf.webkit.org/ChangeLog (198881 => 198882)
--- trunk/Websites/perf.webkit.org/ChangeLog 2016-03-31 03:56:25 UTC (rev 198881)
+++ trunk/Websites/perf.webkit.org/ChangeLog 2016-03-31 04:18:39 UTC (rev 198882)
@@ -1,5 +1,24 @@
2016-03-30 Ryosuke Niwa <[email protected]>
+ BuildRequest should have associated platform and test
+ https://bugs.webkit.org/show_bug.cgi?id=156054
+
+ Reviewed by Joseph Pecoraro.
+
+ Added methods to retrieve the platform and the test associated with a build request with tests.
+
+ * public/v3/models/build-request.js:
+ (BuildRequest):
+ (BuildRequest.prototype.platform): Added.
+ (BuildRequest.prototype.test): Added.
+ * server-tests/api-build-requests-tests.js:
+ * server-tests/api-manifest.js: Fixed a typo. This tests /api/manifest, not /api/build-requests.
+ * unit-tests/buildbot-syncer-tests.js:
+ (.createSampleBuildRequest): Now takes Platform and Test objects to avoid hitting assertions in
+ BuildRequest's constructor.
+
+2016-03-30 Ryosuke Niwa <[email protected]>
+
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
Modified: trunk/Websites/perf.webkit.org/public/v3/models/build-request.js (198881 => 198882)
--- trunk/Websites/perf.webkit.org/public/v3/models/build-request.js 2016-03-31 03:56:25 UTC (rev 198881)
+++ trunk/Websites/perf.webkit.org/public/v3/models/build-request.js 2016-03-31 04:18:39 UTC (rev 198882)
@@ -10,6 +10,10 @@
this._testGroup = object.testGroup;
if (this._testGroup)
this._testGroup.addBuildRequest(this);
+ console.assert(object.platform instanceof Platform);
+ this._platform = object.platform;
+ console.assert(object.test instanceof Test);
+ this._test = object.test;
this._order = object.order;
console.assert(object.rootSet instanceof RootSet);
this._rootSet = object.rootSet;
@@ -31,6 +35,8 @@
testGroupId() { return this._testGroupId; }
testGroup() { return this._testGroup; }
+ platform() { return this._platform; }
+ test() { return this._test; }
order() { return this._order; }
rootSet() { return this._rootSet; }
Modified: trunk/Websites/perf.webkit.org/server-tests/api-build-requests-tests.js (198881 => 198882)
--- trunk/Websites/perf.webkit.org/server-tests/api-build-requests-tests.js 2016-03-31 03:56:25 UTC (rev 198881)
+++ trunk/Websites/perf.webkit.org/server-tests/api-build-requests-tests.js 2016-03-31 04:18:39 UTC (rev 198882)
@@ -215,7 +215,16 @@
}).then(function (buildRequests) {
assert.equal(buildRequests.length, 4);
+ let test = Test.findById(200);
+ assert(test);
+
+ let platform = Platform.findById(65);
+ assert(platform);
+
assert.equal(buildRequests[0].id(), 700);
+ assert.equal(buildRequests[0].testGroupId(), 600);
+ assert.equal(buildRequests[0].test(), test);
+ assert.equal(buildRequests[0].platform(), platform);
assert.equal(buildRequests[0].order(), 0);
assert.ok(buildRequests[0].rootSet() instanceof RootSet);
assert.ok(!buildRequests[0].hasFinished());
@@ -224,6 +233,9 @@
assert.equal(buildRequests[0].statusLabel(), 'Waiting to be scheduled');
assert.equal(buildRequests[1].id(), 701);
+ assert.equal(buildRequests[1].testGroupId(), 600);
+ assert.equal(buildRequests[1].test(), test);
+ assert.equal(buildRequests[1].platform(), platform);
assert.equal(buildRequests[1].order(), 1);
assert.ok(buildRequests[1].rootSet() instanceof RootSet);
assert.ok(!buildRequests[1].hasFinished());
@@ -232,6 +244,9 @@
assert.equal(buildRequests[1].statusLabel(), 'Waiting to be scheduled');
assert.equal(buildRequests[2].id(), 702);
+ assert.equal(buildRequests[2].testGroupId(), 600);
+ assert.equal(buildRequests[2].test(), test);
+ assert.equal(buildRequests[2].platform(), platform);
assert.equal(buildRequests[2].order(), 2);
assert.ok(buildRequests[2].rootSet() instanceof RootSet);
assert.ok(!buildRequests[2].hasFinished());
@@ -240,6 +255,9 @@
assert.equal(buildRequests[2].statusLabel(), 'Waiting to be scheduled');
assert.equal(buildRequests[3].id(), 703);
+ assert.equal(buildRequests[3].testGroupId(), 600);
+ assert.equal(buildRequests[3].test(), test);
+ assert.equal(buildRequests[3].platform(), platform);
assert.equal(buildRequests[3].order(), 3);
assert.ok(buildRequests[3].rootSet() instanceof RootSet);
assert.ok(!buildRequests[3].hasFinished());
Modified: trunk/Websites/perf.webkit.org/server-tests/api-manifest.js (198881 => 198882)
--- trunk/Websites/perf.webkit.org/server-tests/api-manifest.js 2016-03-31 03:56:25 UTC (rev 198881)
+++ trunk/Websites/perf.webkit.org/server-tests/api-manifest.js 2016-03-31 04:18:39 UTC (rev 198882)
@@ -6,7 +6,7 @@
let TestServer = require('./resources/test-server.js');
-describe('/api/build-requests', function () {
+describe('/api/manifest', function () {
this.timeout(10000);
TestServer.inject();
Modified: trunk/Websites/perf.webkit.org/unit-tests/buildbot-syncer-tests.js (198881 => 198882)
--- trunk/Websites/perf.webkit.org/unit-tests/buildbot-syncer-tests.js 2016-03-31 03:56:25 UTC (rev 198881)
+++ trunk/Websites/perf.webkit.org/unit-tests/buildbot-syncer-tests.js 2016-03-31 04:18:39 UTC (rev 198882)
@@ -71,15 +71,18 @@
}
};
-function createSampleBuildRequest()
+function createSampleBuildRequest(platform, test)
{
+ assert(platform instanceof Platform);
+ assert(test instanceof Test);
+
let rootSet = RootSet.ensureSingleton('4197', {roots: [
{'id': '111127', 'time': 1456955807334, 'repository': MockModels.webkit, 'revision': '197463'},
{'id': '111237', 'time': 1456931874000, 'repository': MockModels.sharedRepository, 'revision': '80229'},
{'id': '88930', 'time': 0, 'repository': MockModels.ios, 'revision': '13A452'},
]});
- let request = BuildRequest.ensureSingleton('16733', {'rootSet': rootSet, 'status': 'pending'});
+ let request = BuildRequest.ensureSingleton('16733', {'rootSet': rootSet, 'status': 'pending', 'platform': platform, 'test': test});
return request;
}
@@ -424,37 +427,38 @@
describe('_propertiesForBuildRequest', function () {
it('should include all properties specified in a given configuration', function () {
let syncers = BuildbotSyncer._loadConfig('http://build.webkit.org/', sampleiOSConfig());
- let properties = syncers[0]._propertiesForBuildRequest(createSampleBuildRequest());
+ let properties = syncers[0]._propertiesForBuildRequest(createSampleBuildRequest(MockModels.iphone, MockModels.speedometer));
assert.deepEqual(Object.keys(properties), ['desired_image', 'roots_dict', 'test_name', 'forcescheduler', 'build_request_id']);
});
it('should preserve non-parametric property values', function () {
let syncers = BuildbotSyncer._loadConfig('http://build.webkit.org/', sampleiOSConfig());
- let properties = syncers[0]._propertiesForBuildRequest(createSampleBuildRequest());
+ let properties = syncers[0]._propertiesForBuildRequest(createSampleBuildRequest(MockModels.iphone, MockModels.speedometer));
assert.equal(properties['test_name'], 'speedometer');
assert.equal(properties['forcescheduler'], 'ABTest-iPhone-RunBenchmark-Tests-ForceScheduler');
- properties = syncers[1]._propertiesForBuildRequest(createSampleBuildRequest());
+ properties = syncers[1]._propertiesForBuildRequest(createSampleBuildRequest(MockModels.iphone, MockModels.speedometer));
assert.equal(properties['test_name'], 'jetstream');
assert.equal(properties['forcescheduler'], 'ABTest-iPhone-RunBenchmark-Tests-ForceScheduler');
});
it('should resolve "root"', function () {
let syncers = BuildbotSyncer._loadConfig('http://build.webkit.org/', sampleiOSConfig());
- let properties = syncers[0]._propertiesForBuildRequest(createSampleBuildRequest());
+ let properties = syncers[0]._propertiesForBuildRequest(createSampleBuildRequest(MockModels.iphone, MockModels.speedometer));
assert.equal(properties['desired_image'], '13A452');
});
it('should resolve "rootsExcluding"', function () {
let syncers = BuildbotSyncer._loadConfig('http://build.webkit.org/', sampleiOSConfig());
- let properties = syncers[0]._propertiesForBuildRequest(createSampleBuildRequest());
+ let properties = syncers[0]._propertiesForBuildRequest(createSampleBuildRequest(MockModels.iphone, MockModels.speedometer));
assert.equal(properties['roots_dict'], JSON.stringify(sampleRootSetData));
});
it('should set the property for the build request id', function () {
let syncers = BuildbotSyncer._loadConfig('http://build.webkit.org/', sampleiOSConfig());
- let properties = syncers[0]._propertiesForBuildRequest(createSampleBuildRequest());
- assert.equal(properties['build_request_id'], createSampleBuildRequest().id());
+ let request = createSampleBuildRequest(MockModels.iphone, MockModels.speedometer);
+ let properties = syncers[0]._propertiesForBuildRequest(request);
+ assert.equal(properties['build_request_id'], request.id());
});
});