Bug 1393234 - Add --disable-stylo for AWSY. r=jmaher

MozReview-Commit-ID: Ap1BbJja358

--HG--
extra : rebase_source : 344b53eed4c1d25978ded238d5720b013e1515b0
This commit is contained in:
J. Ryan Stinnett 2017-08-24 17:48:58 -05:00
parent 20accb9807
commit 2b8c3809c2
3 changed files with 43 additions and 9 deletions

View File

@ -69,8 +69,10 @@ def create_suite(name, node, data_path):
}
if 'STYLO_FORCE_ENABLED' in os.environ and os.environ['STYLO_FORCE_ENABLED']:
suite['extraOptions'] = ["stylo"]
if 'STYLO_THREADS' in os.environ and os.environ['STYLO_THREADS'] == '1':
suite['extraOptions'] = ["stylo-sequential"]
if 'STYLO_FORCE_DISABLED' in os.environ and os.environ['STYLO_FORCE_DISABLED']:
suite['extraOptions'] = ["stylo-disabled"]
if 'STYLO_THREADS' in os.environ and os.environ['STYLO_THREADS'] == '1':
suite['extraOptions'] = ["stylo-sequential"]
update_checkpoint_paths(glob.glob(os.path.join(data_path, "memory-report*")))
total = 0

View File

@ -64,11 +64,23 @@ class MachCommands(MachCommandBase):
kwargs['perTabPause'] = 1
kwargs['settleWaitTime'] = 1
if 'disable_stylo' in kwargs and kwargs['disable_stylo']:
if 'single_stylo_traversal' in kwargs and kwargs['single_stylo_traversal']:
print("--disable-stylo conflicts with --single-stylo-traversal")
return 1
if 'enable_stylo' in kwargs and kwargs['enable_stylo']:
print("--disable-stylo conflicts with --enable-stylo")
return 1
if 'single_stylo_traversal' in kwargs and kwargs['single_stylo_traversal']:
os.environ['STYLO_THREADS'] = '1'
else:
os.environ['STYLO_THREADS'] = '4'
if 'enable_stylo' in kwargs and kwargs['enable_stylo']:
os.environ['STYLO_FORCE_ENABLED'] = '1'
os.environ['STYLO_THREADS'] = '4'
if 'single_stylo_traversal' in kwargs and kwargs['single_stylo_traversal']:
os.environ['STYLO_THREADS'] = '1'
if 'disable_stylo' in kwargs and kwargs['disable_stylo']:
os.environ['STYLO_FORCE_DISABLED'] = '1'
runtime_testvars = {}
for arg in ('webRootDir', 'pageManifest', 'resultsDir', 'entities', 'iterations',
@ -190,7 +202,10 @@ class MachCommands(MachCommandBase):
'Defaults to %s.' % SETTLE_WAIT_TIME)
@CommandArgument('--enable-stylo', group='AWSY', action='store_true',
dest='enable_stylo', default=False,
help='Enable stylo.')
help='Enable Stylo.')
@CommandArgument('--disable-stylo', group='AWSY', action='store_true',
dest='disable_stylo', default=False,
help='Disable Stylo.')
@CommandArgument('--single-stylo-traversal', group='AWSY', action='store_true',
dest='single_stylo_traversal', default=False,
help='Set STYLO_THREADS=1.')

View File

@ -43,6 +43,12 @@ class AWSY(TestingMixin, MercurialScript, BlobUploadMixin, TooltoolMixin, CodeCo
"default": False,
"help": "Run tests with Stylo enabled.",
}],
[["--disable-stylo"],
{"action": "store_true",
"dest": "disable_stylo",
"default": False,
"help": "Run tests with Stylo disabled.",
}],
[["--single-stylo-traversal"],
{"action": "store_true",
"dest": "single_stylo_traversal",
@ -170,11 +176,22 @@ class AWSY(TestingMixin, MercurialScript, BlobUploadMixin, TooltoolMixin, CodeCo
test_file = os.path.join(self.awsy_libdir, 'test_memory_usage.py')
cmd.append(test_file)
if self.config['disable_stylo']:
if self.config['single_stylo_traversal']:
self.fatal("--disable-stylo conflicts with --single-stylo-traversal")
if self.config['enable_stylo']:
self.fatal("--disable-stylo conflicts with --enable-stylo")
if self.config['single_stylo_traversal']:
env['STYLO_THREADS'] = '1'
else:
env['STYLO_THREADS'] = '4'
if self.config['enable_stylo']:
env['STYLO_FORCE_ENABLED'] = '1'
env['STYLO_THREADS'] = '4'
if self.config['single_stylo_traversal']:
env['STYLO_THREADS'] = '1'
if self.config['disable_stylo']:
env['STYLO_FORCE_DISABLED'] = '1'
env['MOZ_UPLOAD_DIR'] = dirs['abs_blob_upload_dir']
if not os.path.isdir(env['MOZ_UPLOAD_DIR']):
self.mkdir_p(env['MOZ_UPLOAD_DIR'])