Bug 1415618: Add support to taskcluster to specifying extra paths to mozharness. r=jlund

MozReview-Commit-ID: 7CGQgSUUg0n

--HG--
extra : rebase_source : e31e1f70d0f54b4c1d6535d004f49267ea3071b5
This commit is contained in:
Tom Prince 2017-11-14 15:16:22 -07:00
parent 3985443d79
commit eea866d632
2 changed files with 24 additions and 2 deletions

View File

@ -12,6 +12,7 @@ echo "running as" $(id)
: MOZHARNESS_SCRIPT ${MOZHARNESS_SCRIPT}
: MOZHARNESS_CONFIG ${MOZHARNESS_CONFIG}
: MOZHARNESS_CONFIG_PATHS ${MOZHARNESS_CONFIG_PATHS}
: MOZHARNESS_ACTIONS ${MOZHARNESS_ACTIONS}
: MOZHARNESS_OPTIONS ${MOZHARNESS_OPTIONS}
@ -88,6 +89,11 @@ fi
# entirely effective.
export TOOLTOOL_CACHE
config_path_cmds=""
for path in ${MOZHARNESS_CONFIG_PATHS}; do
config_path_cmds="${config_path_cmds} --extra-config-path ${WORKSPACE}/build/src/${path}"
done
# support multiple, space delimited, config files
config_cmds=""
for cfg in $MOZHARNESS_CONFIG; do
@ -114,7 +120,9 @@ fi
cd /builds/worker
python2.7 $WORKSPACE/build/src/testing/${MOZHARNESS_SCRIPT} ${config_cmds} \
python2.7 $WORKSPACE/build/src/testing/${MOZHARNESS_SCRIPT} \
${config_path_cmds} \
${config_cmds} \
$debug_flag \
$custom_build_variant_cfg_flag \
--disable-mock \

View File

@ -34,8 +34,13 @@ mozharness_run_schema = Schema({
# directory and using forward slashes even on Windows
Required('script'): basestring,
# Additional paths to look for mozharness configs in. These should be
# relative to the base of the source checkout
Optional('config-paths'): [basestring],
# the config files required for the task, relative to
# testing/mozharness/configs and using forward slashes even on Windows
# testing/mozharness/configs or one of the paths specified in
# `config-paths` and using forward slashes even on Windows
Required('config'): [basestring],
# any additional actions to pass to the mozharness command
@ -140,6 +145,9 @@ def mozharness_on_docker_worker_setup(config, job, taskdesc):
if 'options' in run:
env['MOZHARNESS_OPTIONS'] = ' '.join(run['options'])
if 'config-paths' in run:
env['MOZHARNESS_CONFIG_PATHS'] = ' '.join(run['config-paths'])
if 'custom-build-variant-cfg' in run:
env['MH_CUSTOM_BUILD_VARIANT_CFG'] = run['custom-build-variant-cfg']
@ -235,6 +243,12 @@ def mozharness_on_generic_worker(config, job, taskdesc):
mh_command = [r'c:\mozilla-build\python\python.exe']
mh_command.append('\\'.join([r'.\build\src\testing', run['script'].replace('/', '\\')]))
if 'config-paths' in run:
for path in run['config-paths']:
mh_command.append(r'--extra-config-path '
r'.\build\src\{}'.format(path.replace('/', '\\')))
for cfg in run['config']:
mh_command.append('--config ' + cfg.replace('/', '\\'))
if run['use-magic-mh-args']: