Bug 1280440 - Add TC Android x86 tests, tier 2; r=dustin
authorGeoff Brown <gbrown@mozilla.com>
Tue, 02 Aug 2016 09:37:44 -0600
changeset 333593 73fe336b6d3945699c72d196dfeaf82934ab039b
parent 333592 ab909836315986610c35a81526c0e8e24c3bbdb1
child 333594 dcae241857b185f583f6c3f568b1bd3b1b52de41
push id10033
push userraliiev@mozilla.com
push dateMon, 19 Sep 2016 13:50:26 +0000
treeherdermozilla-aurora@5dddbefdf759 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdustin
bugs1280440
milestone51.0a1
Bug 1280440 - Add TC Android x86 tests, tier 2; r=dustin
taskcluster/ci/android-test/test-platforms.yml
taskcluster/ci/android-test/test-sets.yml
taskcluster/ci/android-test/tests.yml
taskcluster/taskgraph/transforms/base.py
taskcluster/taskgraph/transforms/tests/all_kinds.py
taskcluster/taskgraph/transforms/tests/android_test.py
taskcluster/taskgraph/transforms/tests/test_description.py
--- a/taskcluster/ci/android-test/test-platforms.yml
+++ b/taskcluster/ci/android-test/test-platforms.yml
@@ -12,8 +12,11 @@
 # generation.
 
 android-4.3-arm7-api-15/debug:
     build-platform: android-api-15/debug
     test-set: debug-tests
 android-4.3-arm7-api-15/opt:
     build-platform: android-api-15/opt
     test-set: opt-tests
+android-4.2-x86/opt:
+    build-platform: android-x86/opt
+    test-set: x86-tests
--- a/taskcluster/ci/android-test/test-sets.yml
+++ b/taskcluster/ci/android-test/test-sets.yml
@@ -30,8 +30,11 @@ opt-tests:
     - mochitest-chrome
     - mochitest-clipboard
     - mochitest-gpu
     - mochitest-media
     - mochitest-webgl
     - reftest
     - robocop
     - xpcshell
+
+x86-tests:
+    - xpcshell
--- a/taskcluster/ci/android-test/tests.yml
+++ b/taskcluster/ci/android-test/tests.yml
@@ -231,22 +231,32 @@ robocop:
             - mozharness/configs/android/androidarm_4_3-tc.py
         extra-options:
             - --test-suite=robocop
 
 xpcshell:
     description: "xpcshell test run"
     suite: xpcshell
     treeherder-symbol: tc-X()
-    chunks: 3
+    chunks:
+        by-test-platform:
+            default: 3
+            android-4.2-x86/opt: 4
     instance-size: xlarge
-    max-run-time: 7200
+    max-run-time:
+        by-test-platform:
+            default: 7200
+            android-4.2-x86/opt: 3600
     loopback-video: true
     e10s: false
     mozharness:
         script: mozharness/scripts/android_emulator_unittest.py
         no-read-buildbot-config: true
-        config:
-            - mozharness/configs/android/androidarm_4_3.py
-            - mozharness/configs/remove_executables.py
-            - mozharness/configs/android/androidarm_4_3-tc.py
         extra-options:
             - --test-suite=xpcshell
+        config:
+            by-test-platform:
+                default:
+                    - mozharness/configs/android/androidarm_4_3.py
+                    - mozharness/configs/remove_executables.py
+                    - mozharness/configs/android/androidarm_4_3-tc.py
+                android-4.2-x86/opt:
+                    - mozharness/configs/android/androidx86-tc.py
--- a/taskcluster/taskgraph/transforms/base.py
+++ b/taskcluster/taskgraph/transforms/base.py
@@ -66,31 +66,42 @@ def validate_schema(schema, obj, msg_pre
         return schema(obj)
     except voluptuous.MultipleInvalid as exc:
         msg = [msg_prefix]
         for error in exc.errors:
             msg.append(str(error))
         raise Exception('\n'.join(msg))
 
 
-def get_keyed_by(item, field, item_name):
+def get_keyed_by(item, field, item_name, subfield=None):
     """
     For values which can either accept a literal value, or be keyed by some
     other attribute of the item, perform that lookup.  For example, this supports
 
         chunks:
             by-item-platform:
                 macosx-10.11/debug: 13
                 default: 12
 
     The `item_name` parameter is used to generate useful error messages.
+    The `subfield` parameter, if specified, allows access to a second level
+    of the item dictionary: item[field][subfield]. For example, this supports
+
+        mozharness:
+            config:
+                by-item-platform:
+                    default: ...
     """
     value = item[field]
     if not isinstance(value, dict):
         return value
+    if subfield:
+        value = item[field][subfield]
+        if not isinstance(value, dict):
+            return value
 
     assert len(value) == 1, "Invalid attribute {} in {}".format(field, item_name)
     keyed_by = value.keys()[0]
     values = value[keyed_by]
     if keyed_by.startswith('by-'):
         keyed_by = keyed_by[3:]  # extract just the keyed-by field name
         for k in item[keyed_by], 'default':
             if k in values:
--- a/taskcluster/taskgraph/transforms/tests/all_kinds.py
+++ b/taskcluster/taskgraph/transforms/tests/all_kinds.py
@@ -74,16 +74,20 @@ def resolve_keyed_by(config, tests):
     fields = [
         'instance-size',
         'max-run-time',
         'chunks',
     ]
     for test in tests:
         for field in fields:
             test[field] = get_keyed_by(item=test, field=field, item_name=test['test-name'])
+        test['mozharness']['config'] = get_keyed_by(item=test,
+                                                    field='mozharness',
+                                                    subfield='config',
+                                                    item_name=test['test-name'])
         yield test
 
 
 @transforms.add
 def split_chunks(config, tests):
     """Based on the 'chunks' key, split tests up into chunks by duplicating
     them and assigning 'this-chunk' appropriately and updating the treeherder
     symbol."""
--- a/taskcluster/taskgraph/transforms/tests/android_test.py
+++ b/taskcluster/taskgraph/transforms/tests/android_test.py
@@ -41,13 +41,14 @@ def set_tier(config, tests):
 def set_treeherder_machine_platform(config, tests):
     """Set the appropriate task.extra.treeherder.machine.platform"""
     # The build names for these build platforms have partially evolved over the
     # years..  This is temporary until we can clean up the handling of
     # platforms
     translation = {
         'android-api-15/debug': 'android-4-3-armv7-api15/debug',
         'android-api-15/opt': 'android-4-3-armv7-api15/opt',
+        'android-x86/opt': 'android-4-2-x86/opt',
     }
     for test in tests:
         build_platform = test['build-platform']
         test['treeherder-machine-platform'] = translation.get(build_platform, build_platform)
         yield test
--- a/taskcluster/taskgraph/transforms/tests/test_description.py
+++ b/taskcluster/taskgraph/transforms/tests/test_description.py
@@ -115,17 +115,20 @@ test_description_schema = Schema({
     ),
 
     # What to run
     Required('mozharness'): Any({
         # the mozharness script used to run this task
         Required('script'): basestring,
 
         # the config files required for the task
-        Required('config'): [basestring],
+        Required('config'): Any(
+            [basestring],
+            {'by-test-platform': {basestring: [basestring]}},
+        ),
 
         # any additional actions to pass to the mozharness command
         Optional('actions'): [basestring],
 
         # additional command-line options for mozharness, beyond those
         # automatically added
         Required('extra-options', default=[]): [basestring],