Remove the code for old syncing script configuration in BuildbotSyncer
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 11 May 2017 23:46:23 +0000 (23:46 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 11 May 2017 23:46:23 +0000 (23:46 +0000)
https://bugs.webkit.org/show_bug.cgi?id=171963

Reviewed by Chris Dumez.

Removed the code for specifying {"root": ~}, {"rootOptions": [~]}, and {"rootsExcluding": [~]} in buildbot
properties in the syncing script's configurations since they are no longer used after r215061.

Also removed the support for using "arguments" as an alias to "properties", and updated the tests accordingly.

* tools/js/buildbot-syncer.js:
(BuildbotSyncer._parseRepositoryGroup): Removed the unused code.
(BuildbotSyncer._validateAndMergeConfig): Just allow string values in properties.
(BuildbotSyncer._validateAndMergeProperties): Deleted.

* unit-tests/buildbot-syncer-tests.js:
(sampleiOSConfig): Use "properties" instead of "arguments" to specify the buildbot properties.
(sampleiOSConfigWithExpansions): Ditto.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@216703 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Websites/perf.webkit.org/ChangeLog
Websites/perf.webkit.org/tools/js/buildbot-syncer.js
Websites/perf.webkit.org/unit-tests/buildbot-syncer-tests.js

index d6b25be..52b0f7b 100644 (file)
@@ -1,3 +1,24 @@
+2017-05-11  Ryosuke Niwa  <rniwa@webkit.org>
+
+        Remove the code for old syncing script configuration in BuildbotSyncer
+        https://bugs.webkit.org/show_bug.cgi?id=171963
+
+        Reviewed by Chris Dumez.
+
+        Removed the code for specifying {"root": ~}, {"rootOptions": [~]}, and {"rootsExcluding": [~]} in buildbot
+        properties in the syncing script's configurations since they are no longer used after r215061.
+
+        Also removed the support for using "arguments" as an alias to "properties", and updated the tests accordingly.
+
+        * tools/js/buildbot-syncer.js:
+        (BuildbotSyncer._parseRepositoryGroup): Removed the unused code.
+        (BuildbotSyncer._validateAndMergeConfig): Just allow string values in properties.
+        (BuildbotSyncer._validateAndMergeProperties): Deleted.
+
+        * unit-tests/buildbot-syncer-tests.js:
+        (sampleiOSConfig): Use "properties" instead of "arguments" to specify the buildbot properties.
+        (sampleiOSConfigWithExpansions): Ditto.
+
 2017-05-10  Ryosuke Niwa  <rniwa@webkit.org>
 
         Another build fix after r215633 to make the bar graphs render even when the confidence intervals aren't available.
index 31062de..ee611f3 100644 (file)
@@ -334,7 +334,6 @@ class BuildbotSyncer {
             description: group.description,
             acceptsRoots: group.acceptsRoots,
             propertiesTemplate,
-            arguments: group.arguments,
             repositoryList: parsedRepositoryList,
         };
     }
@@ -389,11 +388,14 @@ class BuildbotSyncer {
 
             switch (name) {
             case 'properties': // Fallthrough
-            case 'arguments':
-                assert.equal(typeof(value), 'object', 'arguments should be a dictionary');
+                assert.equal(typeof(value), 'object', 'properties should be a dictionary');
                 if (!config['properties'])
                     config['properties'] = {};
-                this._validateAndMergeProperties(config['properties'], value);
+                const properties = config['properties'];
+                for (const name in value) {
+                    assert.equal(typeof(value[name]), 'string', 'A argument value must be a string');
+                    properties[name] = value[name];
+                }
                 break;
             case 'test': // Fallthrough
             case 'slaveList': // Fallthrough
@@ -416,37 +418,6 @@ class BuildbotSyncer {
         return config;
     }
 
-    static _validateAndMergeProperties(properties, configArguments)
-    {
-        for (let name in configArguments) {
-            const value = configArguments[name];
-            if (typeof(value) == 'string') {
-                properties[name] = value;
-                continue;
-            }
-            assert.equal(typeof(value), 'object', 'A argument value must be either a string or a dictionary');
-
-            const keys = Object.keys(value);
-            assert.equal(keys.length, 1, 'arguments value cannot contain more than one key');
-            let namedValue = value[keys[0]];
-            switch (keys[0]) {
-            case 'root':
-                assert.equal(typeof(namedValue), 'string', 'root name must be a string');
-                break;
-            case 'rootOptions': // Fallthrough
-            case 'rootsExcluding':
-                assert(namedValue instanceof Array, `${keys[0]} must specify an array`);
-                for (let excludedRootName of namedValue)
-                    assert.equal(typeof(excludedRootName), 'string', `${keys[0]} must specify an array of strings`);
-                namedValue = namedValue.slice();
-                break;
-            default:
-                assert(false, `Unrecognized named argument ${keys[0]}`);
-            }
-            properties[name] = {[keys[0]]: namedValue};
-        }
-    }
-
 }
 
 if (typeof module != 'undefined') {
index 7e3b0c7..a4aba78 100644 (file)
@@ -26,26 +26,26 @@ function sampleiOSConfig()
         'types': {
             'speedometer': {
                 'test': ['Speedometer'],
-                'arguments': {'test_name': 'speedometer'}
+                'properties': {'test_name': 'speedometer'}
             },
             'jetstream': {
                 'test': ['JetStream'],
-                'arguments': {'test_name': 'jetstream'}
+                'properties': {'test_name': 'jetstream'}
             },
             'dromaeo-dom': {
                 'test': ['Dromaeo', 'DOM Core Tests'],
-                'arguments': {'tests': 'dromaeo-dom'}
+                'properties': {'tests': 'dromaeo-dom'}
             },
         },
         'builders': {
             'iPhone-bench': {
                 'builder': 'ABTest-iPhone-RunBenchmark-Tests',
-                'arguments': { 'forcescheduler': 'ABTest-iPhone-RunBenchmark-Tests-ForceScheduler' },
+                'properties': { 'forcescheduler': 'ABTest-iPhone-RunBenchmark-Tests-ForceScheduler' },
                 'slaveList': ['ABTest-iPhone-0'],
             },
             'iPad-bench': {
                 'builder': 'ABTest-iPad-RunBenchmark-Tests',
-                'arguments': { 'forcescheduler': 'ABTest-iPad-RunBenchmark-Tests-ForceScheduler' },
+                'properties': { 'forcescheduler': 'ABTest-iPad-RunBenchmark-Tests-ForceScheduler' },
                 'slaveList': ['ABTest-iPad-0', 'ABTest-iPad-1'],
             }
         },
@@ -69,25 +69,25 @@ function sampleiOSConfigWithExpansions()
         "types": {
             "iphone-plt": {
                 "test": ["PLT-iPhone"],
-                "arguments": {"test_name": "plt"}
+                "properties": {"test_name": "plt"}
             },
             "ipad-plt": {
                 "test": ["PLT-iPad"],
-                "arguments": {"test_name": "plt"}
+                "properties": {"test_name": "plt"}
             },
             "speedometer": {
                 "test": ["Speedometer"],
-                "arguments": {"tests": "speedometer"}
+                "properties": {"tests": "speedometer"}
             },
         },
         "builders": {
             "iphone": {
                 "builder": "iPhone AB Tests",
-                "arguments": {"forcescheduler": "force-iphone-ab-tests"}
+                "properties": {"forcescheduler": "force-iphone-ab-tests"}
             },
             "ipad": {
                 "builder": "iPad AB Tests",
-                "arguments": {"forcescheduler": "force-ipad-ab-tests"}
+                "properties": {"forcescheduler": "force-ipad-ab-tests"}
             },
         },
         "configurations": [
@@ -440,28 +440,28 @@ describe('BuildbotSyncer', () => {
             });
         });
 
-        it('should throw when arguments is not an object', () => {
+        it('should throw when properties is not an object', () => {
             assert.throws(() => {
                 const config = smallConfiguration();
-                config.configurations[0].arguments = 'hello';
+                config.configurations[0].properties = 'hello';
                 BuildbotSyncer._loadConfig(MockRemoteAPI, config);
             });
         });
 
-        it('should throw when arguments\'s values are malformed', () => {
+        it('should throw when propertie\'s values are malformed', () => {
             assert.throws(() => {
                 const config = smallConfiguration();
-                config.configurations[0].arguments = {'some': {'otherKey': 'some root'}};
+                config.configurations[0].properties = {'some': {'otherKey': 'some root'}};
                 BuildbotSyncer._loadConfig(RemoteAPI, config);
             });
             assert.throws(() => {
                 const config = smallConfiguration();
-                config.configurations[0].arguments = {'some': {'root': ['a', 'b']}};
+                config.configurations[0].properties = {'some': {'root': ['a', 'b']}};
                 BuildbotSyncer._loadConfig(RemoteAPI, config);
             });
             assert.throws(() => {
                 const config = smallConfiguration();
-                config.configurations[0].arguments = {'some': {'root': 1}};
+                config.configurations[0].properties = {'some': {'root': 1}};
                 BuildbotSyncer._loadConfig(RemoteAPI, config);
             });
         });