From 6696b5226503c2af270aca0e2b39e7be59a30d24 Mon Sep 17 00:00:00 2001 From: Rob Wood Date: Mon, 26 Jun 2017 16:53:27 -0400 Subject: [PATCH] Bug 1375456 - Fix running talos quantum_pageload_* tests locally with -activeTests; r=jmaher MozReview-Commit-ID: QH5cdUPCM9 --HG-- extra : rebase_source : 396bbbdfe6a87638c6aa2ef8ad3239cb0a752a67 --- .../mozharness/mozilla/testing/talos.py | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/testing/mozharness/mozharness/mozilla/testing/talos.py b/testing/mozharness/mozharness/mozilla/testing/talos.py index 096a564bffce..5c262b436e68 100755 --- a/testing/mozharness/mozharness/mozilla/testing/talos.py +++ b/testing/mozharness/mozharness/mozilla/testing/talos.py @@ -173,6 +173,7 @@ class Talos(TestingMixin, MercurialScript, BlobUploadMixin, TooltoolMixin, self.gecko_profile_interval = self.config.get('gecko_profile_interval') self.pagesets_name = None self.mitmproxy_recording_set = None # zip file found on tooltool that contains all of the mitmproxy recordings + self.mitmproxy_recordings_file_list = self.config.get('mitmproxy', None) # files inside the recording set self.mitmdump = None # path to mitdump tool itself, in py3 venv # We accept some configuration options from the try commit message in the format mozharness: @@ -240,6 +241,19 @@ class Talos(TestingMixin, MercurialScript, BlobUploadMixin, TooltoolMixin, self.pagesets_name = self.talos_json_config['suites'][self.suite].get('pagesets_name') return self.pagesets_name + def query_mitmproxy_recordings_file_list(self): + """ When using mitmproxy we also need the name of the playback files that are included + inside the playback archive. + """ + if self.mitmproxy_recordings_file_list: + return self.mitmproxy_recordings_file_list + if self.query_talos_json_config() and self.suite is not None: + talos_opts = self.talos_json_config['suites'][self.suite].get('talos_options', None) + for index, val in enumerate(talos_opts): + if val == '--mitmproxy': + self.mitmproxy_recordings_file_list = talos_opts[index + 1] + return self.mitmproxy_recordings_file_list + def get_suite_from_test(self): """ Retrieve the talos suite name from a given talos test name.""" # running locally, single test name provided instead of suite; go through tests and find suite name @@ -293,6 +307,14 @@ class Talos(TestingMixin, MercurialScript, BlobUploadMixin, TooltoolMixin, # for it; need to add the path to that env/mitdump tool if self.mitmdump: kw_options['mitmdumpPath'] = self.mitmdump + # also need to have recordings list; get again here from talos.json, in case talos was + # invoked via '-a' and therefore the --mitmproxy param wasn't used on command line + if not self.config.get('mitmproxy', None): + file_list = self.query_mitmproxy_recordings_file_list() + if file_list is not None: + kw_options['mitmproxy'] = file_list + else: + self.fatal("Talos requires list of mitmproxy playback files, use --mitmproxy") kw_options.update(kw) # talos expects tests to be in the format (e.g.) 'ts:tp5:tsvg' tests = kw_options.get('activeTests')