Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/testing/raptor/raptor/raptor.py b/testing/raptor/raptor/raptor.py
- --- a/testing/raptor/raptor/raptor.py
- +++ b/testing/raptor/raptor/raptor.py
- @@ -20,8 +20,9 @@ import requests
- import mozcrash
- import mozinfo
- import mozprocess
- +from condprof.client import get_profile
- from logger.logger import RaptorLogger
- from mozdevice import ADBDevice
- from mozlog import commandline
- from mozpower import MozPower
- @@ -146,9 +147,19 @@ either Raptor or browsertime."""
- % self.post_startup_delay)
- LOG.info("main raptor init, config is: %s" % str(self.config))
- - self.build_browser_profile()
- + self.get_conditioned_profile()
- + # self.build_browser_profile()
- +
- + def get_conditioned_profile(self):
- + self.profile_dir = self.raptor_venv
- + LOG.info("Current dir when calling get_profile(): %s" % self.profile_dir)
- + get_profile(".", "macosx64", "cold", "default")
- + LOG.info("Conditioned profile's current (self.profile_dir) path: %s" % self.profile_dir)
- +
- + # share the profile dir with the config and the control server
- + self.config['local_profile_dir'] = self.profile_dir
- def build_browser_profile(self):
- self.profile = create_profile(self.profile_class)
- @@ -399,12 +410,17 @@ class Browsertime(Perftest):
- def run_test(self, test, timeout):
- self.run_test_setup(test)
- - browsertime_script = [os.path.join(os.path.dirname(__file__), "..",
- - "browsertime", "browsertime_pageload.js")]
- -
- - browsertime_script.extend(self.browsertime_args)
- + cmd = ([self.browsertime_node, self.browsertime_browsertimejs] +
- + self.driver_paths +
- + self.browsertime_args +
- + ['--skipHar',
- + '--video', 'true',
- + '--visualMetrics', 'false',
- + '-vv',
- + '--resultDir', self.results_handler.result_dir_for_test(test),
- + '-n', str(test.get('browser_cycles', 1)), test['test_url']])
- # timeout is a single page-load timeout value in ms from the test INI
- # convert timeout to seconds and account for browser cycles
- timeout = int(timeout / 1000) * int(test.get('browser_cycles', 1))
- @@ -416,35 +432,8 @@ class Browsertime(Perftest):
- # if geckoProfile enabled, give browser more time for profiling
- if self.config['gecko_profile'] is True:
- timeout += 5 * 60
- - # browsertime deals with page cycles internally, so we
- - # need to give it a timeout value that includes all cycles
- - timeout = timeout * int(test.get("page_cycles", 1))
- -
- - # pass a few extra options to the browsertime script
- - # XXX maybe these should be in the browsertime_args() func
- - browsertime_script.extend(["--browsertime.page_cycles",
- - str(test.get("page_cycles", 1))])
- - browsertime_script.extend(["--browsertime.url", test["test_url"]])
- -
- - # Raptor's `pageCycleDelay` delay (ms) between pageload cycles
- - browsertime_script.extend(["--browsertime.page_cycle_delay", "1000"])
- - # Raptor's `foregroundDelay` delay (ms) for foregrounding app
- - browsertime_script.extend(["--browsertime.foreground_delay", "5000"])
- -
- - # the browser time script cannot restart the browser itself,
- - # so we have to keep -n option here.
- - cmd = ([self.browsertime_node, self.browsertime_browsertimejs] +
- - self.driver_paths +
- - browsertime_script +
- - ['--skipHar',
- - '--video', 'false',
- - '--visualMetrics', 'false',
- - '-vv',
- - '--resultDir', self.results_handler.result_dir_for_test(test),
- - '-n', str(test.get('browser_cycles', 1))])
- -
- LOG.info('timeout (s): {}'.format(timeout))
- LOG.info('browsertime cwd: {}'.format(os.getcwd()))
- LOG.info('browsertime cmd: {}'.format(cmd))
- LOG.info('browsertime_ffmpeg: {}'.format(self.browsertime_ffmpeg))
- @@ -611,13 +600,19 @@ class Raptor(Perftest):
- if self.control_server:
- # The control server and the browser profile are not well factored
- # at this time, so the start-up process overlaps. Accommodate.
- - self.control_server.user_profile = self.profile
- + self.control_server.user_profile = self.profile_dir
- def start_control_server(self):
- self.control_server = RaptorControlServer(self.results_handler, self.debug_mode)
- - self.control_server.user_profile = self.profile
- + LOG.info("We are in start_control_server(), about to set user_profile to self.profile_dir")
- + LOG.info("self.profile_dir is: %s" % self.profile_dir)
- + # LOG.info("self.profile.profile is: %s" % self.profile.profile)
- + self.control_server_profile_dir = os.getcwd()
- + LOG.info("Current directory is: %s" % self.control_server_profile_dir)
- +
- + self.control_server.user_profile = self.profile_dir
- self.control_server.start()
- if self.config['enable_control_server_wait']:
- self.control_server_wait_set('webext_shutdownBrowser')
- @@ -714,9 +709,9 @@ class RaptorDesktop(Raptor):
- 'processOutputLine': [self.output_handler],
- }
- runner_cls = runners[self.config['app']]
- self.runner = runner_cls(
- - self.config['binary'], profile=self.profile, process_args=process_args,
- + self.config['binary'], profile=self.profile_dir, process_args=process_args,
- symbols_path=self.config['symbols_path'])
- if self.config['enable_webrender']:
- self.runner.env['MOZ_WEBRENDER'] = '1'
- @@ -1336,8 +1331,9 @@ class RaptorAndroid(Raptor):
- # in debug mode, and running locally, leave the browser running
- if self.debug_mode and self.config['run_local']:
- LOG.info("* debug-mode enabled - please shutdown the browser manually...")
- + self.runner.wait(timeout=None)
- def check_for_crashes(self):
- super(RaptorAndroid, self).check_for_crashes()
- diff --git a/testing/raptor/requirements.txt b/testing/raptor/requirements.txt
- --- a/testing/raptor/requirements.txt
- +++ b/testing/raptor/requirements.txt
- @@ -1,4 +1,5 @@
- +/Users/sdonner/moz_src/mozilla-unified/testing/condprofile
- mozcrash ~= 1.0
- mozrunner ~= 7.0
- mozprofile ~= 2.1
- manifestparser >= 1.1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement