Bug 1311966 - symlink rather than copy artifacts; r?pmoore draft
authorRob Thijssen <rthijssen@mozilla.com>
Wed, 16 Nov 2016 13:31:48 +0000
changeset 439824 94d236757ac092d82a7ce0a4c27551e2fc74dee6
parent 439707 2598a93e2e1a27f363af9fdd290cf4184cc51d48
child 537268 f788c8c9c2bc9cca94a36122f78ea80d54e8ea4c
push id36112
push userrthijssen@mozilla.com
push dateWed, 16 Nov 2016 18:12:43 +0000
reviewerspmoore
bugs1311966
milestone53.0a1
Bug 1311966 - symlink rather than copy artifacts; r?pmoore MozReview-Commit-ID: 5cFjuwtUgEr
taskcluster/taskgraph/transforms/tests/make_task_description.py
--- a/taskcluster/taskgraph/transforms/tests/make_task_description.py
+++ b/taskcluster/taskgraph/transforms/tests/make_task_description.py
@@ -324,23 +324,21 @@ def generic_worker_setup(config, test, t
         ['generic-worker:os-group:{}'.format(group) for group in test['os-groups']])
 
     worker = taskdesc['worker'] = {}
     worker['os-groups'] = test['os-groups']
     worker['implementation'] = test['worker-implementation']
     worker['max-run-time'] = test['max-run-time']
     worker['artifacts'] = artifacts
 
-    env = worker['env'] = {
-        # Bug 1306989
+    worker['env'] = {
         'APPDATA': '%cd%\\AppData\\Roaming',
         'LOCALAPPDATA': '%cd%\\AppData\\Local',
         'TEMP': '%cd%\\AppData\\Local\\Temp',
         'TMP': '%cd%\\AppData\\Local\\Temp',
-        'USERPROFILE': '%cd%',
     }
 
     # assemble the command line
     mh_command = [
         'c:\\mozilla-build\\python\\python.exe',
         '-u',
         'mozharness\\scripts\\' + normpath(mozharness['script'])
     ]
@@ -364,23 +362,25 @@ def generic_worker_setup(config, test, t
             mh_command.append('--total-chunk={}'.format(test['chunks']))
             mh_command.append('--this-chunk={}'.format(test['this-chunk']))
         elif mozharness['chunking-args'] == 'test-suite-suffix':
             suffix = mozharness['chunk-suffix'].replace('<CHUNK>', str(test['this-chunk']))
             for i, c in enumerate(mh_command):
                 if isinstance(c, basestring) and c.startswith('--test-suite'):
                     mh_command[i] += suffix
 
-    worker['command'] = [
-        'mkdir {} {}'.format(env['APPDATA'], env['TMP']),
+    # bug 1311966 - symlink to artifacts until generic worker supports virtual artifact paths
+    artifact_link_commands = ['mklink /d %cd%\\public\\test_info %cd%\\build\\blobber_upload_dir']
+    for link in [a['path'] for a in artifacts if a['path'].startswith('public\\logs\\')]:
+        artifact_link_commands.append('mklink %cd%\\{} %cd%\\{}'.format(link, link[7:]))
+
+    worker['command'] = artifact_link_commands + [
         {'task-reference': 'c:\\mozilla-build\\wget\\wget.exe {}'.format(mozharness_url)},
         'c:\\mozilla-build\\info-zip\\unzip.exe mozharness.zip',
-        {'task-reference': ' '.join(mh_command)},
-        'xcopy build\\blobber_upload_dir public\\test_info /e /i',
-        'copy /y logs\\*.* public\\logs\\'
+        {'task-reference': ' '.join(mh_command)}
     ]
 
 
 @worker_setup_function("macosx-engine")
 def macosx_engine_setup(config, test, taskdesc):
     mozharness = test['mozharness']
 
     installer_url = ARTIFACT_URL.format('<build>', mozharness['build-artifact-name'])