Bug 1274980 part 1: Add support for test platform regex match. r=dustin
☠☠ backed out by 0a1dbd931f71 ☠ ☠
authorWander Lairson Costa <wcosta@mozilla.com>
Mon, 07 Nov 2016 09:20:50 -0200
changeset 348088 b8760b0b11ac46457f03ee74f478f0ea9311f7d1
parent 348087 018f16f5f08eb862e6711a86b8aa3c54ae90ace2
child 348089 6228dfcfac3bacb413f4e979ba4d3c79bc8b9509
push id10298
push userraliiev@mozilla.com
push dateMon, 14 Nov 2016 12:33:03 +0000
treeherdermozilla-aurora@7e29173b1641 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdustin
bugs1274980
milestone52.0a1
Bug 1274980 part 1: Add support for test platform regex match. r=dustin Often we need to setup a test configuration for different platforms, but not for different platform builds (opt/debug). This leads to cumbersome configuration duplicates. This patch adds support for platform regular expression matching. For example, if you want to configure the chunk size for linux64 platform both for opt and debug, originally you would do this: chunks: by-test-platform: linux64/opt: 4 linux64/debug: 4 default: 8 With regular expression matching, you only need: chunks: by-test-platform: linux64/.*: 4 default: 8 This patch was originally written by Geoffrey Brown for Windows support. MozReview-Commit-ID: HFP52N9Ef0k
taskcluster/taskgraph/test/test_transforms_base.py
--- a/taskcluster/taskgraph/test/test_transforms_base.py
+++ b/taskcluster/taskgraph/test/test_transforms_base.py
@@ -76,16 +76,30 @@ class TestKeyedBy(unittest.TestCase):
                     'a': 10,
                     'b': 20,
                 },
             },
             'other-value': 'b',
         }
         self.assertEqual(get_keyed_by(test, 'option', 'x'), 20)
 
+    def test_by_value_regex(self):
+        test = {
+            'test-name': 'tname',
+            'option': {
+                'by-test-platform': {
+                    'macosx64/.*': 10,
+                    'linux64/debug': 20,
+                    'default': 5,
+                },
+            },
+            'test-platform': 'macosx64/debug',
+        }
+        self.assertEqual(get_keyed_by(test, 'option', 'x'), 10)
+
     def test_by_value_default(self):
         test = {
             'test-name': 'tname',
             'option': {
                 'by-other-value': {
                     'a': 10,
                     'default': 30,
                 },