WebKit Bugzilla
Attachment 358170 Details for
Bug 193065
: 'TestGroup.commitSetsFromTestGroupsAndMeasurementSet' should also return commit sets from test groups.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-193065-20190101031328.patch (text/plain), 10.35 KB, created by
dewei_zhu
on 2019-01-01 03:13:29 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
dewei_zhu
Created:
2019-01-01 03:13:29 PST
Size:
10.35 KB
patch
obsolete
>Subversion Revision: 239567 >diff --git a/Websites/perf.webkit.org/ChangeLog b/Websites/perf.webkit.org/ChangeLog >index 0936909761a24f17dcf3aa9b7a42ee14d24be505..c4267c3b240ce3c3b97a362b435014373b6bad9f 100644 >--- a/Websites/perf.webkit.org/ChangeLog >+++ b/Websites/perf.webkit.org/ChangeLog >@@ -1,3 +1,16 @@ >+2019-01-01 Dewei Zhu <dewei_zhu@apple.com> >+ >+ 'TestGroup.commitSetsFromTestGroupsAndMeasurementSet' should also return commit sets from test groups. >+ https://bugs.webkit.org/show_bug.cgi?id=193065 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Commit sets from test groups are gathered but never returned in >+ 'TestGroup.commitSetsFromTestGroupsAndMeasurementSet' >+ >+ * public/v3/models/analysis-task.js: Added commit sets from test groups to the return value. >+ * unit-tests/analysis-task-tests.js: Added a unit test for this bug. >+ > 2018-12-14 Dewei Zhu <dewei_zhu@apple.com> > > Extend commits table to contain testability information. >diff --git a/Websites/perf.webkit.org/public/v3/models/analysis-task.js b/Websites/perf.webkit.org/public/v3/models/analysis-task.js >index dbb7c2e090a6607c530f9dd89987ab345223280d..b2d9cf3dea71e8c5b143cf1a755f21e46c99ee79 100644 >--- a/Websites/perf.webkit.org/public/v3/models/analysis-task.js >+++ b/Websites/perf.webkit.org/public/v3/models/analysis-task.js >@@ -190,7 +190,8 @@ class AnalysisTask extends LabeledObject { > const startPoint = series.findById(this.startMeasurementId()); > const endPoint = series.findById(this.endMeasurementId()); > >- return Array.from(series.viewBetweenPoints(startPoint, endPoint)).map((point) => point.commitSet()); >+ const measurementSets = Array.from(series.viewBetweenPoints(startPoint, endPoint)).map((point) => point.commitSet()); >+ return [...allCommitSetsInTask, ...measurementSets]; > } > > static categories() >diff --git a/Websites/perf.webkit.org/unit-tests/analysis-task-tests.js b/Websites/perf.webkit.org/unit-tests/analysis-task-tests.js >index d845c910ba75ece349af4e34d12c443f4a247103..93b53d3c1a333cbf8649e2af6f4a4a23d1b26519 100644 >--- a/Websites/perf.webkit.org/unit-tests/analysis-task-tests.js >+++ b/Websites/perf.webkit.org/unit-tests/analysis-task-tests.js >@@ -121,6 +121,108 @@ function measurementCluster() > }; > } > >+function anotherMeasurementCluster() >+{ >+ return { >+ 'clusterStart': 946684800000, >+ 'clusterSize': 5184000000, >+ 'formatMap': [ >+ 'id', >+ 'mean', >+ 'iterationCount', >+ 'sum', >+ 'squareSum', >+ 'markedOutlier', >+ 'revisions', >+ 'commitTime', >+ 'build', >+ 'buildTime', >+ 'buildNumber', >+ 'builder' >+ ], >+ 'configurations': { >+ current: [ >+ [ >+ 37117949, >+ 124.15015662116, >+ 25, >+ 3103.7539155291, >+ 385398.06003414, >+ false, >+ [ >+ [ >+ 105978, >+ 10, >+ '791451', >+ null, >+ 1454481204649 >+ ], >+ [ >+ 105975, >+ 11, >+ '196051', >+ null, >+ 1454481246108 >+ ], >+ [ >+ 105502, >+ 9, >+ '10.11 15D21', >+ 1504021, >+ 0 >+ ] >+ ], >+ 1454481246108, >+ 227020, >+ 1454492139496, >+ '3151', >+ 179 >+ ], >+ [ >+ 37253448, >+ 124.15015662116, >+ 25, >+ 3103.7539155291, >+ 385398.06003414, >+ false, >+ [ >+ [ >+ 105978, >+ 10, >+ '791451', >+ null, >+ 1454481204649 >+ ], >+ [ >+ 105975, >+ 11, >+ '196051', >+ null, >+ 1454481246108 >+ ], >+ [ >+ 105502, >+ 9, >+ '10.11 15D21', >+ 1504021, >+ 0 >+ ] >+ ], >+ 1454481246108, >+ 227020, >+ 1454492139496, >+ '3151', >+ 179 >+ ], >+ ] >+ }, >+ 'startTime': 1465084800000, >+ 'endTime': 1470268800000, >+ 'lastModified': 1467852503940, >+ 'clusterCount': 1, >+ 'status': 'OK'}; >+} >+ > describe('AnalysisTask', () => { > MockModels.inject(); > >@@ -165,7 +267,7 @@ describe('AnalysisTask', () => { > assert.equal(requests[1].url, `/api/analysis-tasks?id=${taskId}`); > }); > >- }) >+ }); > > describe('fetchAll', () => { > const requests = MockRemoteAPI.inject(null, BrowserPrivilegedAPI); >@@ -270,6 +372,132 @@ describe('AnalysisTask', () => { > }); > }); > >+ function sampleTestGroup(needsNotification=true, initialRepetitionCount=2, mayNeedMoreRequests=true) { >+ return { >+ "testGroups": [{ >+ "id": "2128", >+ "task": "1376", >+ "platform": "31", >+ "name": "Confirm", >+ "author": "rniwa", >+ "createdAt": 1458688514000, >+ "hidden": false, >+ "needsNotification": needsNotification, >+ "buildRequests": ["16985", "16986", "16987", "16988", "16989", "16990", "16991", "16992"], >+ "commitSets": ["4255", "4256"], >+ "notificationSentAt": null, >+ initialRepetitionCount, >+ mayNeedMoreRequests >+ }], >+ "buildRequests": [{ >+ "id": "16985", >+ "triggerable": "3", >+ "test": "844", >+ "platform": "31", >+ "testGroup": "2128", >+ "order": "0", >+ "commitSet": "4255", >+ "status": "pending", >+ "url": null, >+ "build": null, >+ "createdAt": 1458688514000 >+ }, { >+ "id": "16986", >+ "triggerable": "3", >+ "test": "844", >+ "platform": "31", >+ "testGroup": "2128", >+ "order": "1", >+ "commitSet": "4256", >+ "status": "pending", >+ "url": null, >+ "build": null, >+ "createdAt": 1458688514000 >+ }, >+ { >+ "id": "16987", >+ "triggerable": "3", >+ "test": "844", >+ "platform": "31", >+ "testGroup": "2128", >+ "order": "2", >+ "commitSet": "4255", >+ "status": "pending", >+ "url": null, >+ "build": null, >+ "createdAt": 1458688514000 >+ }, { >+ "id": "16988", >+ "triggerable": "3", >+ "test": "844", >+ "platform": "31", >+ "testGroup": "2128", >+ "order": "3", >+ "commitSet": "4256", >+ "status": "pending", >+ "url": null, >+ "build": null, >+ "createdAt": 1458688514000 >+ }], >+ "commitSets": [{ >+ "id": "4255", >+ "revisionItems": [{"commit": "87832"}, {"commit": "93116"}], >+ "customRoots": [], >+ }, { >+ "id": "4256", >+ "revisionItems": [{"commit": "87832"}, {"commit": "96336"}], >+ "customRoots": [], >+ }], >+ "commits": [{ >+ "id": "87832", >+ "repository": "9", >+ "revision": "10.11 15A284", >+ "time": 0 >+ }, { >+ "id": "93116", >+ "repository": "11", >+ "revision": "191622", >+ "time": 1445945816878 >+ }, { >+ "id": "87832", >+ "repository": "9", >+ "revision": "10.11 15A284", >+ "time": 0 >+ }, { >+ "id": "96336", >+ "repository": "11", >+ "revision": "192736", >+ "time": 1448225325650 >+ }], >+ "uploadedFiles": [], >+ "status": "OK" >+ }; >+ } >+ >+ describe('commitSetsFromTestGroupsAndMeasurementSet', () => { >+ const requests = MockRemoteAPI.inject(null, BrowserPrivilegedAPI); >+ it('should return both measurement sets and commit sets', async () => { >+ const fetchAll = AnalysisTask.fetchAll(); >+ assert.equal(requests.length, 1); >+ assert.equal(requests[0].url, '/api/analysis-tasks'); >+ requests[0].resolve(sampleAnalysisTasks()); >+ >+ const tasks = await fetchAll; >+ const task = tasks[0]; >+ >+ const fetchingPromise = task.commitSetsFromTestGroupsAndMeasurementSet(); >+ >+ assert.equal(requests.length, 3); >+ assert.equal(requests[1].url, '/data/measurement-set-65-2884.json'); >+ assert.equal(requests[2].url, '/api/test-groups?task=1082'); >+ >+ requests[1].resolve(anotherMeasurementCluster()); >+ requests[2].resolve(sampleTestGroup()); >+ const commitSets = await fetchingPromise; >+ >+ assert.equal(commitSets.length, 4); >+ }); >+ }); > > function mockStartAndEndPoints() { > const startPoint = makeMockPoints(1, new MeasurementCommitSet(1, [
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:
dewei_zhu:
review?
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 193065
: 358170