Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(222)

Side by Side Diff: scripts/slave/recipe_modules/chromium_tests/steps.py

Issue 1678273003: Split out instrumentation test name map for further use. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Added comment. Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import re 5 import re
6 import string 6 import string
7 7
8 8
9 class Test(object): 9 class Test(object):
10 """ 10 """
(...skipping 1503 matching lines...) Expand 10 before | Expand all | Expand 10 after
1514 mock_test_results = { 1514 mock_test_results = {
1515 'per_iteration_data': [{'TestA': [{'status': 'SUCCESS'}]}, 1515 'per_iteration_data': [{'TestA': [{'status': 'SUCCESS'}]},
1516 {'TestB': [{'status': 'FAILURE'}]}] 1516 {'TestB': [{'status': 'FAILURE'}]}]
1517 } 1517 }
1518 api.chromium_android.run_java_unit_test_suite( 1518 api.chromium_android.run_java_unit_test_suite(
1519 self.name, verbose=True, suffix=suffix, 1519 self.name, verbose=True, suffix=suffix,
1520 json_results_file=json_results_file, 1520 json_results_file=json_results_file,
1521 step_test_data=lambda: api.json.test_api.output(mock_test_results)) 1521 step_test_data=lambda: api.json.test_api.output(mock_test_results))
1522 1522
1523 1523
1524 # Provide a 1:1 mapping between CamelCase and snake_case instrumentation test
1525 # names. This provides a migration path to using swarming+isolates, which
1526 # specify additional build targets in src/ instead of here.
1527 ANDROID_INSTRUMENTATION_TARGET_MAP = {
1528 'AndroidWebViewTest': 'android_webview_test_apk',
1529 'ChromePublicTest': 'chrome_public_test_apk',
1530 'ChromeSyncShellTest': 'chrome_sync_shell_test_apk',
1531 'ChromotingTest': 'remoting_test_apk',
1532 'ContentShellTest': 'content_shell_test_apk',
1533 'MojoTest': 'mojo_test_apk',
1534 'SystemWebViewShellLayoutTest': 'system_webview_shell_layout_test_apk',
1535 }
1536
1537
1524 class AndroidInstrumentationTest(AndroidTest): 1538 class AndroidInstrumentationTest(AndroidTest):
1525 _DEFAULT_SUITES = { 1539 _DEFAULT_SUITES = {
1526 'AndroidWebViewTest': { 1540 'AndroidWebViewTest': {
1527 'compile_targets': ['android_webview_test_apk'],
1528 'isolate_file_path': 'android_webview/android_webview_test_apk.isolate', 1541 'isolate_file_path': 'android_webview/android_webview_test_apk.isolate',
1529 'apk_under_test': 'AndroidWebView.apk', 1542 'apk_under_test': 'AndroidWebView.apk',
1530 'test_apk': 'AndroidWebViewTest.apk', 1543 'test_apk': 'AndroidWebViewTest.apk',
1531 }, 1544 },
1532 'ChromePublicTest': { 1545 'ChromePublicTest': {
1533 'compile_targets': ['chrome_public_test_apk'],
1534 'isolate_file_path': 'chrome/chrome_public_test_apk.isolate', 1546 'isolate_file_path': 'chrome/chrome_public_test_apk.isolate',
1535 'apk_under_test': 'ChromePublic.apk', 1547 'apk_under_test': 'ChromePublic.apk',
1536 'test_apk': 'ChromePublicTest.apk', 1548 'test_apk': 'ChromePublicTest.apk',
1537 'additional_apks': [ 1549 'additional_apks': [
1538 'ChromePublicTestSupport.apk', 1550 'ChromePublicTestSupport.apk',
1539 'ChromiumNetTestSupport.apk', 1551 'ChromiumNetTestSupport.apk',
1540 ], 1552 ],
1541 }, 1553 },
1542 'ChromeSyncShellTest': { 1554 'ChromeSyncShellTest': {
1543 'compile_targets': ['chrome_sync_shell_test_apk'],
1544 'isolate_file_path': None, 1555 'isolate_file_path': None,
1545 'apk_under_test': 'ChromeSyncShell.apk', 1556 'apk_under_test': 'ChromeSyncShell.apk',
1546 'test_apk': 'ChromeSyncShellTest.apk', 1557 'test_apk': 'ChromeSyncShellTest.apk',
1547 }, 1558 },
1548 'ChromotingTest': { 1559 'ChromotingTest': {
1549 'compile_targets': ['remoting_test_apk'],
1550 'isolate_file_path': None, 1560 'isolate_file_path': None,
1551 'apk_under_test': 'Chromoting.apk', 1561 'apk_under_test': 'Chromoting.apk',
1552 'test_apk': 'ChromotingTest.apk', 1562 'test_apk': 'ChromotingTest.apk',
1553 }, 1563 },
1554 'ContentShellTest': { 1564 'ContentShellTest': {
1555 'compile_targets': ['content_shell_test_apk'],
1556 'isolate_file_path': 'content/content_shell_test_apk.isolate', 1565 'isolate_file_path': 'content/content_shell_test_apk.isolate',
1557 'apk_under_test': 'ContentShell.apk', 1566 'apk_under_test': 'ContentShell.apk',
1558 'test_apk': 'ContentShellTest.apk', 1567 'test_apk': 'ContentShellTest.apk',
1559 }, 1568 },
1560 'SystemWebViewShellLayoutTest': { 1569 'SystemWebViewShellLayoutTest': {
1561 'compile_targets': ['system_webview_apk', 1570 'extra_compile_targets': ['system_webview_apk',
1562 'system_webview_shell_apk', 1571 'system_webview_shell_apk',
1563 'system_webview_shell_layout_test_apk', 1572 'android_tools'],
1564 'android_tools'],
1565 'isolate_file_path': ('android_webview/' 1573 'isolate_file_path': ('android_webview/'
1566 'system_webview_shell_test_apk.isolate'), 1574 'system_webview_shell_test_apk.isolate'),
1567 'apk_under_test': 'SystemWebViewShell.apk', 1575 'apk_under_test': 'SystemWebViewShell.apk',
1568 'test_apk': 'SystemWebViewShellLayoutTest.apk', 1576 'test_apk': 'SystemWebViewShellLayoutTest.apk',
1569 'additional_apks': ['SystemWebView.apk'], 1577 'additional_apks': ['SystemWebView.apk'],
1570 }, 1578 },
1571 'MojoTest': { 1579 'MojoTest': {
1572 'compile_targets': ['mojo_test_apk'],
1573 'isolate_file_path': None, 1580 'isolate_file_path': None,
1574 'apk_under_test': None, 1581 'apk_under_test': None,
1575 'test_apk': 'MojoTest.apk', 1582 'test_apk': 'MojoTest.apk',
1576 } 1583 }
1577 } 1584 }
1578 1585
1579 def __init__(self, name, compile_targets=None, apk_under_test=None, 1586 def __init__(self, name, compile_targets=None, apk_under_test=None,
1580 test_apk=None, isolate_file_path=None, timeout_scale=None, 1587 test_apk=None, isolate_file_path=None, timeout_scale=None,
1581 flakiness_dashboard='test-results.appspot.com', 1588 flakiness_dashboard='test-results.appspot.com',
1582 annotation=None, except_annotation=None, screenshot=False, 1589 annotation=None, except_annotation=None, screenshot=False,
1583 verbose=True, tool=None, host_driven_root=None, 1590 verbose=True, tool=None, host_driven_root=None,
1584 additional_apks=None): 1591 additional_apks=None):
1585 suite_defaults = AndroidInstrumentationTest._DEFAULT_SUITES.get(name, {}) 1592 suite_defaults = AndroidInstrumentationTest._DEFAULT_SUITES.get(name, {})
1593 if not compile_targets:
1594 compile_targets = []
1595 main_target = ANDROID_INSTRUMENTATION_TARGET_MAP.get(name)
1596 if main_target:
1597 compile_targets.append(main_target)
1598 compile_targets.extend(suite_defaults.get('extra_compile_targets', []))
1599
1586 super(AndroidInstrumentationTest, self).__init__( 1600 super(AndroidInstrumentationTest, self).__init__(
1587 name, 1601 name,
1588 compile_targets or suite_defaults.get('compile_targets'), 1602 compile_targets,
1589 isolate_file_path or suite_defaults.get('isolate_file_path')) 1603 isolate_file_path or suite_defaults.get('isolate_file_path'))
1590 self._additional_apks = ( 1604 self._additional_apks = (
1591 additional_apks or suite_defaults.get('additional_apks')) 1605 additional_apks or suite_defaults.get('additional_apks'))
1592 self._annotation = annotation 1606 self._annotation = annotation
1593 self._apk_under_test = ( 1607 self._apk_under_test = (
1594 apk_under_test or suite_defaults.get('apk_under_test')) 1608 apk_under_test or suite_defaults.get('apk_under_test'))
1595 self._except_annotation = except_annotation 1609 self._except_annotation = except_annotation
1596 self._flakiness_dashboard = flakiness_dashboard 1610 self._flakiness_dashboard = flakiness_dashboard
1597 self._host_driven_root = host_driven_root 1611 self._host_driven_root = host_driven_root
1598 self._screenshot = screenshot 1612 self._screenshot = screenshot
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
1831 def run(self, api, suffix, test_filter=None): 1845 def run(self, api, suffix, test_filter=None):
1832 api.chromium_android.coverage_report(upload=False) 1846 api.chromium_android.coverage_report(upload=False)
1833 api.chromium_android.get_changed_lines_for_revision() 1847 api.chromium_android.get_changed_lines_for_revision()
1834 api.chromium_android.incremental_coverage_report() 1848 api.chromium_android.incremental_coverage_report()
1835 1849
1836 1850
1837 GOMA_TESTS = [ 1851 GOMA_TESTS = [
1838 GTestTest('base_unittests'), 1852 GTestTest('base_unittests'),
1839 GTestTest('content_unittests'), 1853 GTestTest('content_unittests'),
1840 ] 1854 ]
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698