Commit 31d850b1 authored by Edward Lemur's avatar Edward Lemur Committed by Commit Bot

Zip tests artifacts to a unique filename.

As it is, it's always zipped into 'test_artifacts.zip',
so if there are multiple devices, they'll all write to the
same file, and there might be a race condition.

Bug: webrtc:8391
Change-Id: I490e0678c3ba8558dc7ce9ea9a620b5b7f008a80
Reviewed-on: https://chromium-review.googlesource.com/718704Reviewed-by: default avatarJohn Budorick <jbudorick@chromium.org>
Reviewed-by: default avatarHenrik Kjellander <kjellander@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Cr-Commit-Position: refs/heads/master@{#509329}
parent e5065d6e
......@@ -411,17 +411,18 @@ class LocalDeviceGtestRun(local_device_test_run.LocalDeviceTestRun):
if test_artifacts_dir:
with tempfile_ext.NamedTemporaryDirectory() as test_artifacts_host_dir:
device.PullFile(test_artifacts_dir.name, test_artifacts_host_dir)
test_artifacts_zip = shutil.make_archive('test_artifacts', 'zip',
test_artifacts_host_dir)
link = google_storage_helper.upload(
google_storage_helper.unique_name(
'test_artifacts', device=device),
test_artifacts_zip,
bucket='%s/test_artifacts' % (
self._test_instance.gs_test_artifacts_bucket))
logging.info('Uploading test artifacts to %s.', link)
os.remove(test_artifacts_zip)
return link
with tempfile_ext.NamedTemporaryDirectory() as temp_zip_dir:
zip_base_name = os.path.join(temp_zip_dir, 'test_artifacts')
test_artifacts_zip = shutil.make_archive(
zip_base_name, 'zip', test_artifacts_host_dir)
link = google_storage_helper.upload(
google_storage_helper.unique_name(
'test_artifacts', device=device),
test_artifacts_zip,
bucket='%s/test_artifacts' % (
self._test_instance.gs_test_artifacts_bucket))
logging.info('Uploading test artifacts to %s.', link)
return link
return None
#override
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment