OLD | NEW |
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 datetime |
5 import re | 6 import re |
6 import string | 7 import string |
7 | 8 |
8 | 9 |
9 class Test(object): | 10 class Test(object): |
10 """ | 11 """ |
11 Base class for tests that can be retried after deapplying a previously | 12 Base class for tests that can be retried after deapplying a previously |
12 applied patch. | 13 applied patch. |
13 """ | 14 """ |
14 | 15 |
(...skipping 1840 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1855 @staticmethod | 1856 @staticmethod |
1856 def compile_targets(api): | 1857 def compile_targets(api): |
1857 """List of compile targets needed by this test.""" | 1858 """List of compile targets needed by this test.""" |
1858 return [] | 1859 return [] |
1859 | 1860 |
1860 def run(self, api, suffix, test_filter=None): | 1861 def run(self, api, suffix, test_filter=None): |
1861 api.chromium_android.coverage_report(upload=False) | 1862 api.chromium_android.coverage_report(upload=False) |
1862 api.chromium_android.get_changed_lines_for_revision() | 1863 api.chromium_android.get_changed_lines_for_revision() |
1863 api.chromium_android.incremental_coverage_report() | 1864 api.chromium_android.incremental_coverage_report() |
1864 | 1865 |
| 1866 class FindAnnotatedTest(Test): |
| 1867 test_apks = { |
| 1868 'android_webview_test_apk': 'AndroidWebViewTest', |
| 1869 'blimp_test_apk': 'BlimpTest', |
| 1870 'chrome_public_test_apk': 'ChromePublicTest', |
| 1871 'chrome_sync_shell_test_apk': 'ChromeSyncShellTest', |
| 1872 'content_shell_test_apk': 'ContentShellTest', |
| 1873 'system_webview_shell_layout_test_apk': 'SystemWebViewShellLayoutTest', |
| 1874 } |
| 1875 |
| 1876 @staticmethod |
| 1877 def compile_targets(api): |
| 1878 return FindAnnotatedTest.test_apks.keys() |
| 1879 |
| 1880 def failures(self, api, suffix): |
| 1881 return [] |
| 1882 |
| 1883 def run(self, api, suffix, test_filter=None): |
| 1884 try: |
| 1885 temp_output_dir = api.path.mkdtemp('annotated_tests_json_temp') |
| 1886 timestamp = datetime.datetime.utcnow() |
| 1887 timestamp_string = timestamp.strftime('%Y%m%dT%H%M%S') |
| 1888 |
| 1889 api.python( |
| 1890 'run find_annotated_tests.py', |
| 1891 api.path['checkout'].join( |
| 1892 'tools', 'android', 'find_annotated_tests.py'), |
| 1893 args = [ |
| 1894 '--test-apks', ' '.join(FindAnnotatedTest.test_apks.values()), |
| 1895 '--apk-output-dir', api.chromium.output_dir, |
| 1896 '--json-output-dir', temp_output_dir, |
| 1897 '--timestamp-string', timestamp_string, |
| 1898 '-v']) |
| 1899 api.gsutil.upload( |
| 1900 temp_output_dir.join( |
| 1901 '%s-android-chrome.json' % timestamp_string), |
| 1902 'chromium-annotated-tests', 'android') |
| 1903 finally: |
| 1904 api.file.rmtree('Delete temp out directory', temp_output_dir) |
1865 | 1905 |
1866 GOMA_TESTS = [ | 1906 GOMA_TESTS = [ |
1867 GTestTest('base_unittests'), | 1907 GTestTest('base_unittests'), |
1868 GTestTest('content_unittests'), | 1908 GTestTest('content_unittests'), |
1869 ] | 1909 ] |
OLD | NEW |