Backout removal of when.files-changed support for tests from Bug 1403322; r?dustin draft
authorTom Prince <mozilla@hocat.ca>
Tue, 09 Jan 2018 11:51:08 -0700
changeset 717868 5588c70c2d2f2a920305240a4aa47a7547b3d052
parent 717738 6f5fac320fcb6625603fa8a744ffa8523f8b3d71
child 745370 77415967768868eae2bc914c9f0bbf1026416ced
push id94803
push userbmo:mozilla@hocat.ca
push dateTue, 09 Jan 2018 18:57:25 +0000
reviewersdustin
bugs1403322
milestone59.0a1
Backout removal of when.files-changed support for tests from Bug 1403322; r?dustin MozReview-Commit-ID: 1ZT1VWJx7Y
taskcluster/taskgraph/transforms/tests.py
--- a/taskcluster/taskgraph/transforms/tests.py
+++ b/taskcluster/taskgraph/transforms/tests.py
@@ -373,16 +373,21 @@ test_description_schema = Schema({
     'test-platform': basestring,
 
     # the name of the test (the key in tests.yml)
     'test-name': basestring,
 
     # the product name, defaults to firefox
     Optional('product'): basestring,
 
+    # conditional files to determine when these tests should be run
+    Optional('when'): Any({
+        Optional('files-changed'): [basestring],
+    }),
+
     Optional('worker-type'): optionally_keyed_by(
         'test-platform',
         Any(basestring, None),
     ),
 
 }, required=True)
 
 
@@ -1006,17 +1011,19 @@ def make_job_description(config, tests):
         if suite in INCLUSIVE_COMPONENTS:
             # if this is an "inclusive" test, then all files which might
             # cause it to run are annotated with SCHEDULES in moz.build,
             # so do not include the platform or any other components here
             schedules = [suite]
         else:
             schedules = [suite, platform_family(test['build-platform'])]
 
-        if config.params['project'] != 'try':
+        if test.get('when'):
+            jobdesc['when'] = test['when']
+        elif config.params['project'] != 'try':
             # for non-try branches, include SETA
             jobdesc['optimization'] = {'skip-unless-schedules-or-seta': schedules}
         else:
             # otherwise just use skip-unless-schedules
             jobdesc['optimization'] = {'skip-unless-schedules': schedules}
 
         run = jobdesc['run'] = {}
         run['using'] = 'mozharness-test'