Bug 1357465: include the full test platform like it says in the docs; r=jmaher
authorDustin J. Mitchell <dustin@mozilla.com>
Fri, 14 Apr 2017 20:49:44 +0000
changeset 354559 b815d628734daf2d1e9b1c3d635d6e81079c0272
parent 354558 f44e4c7777b82feeeb8d4c59fb705733e9678796
child 354560 f61b1bc0bee770b16ec3dac814ebd088d6044c5a
push id41366
push userdmitchell@mozilla.com
push dateMon, 24 Apr 2017 17:06:19 +0000
treeherderautoland@b815d628734d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjmaher
bugs1357465
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1357465: include the full test platform like it says in the docs; r=jmaher MozReview-Commit-ID: CkAsBNEznuw
taskcluster/taskgraph/target_tasks.py
taskcluster/taskgraph/test/test_try_option_syntax.py
taskcluster/taskgraph/transforms/tests.py
taskcluster/taskgraph/try_option_syntax.py
--- a/taskcluster/taskgraph/target_tasks.py
+++ b/taskcluster/taskgraph/target_tasks.py
@@ -172,33 +172,33 @@ def target_tasks_graphics(full_task_grap
         return True
     return [l for l in filtered_for_project if filter(full_task_graph[l])]
 
 
 @_target_task('mochitest_valgrind')
 def target_tasks_valgrind(full_task_graph, parameters):
     """Target tasks that only run on the cedar branch."""
     def filter(task):
-        platform = task.attributes.get('test_platform')
+        platform = task.attributes.get('test_platform', '').split('/')[0]
         if platform not in ['linux64']:
             return False
 
         if task.attributes.get('unittest_suite', '').startswith('mochitest') and \
            task.attributes.get('unittest_flavor', '').startswith('valgrind-plain'):
             return True
         return False
 
     return [l for l, t in full_task_graph.tasks.iteritems() if filter(t)]
 
 
 @_target_task('nightly_code_coverage')
 def target_tasks_code_coverage(full_task_graph, parameters):
     """Target tasks that generate coverage data."""
     def filter(task):
-        platform = task.attributes.get('test_platform')
+        platform = task.attributes.get('test_platform', '').split('/')[0]
         if platform not in ('linux64-ccov', 'linux64-jsdcov'):
             return False
         return True
     return [l for l, t in full_task_graph.tasks.iteritems() if filter(t)]
 
 
 @_target_task('nightly_fennec')
 def target_tasks_nightly_fennec(full_task_graph, parameters):
--- a/taskcluster/taskgraph/test/test_try_option_syntax.py
+++ b/taskcluster/taskgraph/test/test_try_option_syntax.py
@@ -26,23 +26,23 @@ def unittest_task(n, tp):
 
 def talos_task(n, tp):
     return (n, Task('test', n, {
         'talos_try_name': n,
         'test_platform': tp,
     }, {}))
 
 tasks = {k: v for k, v in [
-    unittest_task('mochitest-browser-chrome', 'linux'),
-    unittest_task('mochitest-browser-chrome-e10s', 'linux64'),
-    unittest_task('mochitest-chrome', 'linux'),
-    unittest_task('mochitest-webgl', 'linux'),
-    unittest_task('crashtest-e10s', 'linux'),
-    unittest_task('gtest', 'linux64'),
-    talos_task('dromaeojs', 'linux64'),
+    unittest_task('mochitest-browser-chrome', 'linux/opt'),
+    unittest_task('mochitest-browser-chrome-e10s', 'linux64/debug'),
+    unittest_task('mochitest-chrome', 'linux/this'),
+    unittest_task('mochitest-webgl', 'linux/that'),
+    unittest_task('crashtest-e10s', 'linux/other'),
+    unittest_task('gtest', 'linux64/asan'),
+    talos_task('dromaeojs', 'linux64/psan'),
 ]}
 unittest_tasks = {k: v for k, v in tasks.iteritems()
                   if 'unittest_try_name' in v.attributes}
 talos_tasks = {k: v for k, v in tasks.iteritems()
                if 'talos_try_name' in v.attributes}
 graph_with_jobs = TaskGraph(tasks, Graph(set(tasks), set()))
 
 
--- a/taskcluster/taskgraph/transforms/tests.py
+++ b/taskcluster/taskgraph/transforms/tests.py
@@ -674,18 +674,17 @@ def make_job_description(config, tests):
             suite, flavor = suite.split('/', 1)
         else:
             flavor = suite
 
         attributes = test.get('attributes', {})
         attributes.update({
             'build_platform': attr_build_platform,
             'build_type': attr_build_type,
-            # only keep the first portion of the test platform
-            'test_platform': test['test-platform'].split('/')[0],
+            'test_platform': test['test-platform'],
             'test_chunk': str(test['this-chunk']),
             'unittest_suite': suite,
             'unittest_flavor': flavor,
             attr_try_name: try_name,
         })
 
         jobdesc = {}
         name = '{}-{}'.format(test['test-platform'], test['test-name'])
--- a/taskcluster/taskgraph/try_option_syntax.py
+++ b/taskcluster/taskgraph/try_option_syntax.py
@@ -116,16 +116,17 @@ UNITTEST_ALIASES = {
     'xpcshell': alias_prefix('xpcshell'),
 }
 
 # unittest platforms can be specified by substring of the "pretty name", which
 # is basically the old Buildbot builder name.  This dict has {pretty name,
 # [test_platforms]} translations, This includes only the most commonly-used
 # substrings.  This is intended only for backward-compatibility.  New test
 # platforms should have their `test_platform` spelled out fully in try syntax.
+# Note that the test platforms here are only the prefix up to the `/`.
 UNITTEST_PLATFORM_PRETTY_NAMES = {
     'Ubuntu': ['linux32', 'linux64', 'linux64-asan'],
     'x64': ['linux64', 'linux64-asan'],
     'Android 4.3': ['android-4.3-arm7-api-15'],
     # other commonly-used substrings for platforms not yet supported with
     # in-tree taskgraphs:
     # '10.10': [..TODO..],
     # '10.10.5': [..TODO..],
@@ -381,17 +382,17 @@ class TryOptionSyntax(object):
             - test_arg is == 'all' (meaning use the list of jobs for that job type)
             - test_arg is comma string which needs to be parsed
         '''
 
         # Empty job list case...
         if test_arg is None or test_arg == 'none':
             return []
 
-        all_platforms = set(t.attributes['test_platform']
+        all_platforms = set(t.attributes['test_platform'].split('/')[0]
                             for t in full_task_graph.tasks.itervalues()
                             if 'test_platform' in t.attributes)
 
         tests = self.parse_test_opts(test_arg, all_platforms)
 
         if not tests:
             return []
 
@@ -579,18 +580,20 @@ class TryOptionSyntax(object):
             if try_spec is None:
                 return True
             # TODO: optimize this search a bit
             for test in try_spec:
                 if attr(attr_name) == test['test']:
                     break
             else:
                 return False
-            if 'platforms' in test and attr('test_platform') not in test['platforms']:
-                return False
+            if 'platforms' in test:
+                platform = attributes.get('test_platform', '').split('/')[0]
+                if platform not in test['platforms']:
+                    return False
             if 'only_chunks' in test and attr('test_chunk') not in test['only_chunks']:
                 return False
             return True
 
         job_try_name = attr('job_try_name')
         if job_try_name:
             if self.jobs is None or job_try_name in self.jobs:
                 if self.platforms is None or attr('build_platform') not in self.platforms: