Title: [240200] trunk/Websites/perf.webkit.org
Revision
240200
Author
[email protected]
Date
2019-01-19 01:08:11 -0800 (Sat, 19 Jan 2019)

Log Message

Updating commit in OSBuildFetcher should respect revision range in config.
https://bugs.webkit.org/show_bug.cgi?id=193558

Reviewed by Ryosuke Niwa.

OSBuildFetcher._fetchAvailableBuilds should filter out commits those are not in
revision range specified by cofnig.

* server-tests/tools-os-build-fetcher-tests.js: Added a unit test for this change.
* tools/js/os-build-fetcher.js:
(prototype.async._fetchAvailableBuilds): Filter out commits from update list if commit
revision is out of range.

Modified Paths

Diff

Modified: trunk/Websites/perf.webkit.org/ChangeLog (240199 => 240200)


--- trunk/Websites/perf.webkit.org/ChangeLog	2019-01-19 07:53:14 UTC (rev 240199)
+++ trunk/Websites/perf.webkit.org/ChangeLog	2019-01-19 09:08:11 UTC (rev 240200)
@@ -1,3 +1,18 @@
+2019-01-17  Dewei Zhu  <[email protected]>
+
+        Updating commit in OSBuildFetcher should respect revision range in config.
+        https://bugs.webkit.org/show_bug.cgi?id=193558
+
+        Reviewed by Ryosuke Niwa.
+
+        OSBuildFetcher._fetchAvailableBuilds should filter out commits those are not in
+        revision range specified by cofnig.
+
+        * server-tests/tools-os-build-fetcher-tests.js: Added a unit test for this change.
+        * tools/js/os-build-fetcher.js:
+        (prototype.async._fetchAvailableBuilds): Filter out commits from update list if commit
+        revision is out of range.
+
 2018-12-31  Dewei Zhu  <[email protected]>
 
         Test group results notification should not say a build request to build had failed even when it had successfully completed.

Modified: trunk/Websites/perf.webkit.org/server-tests/tools-os-build-fetcher-tests.js (240199 => 240200)


--- trunk/Websites/perf.webkit.org/server-tests/tools-os-build-fetcher-tests.js	2019-01-19 07:53:14 UTC (rev 240199)
+++ trunk/Websites/perf.webkit.org/server-tests/tools-os-build-fetcher-tests.js	2019-01-19 09:08:11 UTC (rev 240200)
@@ -534,7 +534,7 @@
             });
         });
 
-        it('should update testability warning for commits', async () => {
+        it('should update testability message for commits', async () => {
             const logger = new MockLogger;
             const fetcher = new OSBuildFetcher(config, TestServer.remoteAPI(), slaveAuth, MockSubprocess, logger);
             const db = TestServer.database();
@@ -799,6 +799,49 @@
             assert.equal(result['commits'][0]['order'], 1604003400);
         });
 
+        it('should update commits within specified revision range', async () => {
+            const logger = new MockLogger;
+            const fetcher = new OSBuildFetcher(configWithoutOwnedCommitCommand, TestServer.remoteAPI(), slaveAuth, MockSubprocess, logger);
+            const db = TestServer.database();
+            const resultsForSierraD = {allRevisions: ["Sierra16D68", "Sierra16D69"], commitsWithTestability: {"Sierra16D10000": "Panic"}};
+            const resultsForSierraE = {allRevisions: ["Sierra16E32", "Sierra16E33", "Sierra16E33h", "Sierra16E34", "Sierra16E10000"], commitsWithTestability: {}};
+
+            await addSlaveForReport(emptyReport);
+            await Promise.all([
+                db.insert('repositories', {'id': 10, 'name': 'OSX'}),
+                db.insert('commits', {'repository': 10, 'revision': 'Sierra16D67', 'order': 1603006700, 'reported': true}),
+                db.insert('commits', {'repository': 10, 'revision': 'Sierra16D68', 'order': 1603006800, 'reported': true}),
+                db.insert('commits', {'repository': 10, 'revision': 'Sierra16D69', 'order': 1603006900, 'reported': false}),
+                db.insert('commits', {'repository': 10, 'revision': 'Sierra16E32', 'order': 1604003200, 'reported': true}),
+                db.insert('commits', {'repository': 10, 'revision': 'Sierra16E33', 'order': 1604003300, 'reported': true}),
+                db.insert('commits', {'repository': 10, 'revision': 'Sierra16E33g', 'order': 1604003307, 'reported': true})]);
+
+            let result = await TestServer.remoteAPI().getJSON('/api/commits/OSX/last-reported?from=1603000000&to=1603099900');
+            assert.equal(result['commits'].length, 1);
+            assert.equal(result['commits'][0]['revision'], 'Sierra16D68');
+            assert.equal(result['commits'][0]['order'], 1603006800);
+
+            result = await TestServer.remoteAPI().getJSON('/api/commits/OSX/last-reported?from=1604000000&to=1604099900');
+            assert.equal(result['commits'].length, 1);
+            assert.equal(result['commits'][0]['revision'], 'Sierra16E33g');
+            assert.equal(result['commits'][0]['order'], 1604003307);
+            const waitForInvocationPromise = MockSubprocess.waitForInvocation();
+            const fetchAvailableBuildsPromise = fetcher._fetchAvailableBuilds();
+
+            await waitForInvocationPromise;
+            assert.equal(invocations.length, 1);
+            assert.deepEqual(invocations[0].command, ['list', 'all osx 16Dxx builds']);
+            invocations[0].resolve(JSON.stringify(resultsForSierraD));
+
+            await MockSubprocess.resetAndWaitForInvocation();
+            assert.equal(invocations.length, 1);
+            assert.deepEqual(invocations[0].command, ['list', 'all osx 16Exx builds']);
+            invocations[0].resolve(JSON.stringify(resultsForSierraE));
+
+            result = await fetchAvailableBuildsPromise;
+            assert.equal(result.commitsToUpdate.length, 0);
+        });
+
         it('should use "last-reported" order + 1 as "minOrder"', async () => {
             const logger = new MockLogger;
             const fetcher = new OSBuildFetcher(configTrackingOneOS, TestServer.remoteAPI(), slaveAuth, MockSubprocess, logger);

Modified: trunk/Websites/perf.webkit.org/tools/js/os-build-fetcher.js (240199 => 240200)


--- trunk/Websites/perf.webkit.org/tools/js/os-build-fetcher.js	2019-01-19 07:53:14 UTC (rev 240199)
+++ trunk/Websites/perf.webkit.org/tools/js/os-build-fetcher.js	2019-01-19 09:08:11 UTC (rev 240200)
@@ -68,8 +68,12 @@
             }
             newCommitsToReport.push(...commits);
 
-            for (const [revision, testability] of Object.entries(commitInfo.commitsWithTestability))
+            for (const [revision, testability] of Object.entries(commitInfo.commitsWithTestability)) {
+                const order = this._computeOrder(revision);
+                if (order > maxRevisionOrder || order < minRevisionOrder)
+                    continue;
                 commitsToUpdate.push({repository: repositoryName, revision, testability});
+            }
         }
         return {newCommitsToReport, commitsToUpdate};
     }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to