Title: [227996] trunk/Websites/perf.webkit.org
Revision
227996
Author
aakash_j...@apple.com
Date
2018-02-01 23:06:19 -0800 (Thu, 01 Feb 2018)

Log Message

Create BuildbotBuildEntry in Buildbot syncer in Buildbot 0.9 format
https://bugs.webkit.org/show_bug.cgi?id=182036

Reviewed by Ryosuke Niwa.

* tools/js/buildbot-syncer.js:
(BuildbotBuildEntry): Class for Buildbot entry in Buildbot 0.9 data format.
(BuildbotBuildEntryDeprecated): Renamed from BuildbotBuildEntry, sub-classed from BuildBotEntry. Handles Buildbot 0.8 data format.
(BuildbotBuildEntryDeprecated.prototype.url): URL in buildbot 0.8 format.
(BuildbotSyncer.prototype.builderID): Added.
(BuildbotSyncer.prototype.pathForPendingBuildsJSONDeprecated): Renamed from BuildbotSyncer.prototype.pathForPendingBuildsJSON.
(BuildbotSyncer.prototype.pathForPendingBuilds): Path for pending builds in Buildbot 0.9 format.
(BuildbotSyncer.prototype.urlForBuildNumberDeprecated): Deprecated. Renamed from urlForBuildNumber.
(BuildbotSyncer.prototype.urlForBuildNumber): Updated in Buildbot 0.9 format.
(BuildbotSyncer.prototype.urlForPendingBuild): Buildbot 0.9 has individual webpage for pending buildrequests as well. URL to that page.
* unit-tests/buildbot-syncer-tests.js: Renamed BuildbotBuildEntry to BuildbotBuildEntryDeprecated.
(sampleBuildData): Sample build data. Common method for in-progress and finished build data.
(samplePendingBuildData): Sample data for a pending build. Separate method so that we can easily create sample data with multiple builds.
(sampleInProgressBuildData): Ditto for in-progress build.
(sampleFinishedBuildData): Ditto for finished build.
(samplePendingBuild): Sample data for single pending build.
(sampleInProgressBuild): Ditto for in-progress build.
(sampleFinishedBuild): Ditto for finished build.
(samplePendingBuildDeprecated): Renamed from samplePendingBuild.
(sampleInProgressBuildDeprecated): Renamed from sampleInProgressBuild.
(sampleFinishedBuildDeprecated): Renamed from sampleFinishedBuild.
(BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for pending build.
(BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for in-progress build.
(BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for finished build.
(BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for mix of in-progress and finished build.

Modified Paths

Diff

Modified: trunk/Websites/perf.webkit.org/ChangeLog (227995 => 227996)


--- trunk/Websites/perf.webkit.org/ChangeLog	2018-02-02 04:46:23 UTC (rev 227995)
+++ trunk/Websites/perf.webkit.org/ChangeLog	2018-02-02 07:06:19 UTC (rev 227996)
@@ -1,3 +1,36 @@
+2018-02-01  Aakash Jain  <aakash_j...@apple.com>
+
+        Create BuildbotBuildEntry in Buildbot syncer in Buildbot 0.9 format
+        https://bugs.webkit.org/show_bug.cgi?id=182036
+
+        Reviewed by Ryosuke Niwa.
+
+        * tools/js/buildbot-syncer.js:
+        (BuildbotBuildEntry): Class for Buildbot entry in Buildbot 0.9 data format.
+        (BuildbotBuildEntryDeprecated): Renamed from BuildbotBuildEntry, sub-classed from BuildBotEntry. Handles Buildbot 0.8 data format.
+        (BuildbotBuildEntryDeprecated.prototype.url): URL in buildbot 0.8 format.
+        (BuildbotSyncer.prototype.builderID): Added.
+        (BuildbotSyncer.prototype.pathForPendingBuildsJSONDeprecated): Renamed from BuildbotSyncer.prototype.pathForPendingBuildsJSON.
+        (BuildbotSyncer.prototype.pathForPendingBuilds): Path for pending builds in Buildbot 0.9 format.
+        (BuildbotSyncer.prototype.urlForBuildNumberDeprecated): Deprecated. Renamed from urlForBuildNumber.
+        (BuildbotSyncer.prototype.urlForBuildNumber): Updated in Buildbot 0.9 format.
+        (BuildbotSyncer.prototype.urlForPendingBuild): Buildbot 0.9 has individual webpage for pending buildrequests as well. URL to that page.
+        * unit-tests/buildbot-syncer-tests.js: Renamed BuildbotBuildEntry to BuildbotBuildEntryDeprecated.
+        (sampleBuildData): Sample build data. Common method for in-progress and finished build data.
+        (samplePendingBuildData): Sample data for a pending build. Separate method so that we can easily create sample data with multiple builds.
+        (sampleInProgressBuildData): Ditto for in-progress build.
+        (sampleFinishedBuildData): Ditto for finished build.
+        (samplePendingBuild): Sample data for single pending build.
+        (sampleInProgressBuild): Ditto for in-progress build.
+        (sampleFinishedBuild): Ditto for finished build.
+        (samplePendingBuildDeprecated): Renamed from samplePendingBuild.
+        (sampleInProgressBuildDeprecated): Renamed from sampleInProgressBuild.
+        (sampleFinishedBuildDeprecated): Renamed from sampleFinishedBuild.
+        (BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for pending build.
+        (BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for in-progress build.
+        (BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for finished build.
+        (BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for mix of in-progress and finished build.
+
 2018-01-31  Dewei Zhu  <dewei_...@apple.com>
 
         Should chose the best match during 'route' if there are multiple matches.

Modified: trunk/Websites/perf.webkit.org/tools/js/buildbot-syncer.js (227995 => 227996)


--- trunk/Websites/perf.webkit.org/tools/js/buildbot-syncer.js	2018-02-02 04:46:23 UTC (rev 227995)
+++ trunk/Websites/perf.webkit.org/tools/js/buildbot-syncer.js	2018-02-02 07:06:19 UTC (rev 227996)
@@ -7,33 +7,31 @@
 class BuildbotBuildEntry {
     constructor(syncer, rawData)
     {
-        assert.equal(syncer.builderName(), rawData['builderName']);
+        this.initialize(syncer, rawData);
+    }
 
+    initialize(syncer, rawData)
+    {
+        assert.equal(syncer.builderID(), rawData['builderid']);
+
         this._syncer = syncer;
-        this._slaveName = null;
-        this._buildRequestId = null;
-        this._isInProgress = rawData['currentStep'] || (rawData['times'] && !rawData['times'][1]);
+        this._buildRequestId = rawData['buildrequestid'];
+        this._hasFinished = rawData['complete'];
+        this._isPending = 'claimed' in rawData && !rawData['claimed'];
+        this._isInProgress = !this._isPending && !this._hasFinished;
         this._buildNumber = rawData['number'];
-
-        for (let propertyTuple of (rawData['properties'] || [])) {
-            // e.g. ['build_request_id', '16733', 'Force Build Form']
-            const name = propertyTuple[0];
-            const value = propertyTuple[1];
-            if (name == syncer._slavePropertyName)
-                this._slaveName = value;
-            else if (name == syncer._buildRequestPropertyName)
-                this._buildRequestId = value;
-        }
+        this._workerName = rawData['properties'] && rawData['properties']['workername'] ? rawData['properties']['workername'][0] : null
     }
 
     syncer() { return this._syncer; }
     buildNumber() { return this._buildNumber; }
-    slaveName() { return this._slaveName; }
+    slaveName() { return this._workerName; }
+    workerName() { return this._workerName; }
     buildRequestId() { return this._buildRequestId; }
-    isPending() { return typeof(this._buildNumber) != 'number'; }
+    isPending() { return this._isPending; }
     isInProgress() { return this._isInProgress; }
-    hasFinished() { return !this.isPending() && !this.isInProgress(); }
-    url() { return this.isPending() ? this._syncer.url() : this._syncer.urlForBuildNumber(this._buildNumber); }
+    hasFinished() { return this._hasFinished; }
+    url() { return this.isPending() ? this._syncer.urlForPendingBuild(this._buildRequestId) : this._syncer.urlForBuildNumber(this._buildNumber); }
 
     buildRequestStatusIfUpdateIsNeeded(request)
     {
@@ -54,7 +52,40 @@
     }
 }
 
+class BuildbotBuildEntryDeprecated extends BuildbotBuildEntry {
+    constructor(syncer, rawData)
+    {
+        super(syncer, rawData);
+        this.initialize(syncer, rawData);
+    }
 
+    initialize(syncer, rawData)
+    {
+        assert.equal(syncer.builderName(), rawData['builderName']);
+
+        this._syncer = syncer;
+        this._workerName = null;
+        this._buildRequestId = null;
+        this._buildNumber = rawData['number'];
+        this._isInProgress = rawData['currentStep'] || (rawData['times'] && !rawData['times'][1]);
+        this._isPending = typeof(this._buildNumber) != 'number';
+        this._hasFinished =  !this.isPending() && !this.isInProgress();
+
+        for (let propertyTuple of (rawData['properties'] || [])) {
+            // e.g. ['build_request_id', '16733', 'Force Build Form']
+            const name = propertyTuple[0];
+            const value = propertyTuple[1];
+            if (name == syncer._slavePropertyName)
+                this._workerName = value;
+            else if (name == syncer._buildRequestPropertyName)
+                this._buildRequestId = value;
+        }
+    }
+
+    url() { return this.isPending() ? this._syncer.url() : this._syncer.urlForBuildNumberDeprecated(this._buildNumber); }
+}
+
+
 class BuildbotSyncer {
 
     constructor(remote, object, commonConfigurations)
@@ -74,6 +105,7 @@
     }
 
     builderName() { return this._builderName; }
+    builderID() { return this._builderID; }
 
     addTestConfiguration(test, platform, propertiesTemplate)
     {
@@ -164,8 +196,8 @@
 
     pullBuildbot(count)
     {
-        return this._remote.getJSON(this.pathForPendingBuildsJSON()).then((content) => {
-            let pendingEntries = content.map((entry) => new BuildbotBuildEntry(this, entry));
+        return this._remote.getJSON(this.pathForPendingBuildsJSONDeprecated()).then((content) => {
+            let pendingEntries = content.map((entry) => new BuildbotBuildEntryDeprecated(this, entry));
             return this._pullRecentBuilds(count).then((entries) => {
                 let entryByRequest = {};
 
@@ -201,13 +233,14 @@
             for (let index of selectedBuilds) {
                 const entry = content[index];
                 if (entry && !entry['error'])
-                    entries.push(new BuildbotBuildEntry(this, entry));
+                    entries.push(new BuildbotBuildEntryDeprecated(this, entry));
             }
             return entries;
         });
     }
 
-    pathForPendingBuildsJSON() { return `/json/builders/${escape(this._builderName)}/pendingBuilds`; }
+    pathForPendingBuildsJSONDeprecated() { return `/json/builders/${escape(this._builderName)}/pendingBuilds`; }
+    pathForPendingBuilds() { return `/api/v2/builders/${this._builderID}/buildrequests?complete=false&claimed=false`; }
     pathForBuildJSON(selectedBuilds)
     {
         return `/json/builders/${escape(this._builderName)}/builds/?` + selectedBuilds.map((number) => 'select=' + number).join('&');
@@ -215,7 +248,9 @@
     pathForForceBuild() { return `/builders/${escape(this._builderName)}/force`; }
 
     url() { return this._remote.url(`/builders/${escape(this._builderName)}/`); }
-    urlForBuildNumber(number) { return this._remote.url(`/builders/${escape(this._builderName)}/builds/${number}`); }
+    urlForBuildNumberDeprecated(number) { return this._remote.url(`/builders/${escape(this._builderName)}/builds/${number}`); }
+    urlForBuildNumber(number) { return this._remote.url(`/#/builders/${this._builderID}/builds/${number}`); }
+    urlForPendingBuild(buildRequestId) { return this._remote.url(`/#/buildrequests/${buildRequestId}`); }
 
     _propertiesForBuildRequest(buildRequest, requestsInGroup)
     {
@@ -588,4 +623,5 @@
 if (typeof module != 'undefined') {
     module.exports.BuildbotSyncer = BuildbotSyncer;
     module.exports.BuildbotBuildEntry = BuildbotBuildEntry;
+    module.exports.BuildbotBuildEntryDeprecated = BuildbotBuildEntryDeprecated;
 }

Modified: trunk/Websites/perf.webkit.org/unit-tests/buildbot-syncer-tests.js (227995 => 227996)


--- trunk/Websites/perf.webkit.org/unit-tests/buildbot-syncer-tests.js	2018-02-02 04:46:23 UTC (rev 227995)
+++ trunk/Websites/perf.webkit.org/unit-tests/buildbot-syncer-tests.js	2018-02-02 07:06:19 UTC (rev 227996)
@@ -7,6 +7,7 @@
 let MockModels = require('./resources/mock-v3-models.js').MockModels;
 
 let BuildbotBuildEntry = require('../tools/js/buildbot-syncer.js').BuildbotBuildEntry;
+let BuildbotBuildEntryDeprecated = require('../tools/js/buildbot-syncer.js').BuildbotBuildEntryDeprecated;
 let BuildbotSyncer = require('../tools/js/buildbot-syncer.js').BuildbotSyncer;
 
 function sampleiOSConfig()
@@ -295,9 +296,82 @@
         'commitSet': commitSet, 'status': 'pending', 'platform': platform, 'test': test, 'order': order});
 }
 
-function samplePendingBuild(buildRequestId, buildTime, slaveName)
+function samplePendingBuildData(buildRequestId, buildTime, builderId)
 {
     return {
+        "builderid": builderId || 102,
+        "buildrequestid": buildRequestId || 16733,
+        "buildsetid": 894720,
+        "claimed": false,
+        "claimed_at": null,
+        "claimed_by_masterid": null,
+        "complete": false,
+        "complete_at": null,
+        "priority": 0,
+        "results": -1,
+        "submitted_at": buildTime || 1458704983,
+        "waited_for": false
+    };
+}
+
+function samplePendingBuild(buildRequestId, buildTime, builderName)
+{
+    return {
+        "buildrequests" : [samplePendingBuildData(buildRequestId, buildTime, builderNameToIDMap()[builderName])]
+    };
+}
+
+function sampleBuildData(workerName, isComplete, buildRequestId, buildNumber, builderId)
+{
+    return {
+        "builderid": builderId || 102,
+        "number": buildNumber || 614,
+        "buildrequestid": buildRequestId || 16733,
+        "complete": isComplete,
+        "complete_at": null,
+        "buildid": 418744,
+        "masterid": 1,
+        "results": null,
+        "started_at": 1513725109,
+        "state_string": "building",
+        "workerid": 41,
+        "properties": {
+            "platform": ["mac", "Unknown"],
+            "scheduler": ["ABTest-iPad-RunBenchmark-Tests-ForceScheduler", "Scheduler"],
+            "slavename": [workerName || "ABTest-iPad-0", "Worker (deprecated)"],
+            "workername": [workerName || "ABTest-iPad-0", "Worker"
+            ]
+        }
+    };
+}
+
+function sampleInProgressBuildData(workerName)
+{
+    return sampleBuildData(workerName, false);
+}
+
+function sampleInProgressBuild(workerName)
+{
+    return {
+        "builds": [sampleInProgressBuildData(workerName)]
+    };
+}
+
+function sampleFinishedBuildData(buildRequestId, workerName, builderName)
+{
+    return sampleBuildData(workerName, true, buildRequestId || 18935, 1755, builderNameToIDMap()[builderName]);
+}
+
+function sampleFinishedBuild(buildRequestId, workerName, builderName)
+{
+    return {
+        "builds": [sampleFinishedBuildData(buildRequestId, workerName, builderName)]
+    };
+}
+
+function samplePendingBuildDeprecated(buildRequestId, buildTime, slaveName)
+{
+    return {
         'builderName': 'ABTest-iPad-RunBenchmark-Tests',
         'builds': [],
         'properties': [
@@ -322,7 +396,7 @@
     };
 }
 
-function sampleInProgressBuild(slaveName)
+function sampleInProgressBuildDeprecated(slaveName)
 {
     return {
         'blame': [],
@@ -411,7 +485,7 @@
     };
 }
 
-function sampleFinishedBuild(buildRequestId, slaveName)
+function sampleFinishedBuildDeprecated(buildRequestId, slaveName)
 {
     return {
         'blame': [],
@@ -1196,12 +1270,94 @@
         });
     });
 
+
+    describe('BuildbotBuildEntry', () => {
+        it('should create BuildbotBuildEntry for pending build', () => {
+            let syncer = BuildbotSyncer._loadConfig(MockRemoteAPI, sampleiOSConfig(), builderNameToIDMap())[1];
+            const buildbotData = samplePendingBuild();
+            const pendingEntries = buildbotData.buildrequests.map((entry) => new BuildbotBuildEntry(syncer, entry));
+
+            assert.equal(pendingEntries.length, 1);
+            const entry = pendingEntries[0];
+            assert.ok(entry instanceof BuildbotBuildEntry);
+            assert.ok(!entry.buildNumber());
+            assert.ok(!entry.workerName());
+            assert.equal(entry.buildRequestId(), 16733);
+            assert.ok(entry.isPending());
+            assert.ok(!entry.isInProgress());
+            assert.ok(!entry.hasFinished());
+            assert.equal(entry.url(), 'http://build.webkit.org/#/buildrequests/16733');
+        });
+
+        it('should create BuildbotBuildEntry for in-progress build', () => {
+            let syncer = BuildbotSyncer._loadConfig(MockRemoteAPI, sampleiOSConfig(), builderNameToIDMap())[1];
+            const buildbotData = sampleInProgressBuild();
+            const entries = buildbotData.builds.map((entry) => new BuildbotBuildEntry(syncer, entry));
+
+            assert.equal(entries.length, 1);
+            const entry = entries[0];
+            assert.ok(entry instanceof BuildbotBuildEntry);
+            assert.equal(entry.buildNumber(), 614);
+            assert.equal(entry.workerName(), 'ABTest-iPad-0');
+            assert.equal(entry.buildRequestId(), 16733);
+            assert.ok(!entry.isPending());
+            assert.ok(entry.isInProgress());
+            assert.ok(!entry.hasFinished());
+            assert.equal(entry.url(), 'http://build.webkit.org/#/builders/102/builds/614');
+        });
+
+        it('should create BuildbotBuildEntry for finished build', () => {
+            let syncer = BuildbotSyncer._loadConfig(MockRemoteAPI, sampleiOSConfig(), builderNameToIDMap())[1];
+            const buildbotData = sampleFinishedBuild();
+            const entries = buildbotData.builds.map((entry) => new BuildbotBuildEntry(syncer, entry));
+
+            assert.deepEqual(entries.length, 1);
+            const entry = entries[0];
+            assert.ok(entry instanceof BuildbotBuildEntry);
+            assert.equal(entry.buildNumber(), 1755);
+            assert.equal(entry.workerName(), 'ABTest-iPad-0');
+            assert.equal(entry.buildRequestId(), 18935);
+            assert.ok(!entry.isPending());
+            assert.ok(!entry.isInProgress());
+            assert.ok(entry.hasFinished());
+            assert.equal(entry.url(), 'http://build.webkit.org/#/builders/102/builds/1755');
+        });
+
+        it('should create BuildbotBuildEntry for mix of in-progress and finished builds', () => {
+            let syncer = BuildbotSyncer._loadConfig(MockRemoteAPI, sampleiOSConfig(), builderNameToIDMap())[1];
+            const buildbotData = {'builds': [sampleInProgressBuildData(), sampleFinishedBuildData()]};
+            const entries = buildbotData.builds.map((entry) => new BuildbotBuildEntry(syncer, entry));
+
+            assert.deepEqual(entries.length, 2);
+
+            let entry = entries[0];
+            assert.ok(entry instanceof BuildbotBuildEntry);
+            assert.equal(entry.buildNumber(), 614);
+            assert.equal(entry.workerName(), 'ABTest-iPad-0');
+            assert.equal(entry.buildRequestId(), 16733);
+            assert.ok(!entry.isPending());
+            assert.ok(entry.isInProgress());
+            assert.ok(!entry.hasFinished());
+            assert.equal(entry.url(), 'http://build.webkit.org/#/builders/102/builds/614');
+
+            entry = entries[1];
+            assert.ok(entry instanceof BuildbotBuildEntry);
+            assert.equal(entry.buildNumber(), 1755);
+            assert.equal(entry.slaveName(), 'ABTest-iPad-0');
+            assert.equal(entry.buildRequestId(), 18935);
+            assert.ok(!entry.isPending());
+            assert.ok(!entry.isInProgress());
+            assert.ok(entry.hasFinished());
+            assert.equal(entry.url(), 'http://build.webkit.org/#/builders/102/builds/1755');
+        });
+    });
+
     describe('pullBuildbot', () => {
         it('should fetch pending builds from the right URL', () => {
             let syncer = BuildbotSyncer._loadConfig(MockRemoteAPI, sampleiOSConfig(), builderNameToIDMap())[1];
             assert.equal(syncer.builderName(), 'ABTest-iPad-RunBenchmark-Tests');
             let expectedURL = '/json/builders/ABTest-iPad-RunBenchmark-Tests/pendingBuilds';
-            assert.equal(syncer.pathForPendingBuildsJSON(), expectedURL);
+            assert.equal(syncer.pathForPendingBuildsJSONDeprecated(), expectedURL);
             syncer.pullBuildbot();
             assert.equal(requests.length, 1);
             assert.equal(requests[0].url, expectedURL);
@@ -1237,11 +1393,11 @@
         it('should create BuildbotBuildEntry for pending builds', () => {
             let syncer = BuildbotSyncer._loadConfig(MockRemoteAPI, sampleiOSConfig(), builderNameToIDMap())[1];
             let promise = syncer.pullBuildbot();
-            requests[0].resolve([samplePendingBuild()]);
+            requests[0].resolve([samplePendingBuildDeprecated()]);
             return promise.then((entries) => {
                 assert.equal(entries.length, 1);
                 let entry = entries[0];
-                assert.ok(entry instanceof BuildbotBuildEntry);
+                assert.ok(entry instanceof BuildbotBuildEntryDeprecated);
                 assert.ok(!entry.buildNumber());
                 assert.ok(!entry.slaveName());
                 assert.equal(entry.buildRequestId(), 16733);
@@ -1260,12 +1416,12 @@
             requests[0].resolve([]);
             return MockRemoteAPI.waitForRequest().then(() => {
                 assert.equal(requests.length, 2);
-                requests[1].resolve({[-1]: sampleInProgressBuild()});
+                requests[1].resolve({[-1]: sampleInProgressBuildDeprecated()});
                 return promise;
             }).then((entries) => {
                 assert.equal(entries.length, 1);
                 let entry = entries[0];
-                assert.ok(entry instanceof BuildbotBuildEntry);
+                assert.ok(entry instanceof BuildbotBuildEntryDeprecated);
                 assert.equal(entry.buildNumber(), 614);
                 assert.equal(entry.slaveName(), 'ABTest-iPad-0');
                 assert.equal(entry.buildRequestId(), 16733);
@@ -1284,12 +1440,12 @@
             requests[0].resolve([]);
             return MockRemoteAPI.waitForRequest().then(() => {
                 assert.equal(requests.length, 2);
-                requests[1].resolve({[-1]: sampleFinishedBuild()});
+                requests[1].resolve({[-1]: sampleFinishedBuildDeprecated()});
                 return promise;
             }).then((entries) => {
                 assert.deepEqual(entries.length, 1);
                 let entry = entries[0];
-                assert.ok(entry instanceof BuildbotBuildEntry);
+                assert.ok(entry instanceof BuildbotBuildEntryDeprecated);
                 assert.equal(entry.buildNumber(), 1755);
                 assert.equal(entry.slaveName(), 'ABTest-iPad-0');
                 assert.equal(entry.buildRequestId(), 18935);
@@ -1306,17 +1462,17 @@
             let promise = syncer.pullBuildbot(5);
             assert.equal(requests.length, 1);
 
-            requests[0].resolve([samplePendingBuild(123)]);
+            requests[0].resolve([samplePendingBuildDeprecated(123)]);
 
             return MockRemoteAPI.waitForRequest().then(() => {
                 assert.equal(requests.length, 2);
-                requests[1].resolve({[-1]: sampleFinishedBuild(), [-2]: {'error': 'Not available'}, [-4]: sampleInProgressBuild()});
+                requests[1].resolve({[-1]: sampleFinishedBuildDeprecated(), [-2]: {'error': 'Not available'}, [-4]: sampleInProgressBuildDeprecated()});
                 return promise;
             }).then((entries) => {
                 assert.deepEqual(entries.length, 3);
 
                 let entry = entries[0];
-                assert.ok(entry instanceof BuildbotBuildEntry);
+                assert.ok(entry instanceof BuildbotBuildEntryDeprecated);
                 assert.equal(entry.buildNumber(), null);
                 assert.equal(entry.slaveName(), null);
                 assert.equal(entry.buildRequestId(), 123);
@@ -1326,7 +1482,7 @@
                 assert.equal(entry.url(), 'http://build.webkit.org/builders/ABTest-iPad-RunBenchmark-Tests/');
 
                 entry = entries[1];
-                assert.ok(entry instanceof BuildbotBuildEntry);
+                assert.ok(entry instanceof BuildbotBuildEntryDeprecated);
                 assert.equal(entry.buildNumber(), 614);
                 assert.equal(entry.slaveName(), 'ABTest-iPad-0');
                 assert.equal(entry.buildRequestId(), 16733);
@@ -1336,7 +1492,7 @@
                 assert.equal(entry.url(), 'http://build.webkit.org/builders/ABTest-iPad-RunBenchmark-Tests/builds/614');
 
                 entry = entries[2];
-                assert.ok(entry instanceof BuildbotBuildEntry);
+                assert.ok(entry instanceof BuildbotBuildEntryDeprecated);
                 assert.equal(entry.buildNumber(), 1755);
                 assert.equal(entry.slaveName(), 'ABTest-iPad-0');
                 assert.equal(entry.buildRequestId(), 18935);
@@ -1353,17 +1509,17 @@
             let promise = syncer.pullBuildbot(5);
             assert.equal(requests.length, 1);
 
-            requests[0].resolve([samplePendingBuild(456, 2), samplePendingBuild(123, 1)]);
+            requests[0].resolve([samplePendingBuildDeprecated(456, 2), samplePendingBuildDeprecated(123, 1)]);
 
             return MockRemoteAPI.waitForRequest().then(() => {
                 assert.equal(requests.length, 2);
-                requests[1].resolve({[-3]: sampleFinishedBuild(), [-1]: {'error': 'Not available'}, [-2]: sampleInProgressBuild()});
+                requests[1].resolve({[-3]: sampleFinishedBuildDeprecated(), [-1]: {'error': 'Not available'}, [-2]: sampleInProgressBuildDeprecated()});
                 return promise;
             }).then((entries) => {
                 assert.deepEqual(entries.length, 4);
 
                 let entry = entries[0];
-                assert.ok(entry instanceof BuildbotBuildEntry);
+                assert.ok(entry instanceof BuildbotBuildEntryDeprecated);
                 assert.equal(entry.buildNumber(), null);
                 assert.equal(entry.slaveName(), null);
                 assert.equal(entry.buildRequestId(), 123);
@@ -1373,7 +1529,7 @@
                 assert.equal(entry.url(), 'http://build.webkit.org/builders/ABTest-iPad-RunBenchmark-Tests/');
 
                 entry = entries[1];
-                assert.ok(entry instanceof BuildbotBuildEntry);
+                assert.ok(entry instanceof BuildbotBuildEntryDeprecated);
                 assert.equal(entry.buildNumber(), null);
                 assert.equal(entry.slaveName(), null);
                 assert.equal(entry.buildRequestId(), 456);
@@ -1383,7 +1539,7 @@
                 assert.equal(entry.url(), 'http://build.webkit.org/builders/ABTest-iPad-RunBenchmark-Tests/');
 
                 entry = entries[2];
-                assert.ok(entry instanceof BuildbotBuildEntry);
+                assert.ok(entry instanceof BuildbotBuildEntryDeprecated);
                 assert.equal(entry.buildNumber(), 614);
                 assert.equal(entry.slaveName(), 'ABTest-iPad-0');
                 assert.equal(entry.buildRequestId(), 16733);
@@ -1393,7 +1549,7 @@
                 assert.equal(entry.url(), 'http://build.webkit.org/builders/ABTest-iPad-RunBenchmark-Tests/builds/614');
 
                 entry = entries[3];
-                assert.ok(entry instanceof BuildbotBuildEntry);
+                assert.ok(entry instanceof BuildbotBuildEntryDeprecated);
                 assert.equal(entry.buildNumber(), 1755);
                 assert.equal(entry.slaveName(), 'ABTest-iPad-0');
                 assert.equal(entry.buildRequestId(), 18935);
@@ -1410,17 +1566,17 @@
             let promise = syncer.pullBuildbot(5);
             assert.equal(requests.length, 1);
 
-            requests[0].resolve([samplePendingBuild()]);
+            requests[0].resolve([samplePendingBuildDeprecated()]);
 
             return MockRemoteAPI.waitForRequest().then(() => {
                 assert.equal(requests.length, 2);
-                requests[1].resolve({[-1]: sampleInProgressBuild()});
+                requests[1].resolve({[-1]: sampleInProgressBuildDeprecated()});
                 return promise;
             }).then((entries) => {
                 assert.equal(entries.length, 1);
 
                 let entry = entries[0];
-                assert.ok(entry instanceof BuildbotBuildEntry);
+                assert.ok(entry instanceof BuildbotBuildEntryDeprecated);
                 assert.equal(entry.buildNumber(), 614);
                 assert.equal(entry.slaveName(), 'ABTest-iPad-0');
                 assert.equal(entry.buildRequestId(), 16733);
@@ -1437,17 +1593,17 @@
             let promise = syncer.pullBuildbot(5);
             assert.equal(requests.length, 1);
 
-            requests[0].resolve([samplePendingBuild()]);
+            requests[0].resolve([samplePendingBuildDeprecated()]);
 
             return MockRemoteAPI.waitForRequest().then(() => {
                 assert.equal(requests.length, 2);
-                requests[1].resolve({[-1]: sampleFinishedBuild(16733)});
+                requests[1].resolve({[-1]: sampleFinishedBuildDeprecated(16733)});
                 return promise;
             }).then((entries) => {
                 assert.equal(entries.length, 1);
 
                 let entry = entries[0];
-                assert.ok(entry instanceof BuildbotBuildEntry);
+                assert.ok(entry instanceof BuildbotBuildEntryDeprecated);
                 assert.equal(entry.buildNumber(), 1755);
                 assert.equal(entry.slaveName(), 'ABTest-iPad-0');
                 assert.equal(entry.buildRequestId(), 16733);
@@ -1547,7 +1703,7 @@
         it('should schedule a build if builder only has finished builds on the matching slave', () => {
             let syncer = BuildbotSyncer._loadConfig(MockRemoteAPI, sampleiOSConfig(), builderNameToIDMap())[1];
 
-            pullBuildbotWithAssertion(syncer, [], {[-1]: sampleFinishedBuild()}).then(() => {
+            pullBuildbotWithAssertion(syncer, [], {[-1]: sampleFinishedBuildDeprecated()}).then(() => {
                 const request = createSampleBuildRequest(MockModels.ipad, MockModels.speedometer);
                 syncer.scheduleRequestInGroupIfAvailable(request, [request], null);
                 assert.equal(requests.length, 1);
@@ -1559,7 +1715,7 @@
         it('should not schedule a build if builder has a pending build on the maching slave', () => {
             let syncer = BuildbotSyncer._loadConfig(MockRemoteAPI, sampleiOSConfig(), builderNameToIDMap())[1];
 
-            pullBuildbotWithAssertion(syncer, [samplePendingBuild()], {}).then(() => {
+            pullBuildbotWithAssertion(syncer, [samplePendingBuildDeprecated()], {}).then(() => {
                 const request = createSampleBuildRequest(MockModels.ipad, MockModels.speedometer);
                 syncer.scheduleRequestInGroupIfAvailable(request, [request], null);
                 assert.equal(requests.length, 0);
@@ -1569,7 +1725,7 @@
         it('should schedule a build if builder only has a pending build on a non-maching slave', () => {
             let syncer = BuildbotSyncer._loadConfig(MockRemoteAPI, sampleiOSConfig(), builderNameToIDMap())[1];
 
-            return pullBuildbotWithAssertion(syncer, [samplePendingBuild(1, 1, 'another-slave')], {}).then(() => {
+            return pullBuildbotWithAssertion(syncer, [samplePendingBuildDeprecated(1, 1, 'another-slave')], {}).then(() => {
                 const request = createSampleBuildRequest(MockModels.ipad, MockModels.speedometer);
                 syncer.scheduleRequestInGroupIfAvailable(request, [request], null);
                 assert.equal(requests.length, 1);
@@ -1579,7 +1735,7 @@
         it('should schedule a build if builder only has an in-progress build on the matching slave', () => {
             let syncer = BuildbotSyncer._loadConfig(MockRemoteAPI, sampleiOSConfig(), builderNameToIDMap())[1];
 
-            return pullBuildbotWithAssertion(syncer, [], {[-1]: sampleInProgressBuild()}).then(() => {
+            return pullBuildbotWithAssertion(syncer, [], {[-1]: sampleInProgressBuildDeprecated()}).then(() => {
                 const request = createSampleBuildRequest(MockModels.ipad, MockModels.speedometer);
                 syncer.scheduleRequestInGroupIfAvailable(request, [request], null);
                 assert.equal(requests.length, 1);
@@ -1589,7 +1745,7 @@
         it('should schedule a build if builder has an in-progress build on another slave', () => {
             let syncer = BuildbotSyncer._loadConfig(MockRemoteAPI, sampleiOSConfig(), builderNameToIDMap())[1];
 
-            return pullBuildbotWithAssertion(syncer, [], {[-1]: sampleInProgressBuild('other-slave')}).then(() => {
+            return pullBuildbotWithAssertion(syncer, [], {[-1]: sampleInProgressBuildDeprecated('other-slave')}).then(() => {
                 const request = createSampleBuildRequest(MockModels.ipad, MockModels.speedometer);
                 syncer.scheduleRequestInGroupIfAvailable(request, [request], null);
                 assert.equal(requests.length, 1);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to