bug 1442793 - tests artifact_prefix. r=bhearsum, a=release
authorAki Sasaki <asasaki@mozilla.com>
Wed, 07 Mar 2018 13:05:10 -0800
changeset 460932 117a0beae34bf3e043df5cbaddc02924fb8d7ac4
parent 460931 6a3fd90992811c4595c00c51dc21f826a97bd75d
child 460933 8bc845cfb7683cb6ddec5f3b22a3f3a4949c2b69
push id9098
push userbhearsum@mozilla.com
push dateThu, 19 Apr 2018 20:02:16 +0000
treeherdermozilla-beta@98d536130349 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbhearsum, release
bugs1442793
milestone60.0
bug 1442793 - tests artifact_prefix. r=bhearsum, a=release MozReview-Commit-ID: 1KFGftPjG9Z
taskcluster/taskgraph/transforms/tests.py
--- a/taskcluster/taskgraph/transforms/tests.py
+++ b/taskcluster/taskgraph/transforms/tests.py
@@ -23,16 +23,17 @@ from taskgraph.transforms.base import Tr
 from taskgraph.util.schema import resolve_keyed_by, OptimizationSchema
 from taskgraph.util.treeherder import split_symbol, join_symbol
 from taskgraph.util.platforms import platform_family
 from taskgraph.util.schema import (
     validate_schema,
     optionally_keyed_by,
     Schema,
 )
+from taskgraph.util.taskcluster import get_artifact_path
 from mozbuild.schedules import INCLUSIVE_COMPONENTS
 
 from voluptuous import (
     Any,
     Optional,
     Required,
     Exclusive,
 )
@@ -504,33 +505,44 @@ def setup_talos(config, tests):
         if config.params['project'] == 'try':
             extra_options.append('--branch-name')
             extra_options.append('try')
 
         yield test
 
 
 @transforms.add
+def handle_artifact_prefix(config, tests):
+    """Handle translating `artifact_prefix` appropriately"""
+    for test in tests:
+        if test['build-attributes'].get('artifact_prefix'):
+            test.setdefault("attributes", {}).setdefault(
+                'artifact_prefix', test['build-attributes']['artifact_prefix']
+            )
+        yield test
+
+
+@transforms.add
 def set_target(config, tests):
     for test in tests:
         build_platform = test['build-platform']
         target = None
         if 'target' in test:
             resolve_keyed_by(test, 'target', item_name=test['test-name'])
             target = test['target']
         if not target:
             if build_platform.startswith('macosx'):
                 target = 'target.dmg'
             elif build_platform.startswith('android'):
                 target = 'target.apk'
             elif build_platform.startswith('win'):
                 target = 'target.zip'
             else:
                 target = 'target.tar.bz2'
-        test['mozharness']['build-artifact-name'] = 'public/build/' + target
+        test['mozharness']['build-artifact-name'] = get_artifact_path(test, target)
 
         yield test
 
 
 @transforms.add
 def set_treeherder_machine_platform(config, tests):
     """Set the appropriate task.extra.treeherder.machine.platform"""
     translation = {