bug 1442793 - tests artifact_prefix. r?bhearsum
MozReview-Commit-ID: 1KFGftPjG9Z
--- 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,
)
@@ -494,33 +495,44 @@ def setup_talos(config, tests):
if config.params.is_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 = {