Advertisement
Guest User

Untitled

a guest
Oct 19th, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.36 KB | None | 0 0
  1. diff --git a/testing/raptor/raptor/raptor.py b/testing/raptor/raptor/raptor.py
  2. --- a/testing/raptor/raptor/raptor.py
  3. +++ b/testing/raptor/raptor/raptor.py
  4. @@ -20,8 +20,9 @@ import requests
  5.  
  6. import mozcrash
  7. import mozinfo
  8. import mozprocess
  9. +from condprof.client import get_profile
  10. from logger.logger import RaptorLogger
  11. from mozdevice import ADBDevice
  12. from mozlog import commandline
  13. from mozpower import MozPower
  14. @@ -146,9 +147,19 @@ either Raptor or browsertime."""
  15. % self.post_startup_delay)
  16.  
  17. LOG.info("main raptor init, config is: %s" % str(self.config))
  18.  
  19. - self.build_browser_profile()
  20. + self.get_conditioned_profile()
  21. + # self.build_browser_profile()
  22. +
  23. + def get_conditioned_profile(self):
  24. + self.profile_dir = self.raptor_venv
  25. + LOG.info("Current dir when calling get_profile(): %s" % self.profile_dir)
  26. + get_profile(".", "macosx64", "cold", "default")
  27. + LOG.info("Conditioned profile's current (self.profile_dir) path: %s" % self.profile_dir)
  28. +
  29. + # share the profile dir with the config and the control server
  30. + self.config['local_profile_dir'] = self.profile_dir
  31.  
  32. def build_browser_profile(self):
  33. self.profile = create_profile(self.profile_class)
  34.  
  35. @@ -399,12 +410,17 @@ class Browsertime(Perftest):
  36. def run_test(self, test, timeout):
  37.  
  38. self.run_test_setup(test)
  39.  
  40. - browsertime_script = [os.path.join(os.path.dirname(__file__), "..",
  41. - "browsertime", "browsertime_pageload.js")]
  42. -
  43. - browsertime_script.extend(self.browsertime_args)
  44. + cmd = ([self.browsertime_node, self.browsertime_browsertimejs] +
  45. + self.driver_paths +
  46. + self.browsertime_args +
  47. + ['--skipHar',
  48. + '--video', 'true',
  49. + '--visualMetrics', 'false',
  50. + '-vv',
  51. + '--resultDir', self.results_handler.result_dir_for_test(test),
  52. + '-n', str(test.get('browser_cycles', 1)), test['test_url']])
  53.  
  54. # timeout is a single page-load timeout value in ms from the test INI
  55. # convert timeout to seconds and account for browser cycles
  56. timeout = int(timeout / 1000) * int(test.get('browser_cycles', 1))
  57. @@ -416,35 +432,8 @@ class Browsertime(Perftest):
  58. # if geckoProfile enabled, give browser more time for profiling
  59. if self.config['gecko_profile'] is True:
  60. timeout += 5 * 60
  61.  
  62. - # browsertime deals with page cycles internally, so we
  63. - # need to give it a timeout value that includes all cycles
  64. - timeout = timeout * int(test.get("page_cycles", 1))
  65. -
  66. - # pass a few extra options to the browsertime script
  67. - # XXX maybe these should be in the browsertime_args() func
  68. - browsertime_script.extend(["--browsertime.page_cycles",
  69. - str(test.get("page_cycles", 1))])
  70. - browsertime_script.extend(["--browsertime.url", test["test_url"]])
  71. -
  72. - # Raptor's `pageCycleDelay` delay (ms) between pageload cycles
  73. - browsertime_script.extend(["--browsertime.page_cycle_delay", "1000"])
  74. - # Raptor's `foregroundDelay` delay (ms) for foregrounding app
  75. - browsertime_script.extend(["--browsertime.foreground_delay", "5000"])
  76. -
  77. - # the browser time script cannot restart the browser itself,
  78. - # so we have to keep -n option here.
  79. - cmd = ([self.browsertime_node, self.browsertime_browsertimejs] +
  80. - self.driver_paths +
  81. - browsertime_script +
  82. - ['--skipHar',
  83. - '--video', 'false',
  84. - '--visualMetrics', 'false',
  85. - '-vv',
  86. - '--resultDir', self.results_handler.result_dir_for_test(test),
  87. - '-n', str(test.get('browser_cycles', 1))])
  88. -
  89. LOG.info('timeout (s): {}'.format(timeout))
  90. LOG.info('browsertime cwd: {}'.format(os.getcwd()))
  91. LOG.info('browsertime cmd: {}'.format(cmd))
  92. LOG.info('browsertime_ffmpeg: {}'.format(self.browsertime_ffmpeg))
  93. @@ -611,13 +600,19 @@ class Raptor(Perftest):
  94.  
  95. if self.control_server:
  96. # The control server and the browser profile are not well factored
  97. # at this time, so the start-up process overlaps. Accommodate.
  98. - self.control_server.user_profile = self.profile
  99. + self.control_server.user_profile = self.profile_dir
  100.  
  101. def start_control_server(self):
  102. self.control_server = RaptorControlServer(self.results_handler, self.debug_mode)
  103. - self.control_server.user_profile = self.profile
  104. + LOG.info("We are in start_control_server(), about to set user_profile to self.profile_dir")
  105. + LOG.info("self.profile_dir is: %s" % self.profile_dir)
  106. + # LOG.info("self.profile.profile is: %s" % self.profile.profile)
  107. + self.control_server_profile_dir = os.getcwd()
  108. + LOG.info("Current directory is: %s" % self.control_server_profile_dir)
  109. +
  110. + self.control_server.user_profile = self.profile_dir
  111. self.control_server.start()
  112.  
  113. if self.config['enable_control_server_wait']:
  114. self.control_server_wait_set('webext_shutdownBrowser')
  115. @@ -714,9 +709,9 @@ class RaptorDesktop(Raptor):
  116. 'processOutputLine': [self.output_handler],
  117. }
  118. runner_cls = runners[self.config['app']]
  119. self.runner = runner_cls(
  120. - self.config['binary'], profile=self.profile, process_args=process_args,
  121. + self.config['binary'], profile=self.profile_dir, process_args=process_args,
  122. symbols_path=self.config['symbols_path'])
  123.  
  124. if self.config['enable_webrender']:
  125. self.runner.env['MOZ_WEBRENDER'] = '1'
  126. @@ -1336,8 +1331,9 @@ class RaptorAndroid(Raptor):
  127.  
  128. # in debug mode, and running locally, leave the browser running
  129. if self.debug_mode and self.config['run_local']:
  130. LOG.info("* debug-mode enabled - please shutdown the browser manually...")
  131. + self.runner.wait(timeout=None)
  132.  
  133. def check_for_crashes(self):
  134. super(RaptorAndroid, self).check_for_crashes()
  135.  
  136. diff --git a/testing/raptor/requirements.txt b/testing/raptor/requirements.txt
  137. --- a/testing/raptor/requirements.txt
  138. +++ b/testing/raptor/requirements.txt
  139. @@ -1,4 +1,5 @@
  140. +/Users/sdonner/moz_src/mozilla-unified/testing/condprofile
  141. mozcrash ~= 1.0
  142. mozrunner ~= 7.0
  143. mozprofile ~= 2.1
  144. manifestparser >= 1.1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement