WebKit Bugzilla
Attachment 359427 Details for
Bug 193558
: Updating commit in OSBuildFetcher should respect revision range in config.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-193558-20190117165812.patch (text/plain), 6.14 KB, created by
dewei_zhu
on 2019-01-17 16:58:13 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
dewei_zhu
Created:
2019-01-17 16:58:13 PST
Size:
6.14 KB
patch
obsolete
>Subversion Revision: 240136 >diff --git a/Websites/perf.webkit.org/ChangeLog b/Websites/perf.webkit.org/ChangeLog >index 4156c10f0782da67f791486e6846b12d114022bc..c8c33d4be8e2c63fe193ab6186e4bf5861e5e1fb 100644 >--- a/Websites/perf.webkit.org/ChangeLog >+++ b/Websites/perf.webkit.org/ChangeLog >@@ -1,3 +1,17 @@ >+2019-01-17 Dewei Zhu <dewei_zhu@apple.com> >+ >+ Updating commit in OSBuildFetcher should respect revision range in config. >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ 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-21 Dewei Zhu <dewei_zhu@apple.com> > > Add UI in analysis task page to show commit testability information. >diff --git a/Websites/perf.webkit.org/server-tests/tools-os-build-fetcher-tests.js b/Websites/perf.webkit.org/server-tests/tools-os-build-fetcher-tests.js >index f7a1eb65dfa4637c0022eda5b00098735449f10f..7b2e517c31f0559a1213c112c49d4aadbd2671d3 100644 >--- a/Websites/perf.webkit.org/server-tests/tools-os-build-fetcher-tests.js >+++ b/Websites/perf.webkit.org/server-tests/tools-os-build-fetcher-tests.js >@@ -534,7 +534,7 @@ describe('OSBuildFetcher', function() { > }); > }); > >- 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 @@ describe('OSBuildFetcher', function() { > 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); >diff --git a/Websites/perf.webkit.org/tools/js/os-build-fetcher.js b/Websites/perf.webkit.org/tools/js/os-build-fetcher.js >index 0806325118b6e6d93837dcd598f25d23be2274cf..9934079d6b3aa49d87ee43da5951a7dc102c09fc 100644 >--- a/Websites/perf.webkit.org/tools/js/os-build-fetcher.js >+++ b/Websites/perf.webkit.org/tools/js/os-build-fetcher.js >@@ -68,8 +68,12 @@ class OSBuildFetcher { > } > 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}; > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
rniwa
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 193558
: 359427