WebKit Bugzilla
Attachment 372586 Details for
Bug 197973
: 'analysis-task-configurator-pane' does not update when switch from one analysis task to another
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-197973-20190620144424.patch (text/plain), 41.72 KB, created by
Zhifei Fang
on 2019-06-20 14:44:25 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Zhifei Fang
Created:
2019-06-20 14:44:25 PDT
Size:
41.72 KB
patch
obsolete
>Index: Websites/perf.webkit.org/ChangeLog >=================================================================== >--- Websites/perf.webkit.org/ChangeLog (revision 246652) >+++ Websites/perf.webkit.org/ChangeLog (working copy) >@@ -1,3 +1,47 @@ >+2019-06-20 Zhifei Fang <zhifei_fang@apple.com> >+ >+ Fix 'analysis-task-configurator-pane' doesn't update when switch from one analysis task to another. >+ https://bugs.webkit.org/show_bug.cgi?id=197973. >+ >+ Reviewed by NOBODY (OOPS!). >+ The bug was caused by AnalysisTaskConfiguratorPane's setTestGroups not updating the configuration >+ when the commit sets are already set for another analysis task. >+ >+ Expected behavior: If user have modified the configurator, we don't update the configurator; >+ If not, weshould update the configurator when user switch between different test groups. >+ Always update the configurator when user switch between anlaysis tasks. >+ >+ * browser-tests/analysis-task-page-tests.js: Added a analysis task intergation test. >+ * browser-tests/index.html: >+ * browser-tests/mock-data.js: Added a remote API data mock class. >+ (MockData): >+ (MockData.prototype.async._import): Import all need data model. >+ (MockData.prototype.insert): Insert data to local data storage >+ (MockData.prototype.getCopy): Make a copy of provided data, this is because our Data Model will modify the respose json, so each time we should provide a copy. >+ (MockData.prototype.getData): Get data from local data storage, return a id-map >+ (MockData.prototype.filterDataToArray): Filter Data from getted data array. >+ (MockData.prototype.getDataToIdArray): Get data from local data storage, and covert it to an ID array. >+ (MockData.prototype.getDataToArray): Get data from local data storage, and covert it to an value array. >+ (prototype.async.setup): Insert all the mock data, and inject the fake remote api. >+ (prototype._setupData): Insert all mock data. >+ (prototype.response): Simulate a network response >+ (prototype._setupMockRemoteAPI): Inject fake remote api >+ (prototype.Manifest): Inject manifest, and construct them as data model. >+ * public/v3/components/custom-analysis-task-configurator.js: >+ (CustomAnalysisTaskConfigurator): >+ (CustomAnalysisTaskConfigurator.prototype.hasUserModified): Private state mark the configurator has been modified by the user. >+ (CustomAnalysisTaskConfigurator.prototype.resetUserModified): Clean the user modified state. >+ (CustomAnalysisTaskConfigurator.prototype.setCommitSets): >+ (CustomAnalysisTaskConfigurator.prototype._ensurePatchUploader): >+ (CustomAnalysisTaskConfigurator.prototype._buildRevisionInput): >+ * public/v3/components/custom-configuration-test-group-form.js: >+ (CustomConfigurationTestGroupForm.prototype.setConfigurations): >+ (CustomConfigurationTestGroupForm.prototype.resetUserModified): Clean the user modified state. >+ * public/v3/pages/analysis-task-page.js: >+ (AnalysisTaskConfiguratorPane): >+ (AnalysisTaskConfiguratorPane.prototype._compareTestGroups): >+ (AnalysisTaskConfiguratorPane.prototype.setTestGroups): >+ > 2019-06-17 Dewei Zhu <dewei_zhu@apple.com> > > Customizable test group form should allow user to supply a revision prefix of a commit and revision starts with 'r'. >Index: Websites/perf.webkit.org/browser-tests/analysis-task-page-tests.js >=================================================================== >--- Websites/perf.webkit.org/browser-tests/analysis-task-page-tests.js (nonexistent) >+++ Websites/perf.webkit.org/browser-tests/analysis-task-page-tests.js (working copy) >@@ -0,0 +1,176 @@ >+describe('AnalysisTaskPage', () => { >+ >+ const scripts = ['instrumentation.js', '../shared/common-component-base.js', 'components/base.js', 'components/editable-text.js', >+ 'components/test-group-form.js', 'components/chart-styles.js', 'components/commit-log-viewer.js', 'components/time-series-chart.js', >+ 'components/interactive-time-series-chart.js', 'components/chart-revision-range.js', 'pages/chart-pane-status-view.js', >+ 'components/chart-status-evaluator.js', '../shared/statistics.js', 'components/chart-pane-base.js', 'components/mutable-list-view.js', >+ 'components/bar-graph-group.js', 'components/test-group-revision-table.js', 'components/test-group-results-viewer.js', 'components/results-table.js', >+ 'components/custom-configuration-test-group-form.js', 'components/customizable-test-group-form.js', 'components/custom-analysis-task-configurator.js', >+ 'components/instant-file-uploader.js', 'components/analysis-task-bug-list.js', 'components/analysis-results-viewer.js', 'lazily-evaluated-function.js', >+ 'pages/page.js', 'pages/page-with-heading.js', 'pages/page-router.js', 'pages/charts-page.js', 'pages/chart-pane.js', 'pages/heading.js', >+ 'pages/toolbar.js', 'pages/domain-control-toolbar.js', 'pages/dashboard-toolbar.js', 'pages/analysis-task-page.js']; >+ >+ >+ >+ async function importScripts(context) { >+ return await context.importScripts(scripts, 'ComponentBase', 'Heading', 'PageRouter', 'DashboardToolbar','AnalysisTaskPage', 'AnalysisTaskConfiguratorPane'); >+ } >+ >+ function createAnalysisTaskPage(context) { >+ const router = new context.symbols.PageRouter; >+ const page = new context.symbols.AnalysisTaskPage; >+ const heading = new context.symbols.Heading; >+ heading.setToolbar(new context.symbols.DashboardToolbar); >+ page.setHeading(heading); >+ page.setRouter(router); >+ context.document.body.appendChild(page.element()); >+ return page; >+ } >+ >+ it("should change task configurator content when switch between differnt task", async () => { >+ const context = new BrowsingContext; >+ await importScripts(context); >+ const mockData = new ModelV3MockData(context); >+ await mockData.setup(); >+ mockData.Manifest(); >+ const page = createAnalysisTaskPage(context); >+ page.updateFromSerializedState({remainingRoute: mockData.someAnalysisTaskId()}, false); >+ page.enqueueToRender(); >+ await waitForComponentsToRender(context); >+ // Wait for the RemoteAPI triggered. >+ await wait(0); >+ const taskConfiguratorPane = page.part('configurator-pane'); >+ const configurator = taskConfiguratorPane.part('form').part('configurator'); >+ const testGroup1 = context.symbols.TestGroup.findById(mockData.someTestGroupId()); >+ const webkitRepo = context.symbols.Repository.findById(mockData.webkitRepositoryId()); >+ let commitSets = testGroup1.requestedCommitSets(); >+ expect(configurator.platform()).to.be(testGroup1.platform()); >+ expect(configurator.tests().length).to.be(1); >+ expect(configurator.tests()[0]).to.be(testGroup1.test()); >+ expect(configurator.commitSets()[0].revisionForRepository(webkitRepo)).to.be(commitSets[0].revisionForRepository(webkitRepo)); >+ expect(configurator.commitSets()[1].revisionForRepository(webkitRepo)).to.be(commitSets[1].revisionForRepository(webkitRepo)); >+ >+ // Switch to a differnt Task >+ page.updateFromSerializedState({remainingRoute: mockData.otherAnalysisTaskId()}, false); >+ page.enqueueToRender(); >+ await waitForComponentsToRender(context); >+ const testGroup2 = context.symbols.TestGroup.findById(mockData.otherTestGroupId()); >+ const testGroup3 = context.symbols.TestGroup.findById(mockData.anotherTestGroupId()); >+ const jscRepo = context.symbols.Repository.findById(mockData.jscRepositoryId()); >+ commitSets = testGroup3.requestedCommitSets(); >+ expect(configurator.platform()).to.be(testGroup3.platform()); >+ expect(configurator.tests().length).to.be(1); >+ expect(configurator.tests()[0]).to.be(testGroup3.test()); >+ expect(configurator.commitSets()[0].revisionForRepository(jscRepo)).to.be(commitSets[0].revisionForRepository(jscRepo)); >+ expect(configurator.commitSets()[1].revisionForRepository(jscRepo)).to.be(commitSets[1].revisionForRepository(jscRepo)); >+ }); >+ >+ it("should change task configurator content when switch between different testGroup and user haven't modified the configurator", async () => { >+ const context = new BrowsingContext; >+ await importScripts(context); >+ const mockData = new ModelV3MockData(context); >+ await mockData.setup(); >+ mockData.Manifest(); >+ const page = createAnalysisTaskPage(context); >+ page.updateFromSerializedState({remainingRoute: mockData.otherAnalysisTaskId()}, false); >+ page.enqueueToRender(); >+ await waitForComponentsToRender(context); >+ // Wait for the RemoteAPI triggered. Task page enqueueToRender sub components when it get data from remote API >+ await wait(0); >+ const taskConfiguratorPane = page.part('configurator-pane'); >+ const configurator = taskConfiguratorPane.part('form').part('configurator'); >+ const sharedRepo = context.symbols.Repository.findById(mockData.sharedRepositoryId()); >+ const jscRepo = context.symbols.Repository.findById(mockData.jscRepositoryId()); >+ const testGroup2 = context.symbols.TestGroup.findById(mockData.otherTestGroupId()); >+ const testGroup3 = context.symbols.TestGroup.findById(mockData.anotherTestGroupId()); >+ let commitSets = testGroup3.requestedCommitSets(); >+ expect(configurator.tests().length).to.be(1); >+ expect(configurator.tests()[0]).to.be(testGroup3.test()); >+ expect(configurator.commitSets()[0].revisionForRepository(sharedRepo)).to.be(commitSets[0].revisionForRepository(sharedRepo)); >+ expect(configurator.commitSets()[1].revisionForRepository(sharedRepo)).to.be(commitSets[1].revisionForRepository(sharedRepo)); >+ >+ const testGroupList = page.part('group-pane').content('test-group-list'); >+ // User change test group selection >+ // <li> => <a> >+ testGroupList.children[1].children[0].click(); >+ await waitForComponentsToRender(context); >+ commitSets = testGroup2.requestedCommitSets(); >+ expect(configurator.tests().length).to.be(1); >+ expect(configurator.tests()[0]).to.be(testGroup2.test()); >+ expect(configurator.commitSets()[0].revisionForRepository(jscRepo)).to.be(commitSets[0].revisionForRepository(jscRepo)); >+ expect(configurator.commitSets()[1].revisionForRepository(jscRepo)).to.be(commitSets[1].revisionForRepository(jscRepo)); >+ }); >+ >+ it("should not change task configurator when user have already changed configurator contents", async () => { >+ const context = new BrowsingContext; >+ await importScripts(context); >+ const mockData = new ModelV3MockData(context); >+ await mockData.setup(); >+ mockData.Manifest(); >+ const page = createAnalysisTaskPage(context); >+ page.updateFromSerializedState({remainingRoute: mockData.otherAnalysisTaskId()}, false); >+ page.enqueueToRender(); >+ await waitForComponentsToRender(context); >+ // Wait for the RemoteAPI triggered. Task page enqueueToRender sub components when it get data from remote API >+ await wait(0); >+ const taskConfiguratorPane = page.part('configurator-pane'); >+ const configurator = taskConfiguratorPane.part('form').part('configurator'); >+ const webkitRepo = context.symbols.Repository.findById(mockData.webkitRepositoryId()); >+ const sharedRepo = context.symbols.Repository.findById(mockData.sharedRepositoryId()); >+ const jscRepo = context.symbols.Repository.findById(mockData.jscRepositoryId()); >+ const testGroup2 = context.symbols.TestGroup.findById(mockData.otherTestGroupId()); >+ const testGroup3 = context.symbols.TestGroup.findById(mockData.anotherTestGroupId()); >+ const test1 = context.symbols.Test.findById(mockData.someTestId()); >+ let commitSets = testGroup3.requestedCommitSets(); >+ expect(configurator.tests().length).to.be(1); >+ expect(configurator.tests()[0]).to.be(testGroup3.test()); >+ expect(configurator.commitSets()[0].revisionForRepository(sharedRepo)).to.be(commitSets[0].revisionForRepository(sharedRepo)); >+ expect(configurator.commitSets()[1].revisionForRepository(sharedRepo)).to.be(commitSets[1].revisionForRepository(sharedRepo)); >+ // User modify test selection: >+ // Another test => some test >+ // <li> => <label> => <input> >+ configurator.content('test-list').children[0].children[0].click(); >+ await waitForComponentsToRender(context); >+ expect(configurator.tests().length).to.be(1); >+ expect(configurator.tests()[0]).to.be(test1); >+ expect(configurator.platform()).to.be(null); >+ // User change test group selection >+ // <li> => <a> >+ page.part('group-pane').content('test-group-list').children[1].children[0].click(); >+ await waitForComponentsToRender(context); >+ // Expected nothing changed >+ expect(configurator.tests().length).to.be(1); >+ expect(configurator.tests()[0]).to.be(test1); >+ expect(configurator.platform()).to.be(null); >+ >+ // Nav to other task, configurator should be updated >+ page.updateFromSerializedState({remainingRoute: mockData.someAnalysisTaskId()}, false); >+ page.enqueueToRender(); >+ await waitForComponentsToRender(context); >+ const testGroup1 = context.symbols.TestGroup.findById(mockData.someTestGroupId()); >+ expect(configurator.tests().length).to.be(1); >+ expect(configurator.tests()[0]).to.be(testGroup1.test()); >+ expect(configurator.platform()).to.be(testGroup1.platform()); >+ commitSets = testGroup1.requestedCommitSets(); >+ expect(configurator.commitSets()[0].revisionForRepository(webkitRepo)).to.be(commitSets[0].revisionForRepository(webkitRepo)); >+ expect(configurator.commitSets()[1].revisionForRepository(webkitRepo)).to.be(commitSets[1].revisionForRepository(webkitRepo)); >+ >+ page.updateFromSerializedState({remainingRoute: mockData.otherAnalysisTaskId()}, false); >+ page.enqueueToRender(); >+ await waitForComponentsToRender(context); >+ // User modify revisions >+ const input = configurator.content('baseline-revision-table').querySelector('input'); >+ input.value += 'modified'; >+ input.dispatchEvent(new Event('input')); >+ // User change test group selection >+ // <li> => <a> >+ page.part('group-pane').content('test-group-list').children[1].children[0].click(); >+ await waitForComponentsToRender(context); >+ expect(configurator.tests().length).to.be(1); >+ expect(configurator.tests()[0]).to.be(testGroup3.test()); >+ expect(configurator.platform()).to.be(testGroup3.platform()); >+ commitSets = testGroup3.requestedCommitSets(); >+ expect(configurator.commitSets()[0].revisionForRepository(sharedRepo)).to.be(commitSets[0].revisionForRepository(sharedRepo)); >+ expect(configurator.commitSets()[1].revisionForRepository(sharedRepo)).to.be(commitSets[1].revisionForRepository(sharedRepo)); >+ }); >+}); >Index: Websites/perf.webkit.org/browser-tests/index.html >=================================================================== >--- Websites/perf.webkit.org/browser-tests/index.html (revision 246652) >+++ Websites/perf.webkit.org/browser-tests/index.html (working copy) >@@ -15,6 +15,7 @@ mocha.setup('bdd'); > </head> > <body> > <div id="mocha"></div> >+<script src="mock-data.js"></script> > <script src="async-task-tests.js"></script> > <script src="component-base-tests.js"></script> > <script src="page-tests.js"></script> >@@ -31,6 +32,7 @@ mocha.setup('bdd'); > <script src="customizable-test-group-form-tests.js"></script> > <script src="markup-page-tests.js"></script> > <script src="test-group-result-page-tests.js"></script> >+<script src="analysis-task-page-tests.js"></script> > <script> > > afterEach(() => { >Index: Websites/perf.webkit.org/browser-tests/mock-data.js >=================================================================== >--- Websites/perf.webkit.org/browser-tests/mock-data.js (nonexistent) >+++ Websites/perf.webkit.org/browser-tests/mock-data.js (working copy) >@@ -0,0 +1,327 @@ >+const RELATIONSHIP = Object.freeze({ >+ hasMany: Symbol("hasMany"), >+ hasOne: Symbol("hasOne") >+}); >+ >+const ModelV3Files = [ >+ 'models/data-model.js', >+ 'models/analysis-task.js', >+ 'models/analysis-results.js', >+ 'models/bug.js', >+ 'models/bug-tracker.js', >+ 'models/build-request.js', >+ 'models/builder.js', >+ 'models/commit-set.js', >+ 'models/commit-log.js', >+ 'models/manifest.js', >+ 'models/measurement-adaptor.js', >+ 'models/measurement-cluster.js', >+ 'models/measurement-set.js', >+ 'models/metric.js', >+ 'models/platform.js', >+ 'models/repository.js', >+ 'models/test.js', >+ 'models/test-group.js', >+ 'models/time-series.js', >+ 'models/triggerable.js', >+ 'models/uploaded-file.js', >+]; >+ >+const ModelV3Symbol = [ >+ 'DataModelObject', >+ 'LabeledObject', >+ 'AnalysisTask', >+ 'AnalysisResults', >+ 'Bug', >+ 'BugTracker', >+ 'BuildRequest', >+ 'Build', >+ 'Builder', >+ 'CommitLog', >+ 'Manifest', >+ 'MeasurementAdaptor', >+ 'MeasurementCluster', >+ 'MeasurementSet', >+ 'Metric', >+ 'Platform', >+ 'Repository', >+ 'MeasurementCommitSet', >+ 'CommitSet', >+ 'CustomCommitSet', >+ 'IntermediateCommitSet', >+ 'Test', >+ 'TestGroup', >+ 'TimeSeries', >+ 'Triggerable', >+ 'TriggerableRepositoryGroup', >+ 'UploadedFile', >+]; >+ >+class MockData { >+ constructor (context, files, symbols) { >+ this._context = context; >+ this._data = {}; >+ this._files = files; >+ this._symbols = symbols; >+ } >+ async _import() { >+ await this._context.importScripts(this._files, ...this._symbols); >+ } >+ insert(name, data) { >+ if (false === name in this._data) >+ this._data[name] = {}; >+ this._data[name][data.id] = data; >+ } >+ getCopy(obj) { >+ return JSON.parse(JSON.stringify(obj)); >+ } >+ getData(name, id) { >+ console.assert(name in this._data); >+ let res = this.getCopy(this._data[name]); >+ if (id) { >+ // the model will modify the raw data, return a copy instead >+ res = this.getCopy(this._data[name][id]); >+ } >+ return res; >+ } >+ filterDataToArray(name, id, filterFunc) { >+ return this.getDataToArray().fitler(filterFunc); >+ } >+ getDataToIdArray(name) { >+ console.assert(name in this._data); >+ return Object.keys(this._data[name]); >+ } >+ getDataToArray(name) { >+ console.assert(name in this._data); >+ return this.getDataToIdArray(name).map(id => this.getCopy(this._data[name][id])); >+ } >+} >+ >+class ModelV3MockData extends MockData { >+ constructor (context) { >+ super(context, ModelV3Files, ModelV3Symbol); >+ } >+ async setup() { >+ await this._import(); >+ this._setupData(); >+ this._setupMockRemoteAPI(); >+ } >+ emptyTriggeragbleId() { return 1001; } >+ someTestId() { return 200; } >+ otherTestId() { return 201; } >+ anotherTestId() { return 202; } >+ somePlatformId() { return 65; } >+ otherPlatformId() { return 101; } >+ someMetricId() { return 300; } >+ macosRepositoryId() { return 9; } >+ webkitRepositoryId() { return 11; } >+ ownedJSCRepositoryId() { return 213; } >+ jscRepositoryId() { return 222; } >+ gitWebkitRepositoryId() { return 111; } >+ sharedRepositoryId() { return 14; } >+ someAnalysisTaskId() { return 500; } >+ otherAnalysisTaskId() { return 501; } >+ someTestGroupId() {return 600; } >+ otherTestGroupId() {return 601; } >+ anotherTestGroupId() {return 602; } >+ >+ _setupData() { >+ this.insert('builders', {id: 1, name: "some builder"}), >+ this.insert('repositories', {id: this.macosRepositoryId(), name: 'macOS'}); >+ this.insert('repositories', {id: this.webkitRepositoryId(), name: 'WebKit'}); >+ this.insert('repositories', {id: this.sharedRepositoryId(), name: 'Shared'}); >+ this.insert('repositories', {id: this.ownedJSCRepositoryId(), owner: this.webkitRepositoryId(), name: 'JavaScriptCore'}); >+ this.insert('repositories', {id: this.jscRepositoryId(), name: 'JavaScriptCore'}); >+ this.insert('repositoryGroups', {id: 2001, name: 'webkit-svn', acceptsCustomRoots: false, repositories: [ >+ {repository: this.macosRepositoryId(), acceptsPatch: false}, >+ {repository: this.webkitRepositoryId(), acceptsPatch: false} >+ ]}); >+ this.insert('repositoryGroups', {id: 2002, name: 'shared-svn', acceptsCustomRoots: false, repositories: [ >+ {repository: this.macosRepositoryId(), acceptsPatch: false}, >+ {repository: this.sharedRepositoryId(), acceptsPatch: false} >+ ]}); >+ this.insert('repositoryGroups', {id: 2003, name: 'jsc-svn', acceptsCustomRoots: false, repositories: [ >+ {repository: this.macosRepositoryId(), acceptsPatch: false}, >+ {repository: this.jscRepositoryId(), acceptsPatch: false} >+ ]}); >+ this.insert('triggerables', { >+ id: 1000, name: 'build-webkit', >+ acceptedRepositories: [this.macosRepositoryId(), this.webkitRepositoryId()], >+ configurations:[ >+ [this.someTestId(), this.somePlatformId()], >+ [this.otherTestId(), this.otherPlatformId()], >+ [this.anotherTestId(), this.otherPlatformId()] >+ ], >+ repositoryGroups: [ >+ this.getData('repositoryGroups', 2001), >+ this.getData('repositoryGroups', 2002), >+ this.getData('repositoryGroups', 2003)] >+ }); >+ this.insert('metrics', {id: this.someMetricId(), test: this.someTestId(), name: 'some metric'}); >+ this.insert('platforms', {id: this.somePlatformId(), name: 'some platform', metrics: [300], lastModified: [1516988335564]}); >+ this.insert('platforms', {id: this.otherPlatformId(), name: 'other platform', metrics: [300], lastModified: [1516988335564]}); >+ this.insert('tests', {id: this.someTestId(), name: 'some test'}); >+ this.insert('tests', {id: this.otherTestId(), name: 'other test'}); >+ this.insert('tests', {id: this.anotherTestId(), name: 'another test'}); >+ this.insert('bugTrackers', {id: 1, name: "some tracker", bugUrl: "https://some/bug/tracker/$numebr", newBugUrl: "https://some/bug/tracker/$numebr", repositories:[this.webkitRepositoryId()]}), >+ this.insert('bugTrackers', {id: 2, name: "other tracker", bugUrl: "https://other/bug/tracker/$numebr", newBugUrl: "https://other/bug/tracker/$numebr", repositories:[this.macosRepositoryId()]}), >+ this.insert('commits', {id: 87832, repository: this.macosRepositoryId(), revision: '10.11 15A284', time: new Date('2016-03-02T23:17:54.3Z').getTime()}); >+ this.insert('commits', {id: 93116, repository: this.webkitRepositoryId(), revision: '191622', time: 1445945816878}); >+ this.insert('commits', {id: 96336, repository: this.webkitRepositoryId(), revision: '192736', time: 1448225325650}); >+ this.insert('commits', {id: 111168, repository: this.sharedRepositoryId(), revision: '80229', time: new Date('2016-03-02T23:17:54.3Z').getTime()}); >+ this.insert('commits', {id: 111169, repository: this.sharedRepositoryId(), revision: '80230', time: new Date('2016-03-02T23:37:18.0Z').getTime()}); >+ this.insert('commits', {id: 11797, repository: this.jscRepositoryId(), revision: 'jsc-6161', time: new Date('2016-03-02T23:19:55.3Z').getTime()}); >+ this.insert('commits', {id: 12017, repository: this.jscRepositoryId(), revision: 'jsc-9191', time: new Date('2016-05-02T23:13:57.1Z').getTime()}); >+ this.insert('commits', {id: 1797, repository: this.ownedJSCRepositoryId(), revision: 'owned-jsc-6161', time: new Date('2016-03-02T23:19:55.3Z').getTime()}); >+ this.insert('commits', {id: 2017, repository: this.ownedJSCRepositoryId(), revision: 'owned-jsc-9191', time: new Date('2016-05-02T23:13:57.1Z').getTime()}); >+ this.insert('commitSets', {id: 401, customRoots: [], revisionItems: [{commit: 87832}, {commit: 93116}]}); >+ this.insert('commitSets', {id: 402, customRoots: [], revisionItems: [{commit: 87832}, {commit: 96336}]}); >+ this.insert('buildRequests', {id: 700, status: "completed", triggerable: 1000, repositoryGroup: 2001, platform: this.somePlatformId(), test: this.someTestId(), testGroup: this.someTestGroupId(), order: 0, commitSet: 401}); >+ this.insert('buildRequests', {id: 701, status: "completed", triggerable: 1000, repositoryGroup: 2001, platform: this.somePlatformId(), test: this.someTestId(), testGroup: this.someTestGroupId(), order: 1, commitSet: 402}); >+ this.insert('buildRequests', {id: 702, status: "completed", triggerable: 1000, repositoryGroup: 2001, platform: this.somePlatformId(), test: this.someTestId(), testGroup: this.someTestGroupId(), order: 2, commitSet: 401}); >+ this.insert('buildRequests', {id: 703, status: "completed", triggerable: 1000, repositoryGroup: 2001, platform: this.somePlatformId(), test: this.someTestId(), testGroup: this.someTestGroupId(), order: 3, commitSet: 402}); >+ this.insert('analysisTasks', {id: this.someAnalysisTaskId(), platform: this.somePlatformId(), metric: 300, name: 'some task', author: 'someone', >+ startRun: 801, startRunTime: new Date('2015-10-27T12:05:27.1Z').getTime(), createdAt: new Date('2015-10-27T12:05:27.1Z').getTime(), >+ endRun: 801, endRunTime: new Date('2015-10-27T13:05:27.1Z').getTime(), causes: [], fixes: []}); >+ this.insert('testGroups', {id: this.someTestGroupId(), task: this.someAnalysisTaskId(), name: 'some test group', >+ initialRepetitionCount: 4, needsNotification: true, platform: this.somePlatformId(), >+ buildRequests: [700, 701, 702, 703], >+ commitSet: [401, 402, 401, 402], >+ createdAt: new Date('2015-10-27T12:05:27.1Z').getTime(), >+ }); >+ this.insert('commitSets', {id: 501, customRoots: [], revisionItems: [{commit: 87832}, {commit: 111168}]}); >+ this.insert('commitSets', {id: 502, customRoots: [], revisionItems: [{commit: 87832}, {commit: 111169}]}); >+ this.insert('commitSets', {id: 601, customRoots: [], revisionItems: [{commit: 87832}, {commit: 11797}]}); >+ this.insert('commitSets', {id: 602, customRoots: [], revisionItems: [{commit: 87832}, {commit: 12017}]}); >+ this.insert('buildRequests', {id: 800, status: "completed", triggerable: 1000, repositoryGroup: 2002, platform: this.otherPlatformId(), test: this.otherTestId(), testGroup: this.otherTestGroupId(), order: 0, commitSet: 501}); >+ this.insert('buildRequests', {id: 801, status: "completed", triggerable: 1000, repositoryGroup: 2002, platform: this.otherPlatformId(), test: this.otherTestId(), testGroup: this.otherTestGroupId(), order: 1, commitSet: 502}); >+ this.insert('buildRequests', {id: 802, status: "completed", triggerable: 1000, repositoryGroup: 2002, platform: this.otherPlatformId(), test: this.otherTestId(), testGroup: this.otherTestGroupId(), order: 2, commitSet: 501}); >+ this.insert('buildRequests', {id: 803, status: "completed", triggerable: 1000, repositoryGroup: 2002, platform: this.otherPlatformId(), test: this.otherTestId(), testGroup: this.otherTestGroupId(), order: 3, commitSet: 502}); >+ this.insert('buildRequests', {id: 900, status: "completed", triggerable: 1000, repositoryGroup: 2003, platform: this.otherPlatformId(), test: this.anotherTestId(), testGroup: this.anotherTestGroupId(), order: 0, commitSet: 601}); >+ this.insert('buildRequests', {id: 901, status: "completed", triggerable: 1000, repositoryGroup: 2003, platform: this.otherPlatformId(), test: this.anotherTestId(), testGroup: this.anotherTestGroupId(), order: 1, commitSet: 602}); >+ this.insert('buildRequests', {id: 902, status: "completed", triggerable: 1000, repositoryGroup: 2003, platform: this.otherPlatformId(), test: this.anotherTestId(), testGroup: this.anotherTestGroupId(), order: 2, commitSet: 601}); >+ this.insert('buildRequests', {id: 903, status: "completed", triggerable: 1000, repositoryGroup: 2003, platform: this.otherPlatformId(), test: this.anotherTestId(), testGroup: this.anotherTestGroupId(), order: 3, commitSet: 602}); >+ this.insert('analysisTasks', {id: this.otherAnalysisTaskId(), platform: this.otherPlatformId(), metric: 300, name: 'some task1', author: 'someone', >+ startRun: 801, startRunTime: new Date('2015-10-28T12:05:27.1Z').getTime(), createdAt: new Date('2015-10-28T12:05:27.1Z').getTime(), >+ endRun: 801, endRunTime: new Date('2015-10-28T13:05:27.1Z').getTime(), causes: [], fixes: []}); >+ this.insert('testGroups', {id: this.otherTestGroupId(), task: this.otherAnalysisTaskId(), name: 'some test group1', >+ initialRepetitionCount: 4, needsNotification: true, mayNeedMoreRequests: false, hidden: false, platform: this.otherPlatformId(), >+ buildRequests: [800, 801, 802, 803], >+ commitSet: [501, 502, 501, 502], >+ createdAt: new Date('2015-10-28T12:05:27.1Z').getTime(), >+ }); >+ this.insert('testGroups', {id: this.anotherTestGroupId(), task: this.otherAnalysisTaskId(), name: 'some test group2', >+ initialRepetitionCount: 4, needsNotification: true, mayNeedMoreRequests: false, hidden: false, platform: this.otherPlatformId(), >+ buildRequests: [900, 901, 902, 903], >+ commitSet: [601, 602, 601, 602], >+ createdAt: new Date('2015-10-28T13:05:27.1Z').getTime(), >+ }); >+ } >+ >+ response(object) { >+ return new Promise(resolve => setTimeout(() => resolve(object), 0)); >+ } >+ >+ _setupMockRemoteAPI() { >+ this._context.iframe.contentWindow.RemoteAPI = { >+ getJSONWithStatus: (path) => { >+ const [url, paramsString] = path.split('?'); >+ const params = {}; >+ if (paramsString) { >+ paramsString.split('&').forEach(item => { >+ const [key, value] = item.split('='); >+ params[key] = value; >+ }); >+ } >+ if ('/api/analysis-tasks' === url) { >+ return this.response({ >+ bugs:[], >+ analysisTasks: this.getDataToArray('analysisTasks'), >+ commits: this.getDataToArray('commits'), >+ }); >+ } else if ('/api/test-groups' === url) { >+ let testGroups = this.getDataToArray('testGroups'); >+ let buildRequests = this.getDataToArray('buildRequests'); >+ if (params['task']) { >+ testGroups = testGroups.filter((item) => item.task === parseInt(params['task'])); >+ buildRequests = buildRequests.filter((item) => testGroups.reduce((accumulator, testGroup) => { >+ return accumulator || item.testGroup === testGroup.id; >+ }, false)); >+ } >+ return this.response({ >+ buildRequests: buildRequests, >+ commitSets: this.getDataToArray('commitSets'), >+ commits: this.getDataToArray('commits'), >+ testGroups: testGroups, >+ uploadedFiles: [] >+ }); >+ } else if ('/api/measurement-set' === url && params['analysisTask']) { >+ return this.response({ >+ formatMap: [ >+ "id", "mean", "iterationCount", "sum", "metric", "configType", "revisions" >+ ], >+ measurements: [ >+ [1, 1658.566313982, 20, 33171.32627964, this.someMetricId(), "current",[ >+ // [<commit-id>, <repository-id>, <revision>, <order>, <time>] >+ [87832, this.getData('commits', 87832).repository, this.getData('commits', 87832).revision, null, this.getData('commits', 87832).time], >+ [96336, this.getData('commits', 96336).repository, this.getData('commits', 96336).revision, null, this.getData('commits', 96336).time], >+ [111168, this.getData('commits', 111168).repository, this.getData('commits', 111168).revision, null, this.getData('commits', 111168).time], >+ [111169, this.getData('commits', 111169).repository, this.getData('commits', 111169).revision, null, this.getData('commits', 111169).time], >+ [93116, this.getData('commits', 93116).repository, this.getData('commits', 93116).revision, null, this.getData('commits', 87832).time] >+ ]] >+ ], >+ status: "OK", >+ elapsedTime: 3600, >+ }); >+ } else if (url.indexOf('/data/measurement-set') !== -1 || '/api/measurement-set' === url) { >+ return this.response({ >+ formatMap: [ >+ "id", "mean", "iterationCount", "sum", "revisions" >+ ], >+ configurations: { >+ current: [ >+ [1, 1658.566313982, 20, 33171.32627964, [ >+ // [<commit-id>, <repository-id>, <revision>, <order>, <time>] >+ [87832, this.getData('commits', 87832).repository, this.getData('commits', 87832).revision, null, this.getData('commits', 87832).time], >+ [96336, this.getData('commits', 96336).repository, this.getData('commits', 96336).revision, null, this.getData('commits', 96336).time], >+ [111168, this.getData('commits', 111168).repository, this.getData('commits', 111168).revision, null, this.getData('commits', 111168).time], >+ [111169, this.getData('commits', 111169).repository, this.getData('commits', 111169).revision, null, this.getData('commits', 111169).time], >+ [93116, this.getData('commits', 93116).repository, this.getData('commits', 93116).revision, null, this.getData('commits', 87832).time], >+ ]], >+ ], >+ }, >+ startTime: new Date('2015-10-28T12:05:27.1Z').getTime(), >+ endTime: new Date('2015-10-28T13:05:27.1Z').getTime(), >+ lastModified: 1516988335564, >+ clusterCount: 1, >+ clusterStart: 946684800000, >+ clusterSize: 5184000000, >+ status: "OK", >+ elapsedTime: 3600, >+ }); >+ } else { >+ console.error('Unmocked URL:' + url); >+ return this.response({}); >+ } >+ } >+ }; >+ } >+ >+ // Inject mainfest data and construct the data model >+ Manifest() { >+ this._context.symbols.Manifest._didFetchManifest({ >+ all: this.getData("platforms"), >+ buidlers: this.getData("builders"), >+ bugTrackers: this.getData("bugTrackers"), >+ tests: this.getData("tests"), >+ repositories: this.getData("repositories"), >+ triggerables: this.getData("triggerables"), >+ metrics: this.getData("metrics"), >+ summaryPages: [], >+ testAgeToleranceInHours: null, >+ siteTitle: 'Test', >+ fileUploadSizeLimit: 838860800, >+ elapsedTime: 10, >+ }); >+ } >+} >Index: Websites/perf.webkit.org/public/v3/components/custom-analysis-task-configurator.js >=================================================================== >--- Websites/perf.webkit.org/public/v3/components/custom-analysis-task-configurator.js (revision 246652) >+++ Websites/perf.webkit.org/public/v3/components/custom-analysis-task-configurator.js (working copy) >@@ -20,8 +20,10 @@ class CustomAnalysisTaskConfigurator ext > this._renderTriggerableTestsLazily = new LazilyEvaluatedFunction(this._renderTriggerableTests.bind(this)); > this._renderTriggerablePlatformsLazily = new LazilyEvaluatedFunction(this._renderTriggerablePlatforms.bind(this)); > this._renderRepositoryPanesLazily = new LazilyEvaluatedFunction(this._renderRepositoryPanes.bind(this)); >+ this._userModified = false; > } >- >+ hasUserModified() { return this._userModified; } >+ resetUserModified() { this._userModified = false; } > tests() { return this._selectedTests; } > platform() { return this._selectedPlatform; } > commitSets() >@@ -92,7 +94,7 @@ class CustomAnalysisTaskConfigurator ext > this._setPatchFiles('Baseline', baselineCommitSet); > } > >- const comparisonRepositoryGroup = triggerable.repositoryGroups().find((repositoryGroup) => repositoryGroup.accepts(baselineCommitSet)); >+ const comparisonRepositoryGroup = triggerable.repositoryGroups().find((repositoryGroup) => repositoryGroup.accepts(comparisonCommitSet)); > if (comparisonRepositoryGroup) { > this._repositoryGroupByConfiguration['Comparison'] = comparisonRepositoryGroup; > this._setUploadedFilesToUploader(this._customRootUploaders['Comparison'], comparisonCommitSet.customRoots()); >@@ -160,8 +162,12 @@ class CustomAnalysisTaskConfigurator ext > > uploader = new InstantFileUploader; > uploader.element().textContent = 'Apply a patch'; >- uploader.listenToAction('uploadedFile', () => this._updateCommitSetMap()); >- uploader.listenToAction('removedFile', () => this._updateCommitSetMap()); >+ const fileUploaderEventHandler = () => { >+ this._updateCommitSetMap(); >+ this._userModified = true; >+ }; >+ uploader.listenToAction('uploadedFile', fileUploaderEventHandler); >+ uploader.listenToAction('removedFile', fileUploaderEventHandler); > uploaderMap.set(repository, uploader); > > return uploader; >@@ -264,6 +270,7 @@ class CustomAnalysisTaskConfigurator ext > checkSelectedRadioButtons(listItems.filter((item) => item.radioButton.checked)); > callback(selectedListItems.map((item) => item.object)); > this.enqueueToRender(); >+ this._userModified = true; > }}); > const label = element('label', [radioButton, labelForObject(object)]); > listItems.push({radioButton, label, object}); >@@ -583,6 +590,7 @@ class CustomAnalysisTaskConfigurator ext > unmodifiedInput = null; > const revisionToFetch = input.value; > this._specifiedRevisions[configurationName].set(repository, revisionToFetch); >+ this._userModified = true; > this._updateCommitSetMap(); > if (scheduledUpdate) > clearTimeout(scheduledUpdate); >Index: Websites/perf.webkit.org/public/v3/components/custom-configuration-test-group-form.js >=================================================================== >--- Websites/perf.webkit.org/public/v3/components/custom-configuration-test-group-form.js (revision 246652) >+++ Websites/perf.webkit.org/public/v3/components/custom-configuration-test-group-form.js (working copy) >@@ -22,6 +22,9 @@ class CustomConfigurationTestGroupForm e > setConfigurations(test, platform, repetitionCount, commitSets) > { > const configurator = this.part('configurator'); >+ if (configurator.hasUserModified()) { >+ return; >+ } > configurator.selectTests([test]); > configurator.selectPlatform(platform); > if (commitSets.length == 2) >@@ -30,6 +33,11 @@ class CustomConfigurationTestGroupForm e > this.enqueueToRender(); > } > >+ resetUserModified() { >+ const configurator = this.part('configurator'); >+ configurator.resetUserModified(); >+ } >+ > startTesting() > { > const taskName = this.content('task-name').value; >Index: Websites/perf.webkit.org/public/v3/pages/analysis-task-page.js >=================================================================== >--- Websites/perf.webkit.org/public/v3/pages/analysis-task-page.js (revision 246652) >+++ Websites/perf.webkit.org/public/v3/pages/analysis-task-page.js (working copy) >@@ -205,6 +205,7 @@ class AnalysisTaskConfiguratorPane exten > { > super('analysis-task-configurator-pane'); > this._currentGroup = null; >+ this._currentTestGroups = null; > } > > didConstructShadowTree() >@@ -216,12 +217,34 @@ class AnalysisTaskConfiguratorPane exten > }); > } > >+ _compareTestGroups(testGroups) { >+ if (!this._currentTestGroups) { >+ return false; >+ } >+ if (this._currentTestGroups.length !== testGroups.length) { >+ return false; >+ } >+ for (let i = 0; i < testGroups.length; i++) { >+ if (testGroups[i].id() !== this._currentTestGroups[i].id()) { >+ return false; >+ } >+ } >+ return true; >+ } >+ > setTestGroups(testGroups, currentGroup) > { >- this._currentGroup = currentGroup; > const form = this.part('form'); >- if (!form.hasCommitSets() && currentGroup) >- form.setConfigurations(currentGroup.test(), currentGroup.platform(), currentGroup.repetitionCount(), currentGroup.requestedCommitSets()); >+ if (!this._compareTestGroups(testGroups)) { >+ form.resetUserModified(); >+ } >+ if (currentGroup) { >+ if (!this._currentGroup || this._currentGroup.id() !== currentGroup.id()) { >+ form.setConfigurations(currentGroup.test(), currentGroup.platform(), currentGroup.repetitionCount(), currentGroup.requestedCommitSets()); >+ } >+ } >+ this._currentGroup = currentGroup; >+ this._currentTestGroups = testGroups; > this.enqueueToRender(); > } >
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 197973
:
370095
|
370325
|
370328
|
370378
|
371537
|
371568
| 372586