Bug 1467837 - adjust some code for test-coverage gpu/chunks and minor cleanup in per test code. r=gbrown

This commit is contained in:
Joel Maher 2018-06-08 16:21:14 -04:00
Родитель 5dad9cd69b
Коммит 8ee7eee7e1
5 изменённых файлов: 76 добавлений и 30 удалений

Просмотреть файл

@ -205,3 +205,42 @@ test-coverage:
- unittests/win_taskcluster_unittest.py
extra-options:
- --per-test-coverage
test-coverage-gpu:
description: "Per-test coverage for tests that require gpu instances"
suite: test-coverage
treeherder-symbol: TCg
loopback-video: true
virtualization: virtual-with-gpu
instance-size: default
max-run-time: 10800
allow-software-gl-layers: false
run-on-projects:
by-test-platform:
# only run on mozilla-central and try.
.*-ccov/.*: ['mozilla-central', 'try']
default: []
tier:
by-test-platform:
windows10-64-asan.*: 3
default: 2
mozharness:
script:
by-test-platform:
android.*: android_emulator_unittest.py
default: desktop_unittest.py
config:
by-test-platform:
android.*:
- android/android_common.py
- android/androidarm_4_3.py
linux.*:
- unittests/linux_unittest.py
- remove_executables.py
macosx.*:
- unittests/mac_unittest.py
windows.*:
- unittests/win_taskcluster_unittest.py
extra-options:
- --per-test-coverage
- --gpu-required

Просмотреть файл

@ -19,8 +19,9 @@ logger = logging.getLogger(__name__)
@memoize
def perfile_number_of_chunks(try_task_config, head_repository, head_rev, type):
# TODO: Make this flexible based on coverage vs verify || test type
tests_per_chunk = 10.0
if type.startswith('test-coverage'):
tests_per_chunk = 30.0
if type.startswith('test-verify-wpt') or type.startswith('test-coverage-wpt'):
file_patterns = ['testing/web-platform/tests/**',

Просмотреть файл

@ -92,35 +92,37 @@ class SingleTestMixin(object):
# automation-relevance uses posixpath.sep
file = file.replace(posixpath.sep, os.sep)
entry = tests_by_path.get(file)
if entry:
if gpu and entry[1] not in ['gpu', 'webgl']:
continue
elif not gpu and entry[1] in ['gpu', 'webgl']:
continue
if not entry:
continue
self.info("Per-test run found test %s" % file)
subsuite_mapping = {
('browser-chrome', 'clipboard'): 'browser-chrome-clipboard',
('chrome', 'clipboard'): 'chrome-clipboard',
('plain', 'clipboard'): 'plain-clipboard',
('browser-chrome', 'devtools'): 'mochitest-devtools-chrome',
('browser-chrome', 'screenshots'): 'browser-chrome-screenshots',
('plain', 'media'): 'mochitest-media',
# below should be on test-verify-gpu job
('browser-chrome', 'gpu'): 'browser-chrome-gpu',
('chrome', 'gpu'): 'chrome-gpu',
('plain', 'gpu'): 'plain-gpu',
('plain', 'webgl'): 'mochitest-gl',
}
if entry in subsuite_mapping:
suite = subsuite_mapping[entry]
else:
suite = entry[0]
suite_files = self.suites.get(suite)
if not suite_files:
suite_files = []
suite_files.append(file)
self.suites[suite] = suite_files
if gpu and entry[1] not in ['gpu', 'webgl']:
continue
elif not gpu and entry[1] in ['gpu', 'webgl']:
continue
self.info("Per-test run found test %s (%s)" % (file, entry[0]))
subsuite_mapping = {
('browser-chrome', 'clipboard'): 'browser-chrome-clipboard',
('chrome', 'clipboard'): 'chrome-clipboard',
('plain', 'clipboard'): 'plain-clipboard',
('browser-chrome', 'devtools'): 'mochitest-devtools-chrome',
('browser-chrome', 'screenshots'): 'browser-chrome-screenshots',
('plain', 'media'): 'mochitest-media',
# below should be on test-verify-gpu job
('browser-chrome', 'gpu'): 'browser-chrome-gpu',
('chrome', 'gpu'): 'chrome-gpu',
('plain', 'gpu'): 'plain-gpu',
('plain', 'webgl'): 'mochitest-gl',
}
if entry in subsuite_mapping:
suite = subsuite_mapping[entry]
else:
suite = entry[0]
suite_files = self.suites.get(suite)
if not suite_files:
suite_files = []
suite_files.append(file)
self.suites[suite] = suite_files
def _find_wpt_tests(self, dirs, changed_files):
# Setup sys.path to include all the dependencies required to import
@ -199,7 +201,7 @@ class SingleTestMixin(object):
if self.config.get('per_test_category') == "web-platform":
self._find_wpt_tests(dirs, changed_files)
elif self.config.get('gpu_required'):
elif self.config.get('gpu_required', 'False') != 'False':
self._find_misc_tests(dirs, changed_files, gpu=True)
else:
self._find_misc_tests(dirs, changed_files)

Просмотреть файл

@ -769,6 +769,8 @@ class DesktopUnittest(TestingMixin, MercurialScript, MozbaseMixin,
max_per_test_time = timedelta(minutes=60)
max_per_test_tests = 10
if self.per_test_coverage:
max_per_test_tests = 30
executed_tests = 0
executed_too_many_tests = False

Просмотреть файл

@ -318,6 +318,8 @@ class WebPlatformTest(TestingMixin, MercurialScript, CodeCoverageMixin):
start_time = datetime.now()
max_per_test_time = timedelta(minutes=60)
max_per_test_tests = 10
if self.per_test_coverage:
max_per_test_tests = 30
executed_tests = 0
executed_too_many_tests = False