Title: [243358] trunk/Websites/perf.webkit.org
Revision
243358
Author
[email protected]
Date
2019-03-21 20:34:28 -0700 (Thu, 21 Mar 2019)

Log Message

'custom-configuration-test-group-form' should update test name when selected test or platform changes.
https://bugs.webkit.org/show_bug.cgi?id=196114

Reviewed by Ryosuke Niwa.

r240104 fixes commit sets unnecessarily get updated even there is no change.
However, this made changing test or platform no longer triggers 'commitSetChange' action.
Test name should change not only when 'commitSet' gets change, but also platform or test changes.
Renaming the action name from 'commitSetChange' to a more accurate description 'testConfigChange'.
Dispatch 'testConfigChange' when platform or test changes.

* browser-tests/custom-analysis-task-configurator-tests.js: Changed action name to 'commitSetChange'.
* public/v3/components/custom-analysis-task-configurator.js:
(CustomAnalysisTaskConfigurator.prototype._didUpdateSelectedPlatforms): Should dispatch 'commitSetChange' action.
(CustomAnalysisTaskConfigurator.prototype._updateCommitSetMap): Changed action name to 'commitSetChange'.
* public/v3/components/custom-configuration-test-group-form.js: Added a unit test for this change.
(CustomConfigurationTestGroupForm.prototype.didConstructShadowTree):

Modified Paths

Diff

Modified: trunk/Websites/perf.webkit.org/ChangeLog (243357 => 243358)


--- trunk/Websites/perf.webkit.org/ChangeLog	2019-03-22 03:00:44 UTC (rev 243357)
+++ trunk/Websites/perf.webkit.org/ChangeLog	2019-03-22 03:34:28 UTC (rev 243358)
@@ -1,3 +1,23 @@
+2019-03-21  Dewei Zhu  <[email protected]>
+
+        'custom-configuration-test-group-form' should update test name when selected test or platform changes.
+        https://bugs.webkit.org/show_bug.cgi?id=196114
+
+        Reviewed by Ryosuke Niwa.
+
+        r240104 fixes commit sets unnecessarily get updated even there is no change.
+        However, this made changing test or platform no longer triggers 'commitSetChange' action.
+        Test name should change not only when 'commitSet' gets change, but also platform or test changes.
+        Renaming the action name from 'commitSetChange' to a more accurate description 'testConfigChange'.
+        Dispatch 'testConfigChange' when platform or test changes.
+
+        * browser-tests/custom-analysis-task-configurator-tests.js: Changed action name to 'commitSetChange'.
+        * public/v3/components/custom-analysis-task-configurator.js:
+        (CustomAnalysisTaskConfigurator.prototype._didUpdateSelectedPlatforms): Should dispatch 'commitSetChange' action.
+        (CustomAnalysisTaskConfigurator.prototype._updateCommitSetMap): Changed action name to 'commitSetChange'.
+        * public/v3/components/custom-configuration-test-group-form.js: Added a unit test for this change.
+        (CustomConfigurationTestGroupForm.prototype.didConstructShadowTree):
+
 2019-03-18  Dewei Zhu  <[email protected]>
 
         Fix a bug from r226303 that latest build time is not correctly calculated.

Modified: trunk/Websites/perf.webkit.org/browser-tests/custom-analysis-task-configurator-tests.js (243357 => 243358)


--- trunk/Websites/perf.webkit.org/browser-tests/custom-analysis-task-configurator-tests.js	2019-03-22 03:00:44 UTC (rev 243357)
+++ trunk/Websites/perf.webkit.org/browser-tests/custom-analysis-task-configurator-tests.js	2019-03-22 03:34:28 UTC (rev 243358)
@@ -231,4 +231,69 @@
         await waitForComponentsToRender(context);
         expect(customAnalysisTaskConfigurator.content('baseline-revision-table').querySelector('input').value).to.be('');
     });
+
+    it('Should dispatch "testConfigChange" action when selected platform changed', async () => {
+        const context = new BrowsingContext();
+        const customAnalysisTaskConfigurator = await createCustomAnalysisTaskConfiguratorWithContext(context);
+        let testConfigChangeActionCount = 0;
+        context.symbols.CustomAnalysisTaskConfigurator.commitFetchInterval = 1;
+
+        customAnalysisTaskConfigurator.listenToAction("testConfigChange", () => testConfigChangeActionCount += 1);
+
+        const test = new context.symbols.Test(1, {name: 'Speedometer'});
+        const mojave = new context.symbols.Platform(1, {
+            name: 'Mojave',
+            metrics: [
+                new context.symbols.Metric(1, {
+                    name: 'Allocation',
+                    aggregator: 'Arithmetic',
+                    test
+                })
+            ],
+            lastModifiedByMetric: Date.now(),
+        });
+        const highSierra = new context.symbols.Platform(2, {
+            name: 'High Sierra',
+            metrics: [
+                new context.symbols.Metric(1, {
+                    name: 'Allocation',
+                    aggregator: 'Arithmetic',
+                    test
+                })
+            ],
+            lastModifiedByMetric: Date.now(),
+        });
+        const repository = context.symbols.Repository.ensureSingleton(1, {name: 'WebKit'});
+        const triggerableRepositoryGroup = new context.symbols.TriggerableRepositoryGroup(1, {repositories: [{repository}]});
+        new context.symbols.Triggerable(1, {
+            name: 'test-triggerable',
+            isDisabled: false,
+            repositoryGroups: [triggerableRepositoryGroup],
+            configurations: [{test, platform: mojave}, {test, platform: highSierra}],
+        });
+        customAnalysisTaskConfigurator.selectTests([test]);
+        customAnalysisTaskConfigurator.selectPlatform(mojave);
+
+        await waitForComponentsToRender(context);
+        expect(testConfigChangeActionCount).to.be(2);
+
+        const requests = context.symbols.MockRemoteAPI.requests;
+        expect(requests.length).to.be(1);
+        expect(requests[0].url).to.be('/api/commits/1/latest?platform=1');
+        requests[0].reject();
+
+        customAnalysisTaskConfigurator.content('baseline-revision-table').querySelector('input').value = '123';
+        customAnalysisTaskConfigurator.content('baseline-revision-table').querySelector('input').dispatchEvent(new Event('input'));
+        await sleep(context.symbols.CustomAnalysisTaskConfigurator.commitFetchInterval);
+        expect(requests.length).to.be(2);
+        expect(requests[1].url).to.be('/api/commits/1/123');
+
+        customAnalysisTaskConfigurator._configureComparison();
+        await waitForComponentsToRender(context);
+        expect(testConfigChangeActionCount).to.be(3);
+
+        customAnalysisTaskConfigurator.selectPlatform(highSierra);
+        await waitForComponentsToRender(context);
+        expect(testConfigChangeActionCount).to.be(4);
+    });
 });
\ No newline at end of file

Modified: trunk/Websites/perf.webkit.org/public/v3/components/custom-analysis-task-configurator.js (243357 => 243358)


--- trunk/Websites/perf.webkit.org/public/v3/components/custom-analysis-task-configurator.js	2019-03-22 03:00:44 UTC (rev 243357)
+++ trunk/Websites/perf.webkit.org/public/v3/components/custom-analysis-task-configurator.js	2019-03-22 03:34:28 UTC (rev 243358)
@@ -60,6 +60,7 @@
             this._updateMapFromSpecifiedRevisionsForConfiguration(this._invalidRevisionsByConfiguration, configuration);
         }
         this._updateCommitSetMap();
+        this.dispatchAction('testConfigChange');
         this.enqueueToRender();
     }
 
@@ -336,7 +337,7 @@
 
         this._commitSetMap = {'Baseline': newBaseline, 'Comparison': newComparison};
 
-        this.dispatchAction('commitSetChange');
+        this.dispatchAction('testConfigChange');
         this.enqueueToRender();
     }
 

Modified: trunk/Websites/perf.webkit.org/public/v3/components/custom-configuration-test-group-form.js (243357 => 243358)


--- trunk/Websites/perf.webkit.org/public/v3/components/custom-configuration-test-group-form.js	2019-03-22 03:00:44 UTC (rev 243357)
+++ trunk/Websites/perf.webkit.org/public/v3/components/custom-configuration-test-group-form.js	2019-03-22 03:34:28 UTC (rev 243358)
@@ -49,7 +49,7 @@
     {
         super.didConstructShadowTree();
 
-        this.part('configurator').listenToAction('commitSetChange', () => this.enqueueToRender());
+        this.part('configurator').listenToAction('testConfigChange', () => this.enqueueToRender());
 
         this.content('task-name')._oninput_ = () => this.enqueueToRender();
         this.content('group-name')._oninput_ = () => this.enqueueToRender();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to