Backed out changeset 387c7e65c6ef (bug 979512) for Gu bustage.

This commit is contained in:
Ryan VanderMeulen 2014-03-19 09:22:58 -04:00
parent 6fbe4b10fe
commit 06089e4a9a

View File

@ -463,14 +463,6 @@ class BaseMarionetteOptions(OptionParser):
dest='shuffle', dest='shuffle',
default=False, default=False,
help='run tests in a random order') help='run tests in a random order')
self.add_option('--total-chunks',
dest='total_chunks',
type=int,
help='how many chunks to split the tests up into')
self.add_option('--this-chunk',
dest='this_chunk',
type=int,
help='which chunk to run')
def parse_args(self, args=None, values=None): def parse_args(self, args=None, values=None):
options, tests = OptionParser.parse_args(self, args, values) options, tests = OptionParser.parse_args(self, args, values)
@ -508,18 +500,6 @@ class BaseMarionetteOptions(OptionParser):
raise ValueError('Invalid emulator resolution format. ' raise ValueError('Invalid emulator resolution format. '
'Should be like "480x800".') 'Should be like "480x800".')
if options.total_chunks is not None and options.this_chunk is None:
self.error('You must specify which chunk to run.')
if options.this_chunk is not None and options.total_chunks is None:
self.error('You must specify how many chunks to split the tests into.')
if options.total_chunks is not None:
if not 1 <= options.total_chunks:
self.error('Total chunks must be greater than 1.')
if not 1 <= options.this_chunk <= options.total_chunks:
self.error('Chunk to run must be between 1 and %s.' % options.total_chunks)
for handler in self.verify_usage_handlers: for handler in self.verify_usage_handlers:
handler(options, tests) handler(options, tests)
@ -537,7 +517,7 @@ class BaseMarionetteTestRunner(object):
logcat_dir=None, xml_output=None, repeat=0, gecko_path=None, logcat_dir=None, xml_output=None, repeat=0, gecko_path=None,
testvars=None, tree=None, type=None, device_serial=None, testvars=None, tree=None, type=None, device_serial=None,
symbols_path=None, timeout=None, es_servers=None, shuffle=False, symbols_path=None, timeout=None, es_servers=None, shuffle=False,
sdcard=None, this_chunk=1, total_chunks=1, **kwargs): sdcard=None, **kwargs):
self.address = address self.address = address
self.emulator = emulator self.emulator = emulator
self.emulatorBinary = emulatorBinary self.emulatorBinary = emulatorBinary
@ -572,8 +552,6 @@ class BaseMarionetteTestRunner(object):
self.es_servers = es_servers self.es_servers = es_servers
self.shuffle = shuffle self.shuffle = shuffle
self.sdcard = sdcard self.sdcard = sdcard
self.this_chunk = this_chunk
self.total_chunks = total_chunks
self.mixin_run_tests = [] self.mixin_run_tests = []
self.manifest_skipped_tests = [] self.manifest_skipped_tests = []
self.tests = [] self.tests = []
@ -974,20 +952,6 @@ class BaseMarionetteTestRunner(object):
break break
def run_test_sets(self): def run_test_sets(self):
if self.total_chunks > len(self.tests):
raise ValueError('Total number of chunks must be between 1 and %d.' % len(self.tests))
if not self.total_chunks == 1:
chunks = [[] for i in range(self.total_chunks)]
for i, test in enumerate(self.tests):
target_chunk = i % self.total_chunks
chunks[target_chunk].append(test)
self.logger.info('Running chunk %d of %d (%d tests selected from a '
'total of %d)' % (self.this_chunk, self.total_chunks,
len(chunks[self.this_chunk - 1]),
len(self.tests)))
self.tests = chunks[self.this_chunk - 1]
oop_tests = [x for x in self.tests if x.get('oop')] oop_tests = [x for x in self.tests if x.get('oop')]
self.run_test_set(oop_tests) self.run_test_set(oop_tests)