OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 | 2 |
3 # Copyright (c) 2014 The Chromium Authors. All rights reserved. | 3 # Copyright (c) 2014 The Chromium Authors. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 """Dartium buildbot steps | 7 """Dartium buildbot steps |
8 | 8 |
9 Archive dartium, content_shell, and chromedriver to the cloud storage bucket | 9 Archive dartium, content_shell, and chromedriver to the cloud storage bucket |
10 gs://dart-archive, and run tests, including the Dart layout tests. | 10 gs://dart-archive, and run tests, including the Dart layout tests. |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 cmd.append('--no-show-results') | 46 cmd.append('--no-show-results') |
47 | 47 |
48 if test_filter: | 48 if test_filter: |
49 cmd.append('--test-filter=' + test_filter) | 49 cmd.append('--test-filter=' + test_filter) |
50 | 50 |
51 status = subprocess.call(cmd) | 51 status = subprocess.call(cmd) |
52 if status != 0: | 52 if status != 0: |
53 print '@@@STEP_FAILURE@@@' | 53 print '@@@STEP_FAILURE@@@' |
54 return status | 54 return status |
55 | 55 |
| 56 def ClearTemp(): |
| 57 if platform.system() == 'Windows': |
| 58 shutil.rmtree('C:\\Users\\chrome-bot\\AppData\\Local\\Temp', |
| 59 ignore_errors=True) |
56 | 60 |
57 def Test(info, component, suite, checked, test_filter=None): | 61 def Test(info, component, suite, checked, test_filter=None): |
58 """Test a particular component (e.g., dartium or content_shell(drt)). | 62 """Test a particular component (e.g., dartium or content_shell(drt)). |
59 """ | 63 """ |
60 print '@@@BUILD_STEP %s_%s_%s_tests@@@' % (component, suite, checked) | 64 print '@@@BUILD_STEP %s_%s_%s_tests@@@' % (component, suite, checked) |
61 sys.stdout.flush() | 65 sys.stdout.flush() |
62 layout_test_results_dir = os.path.join(SRC_PATH, 'webkit', info.mode, | 66 layout_test_results_dir = os.path.join(SRC_PATH, 'webkit', info.mode, |
63 'layout-test-results') | 67 'layout-test-results') |
64 shutil.rmtree(layout_test_results_dir, ignore_errors=True) | 68 shutil.rmtree(layout_test_results_dir, ignore_errors=True) |
65 status = RunDartTests(info.mode, component, suite, info.arch, checked, | 69 status = RunDartTests(info.mode, component, suite, info.arch, checked, |
66 test_filter=test_filter) | 70 test_filter=test_filter) |
67 # Archive test failures | 71 # Archive test failures |
68 if suite == 'layout' and status != 0: | 72 if suite == 'layout' and status != 0: |
69 upload_steps.UploadDartTestsResults(layout_test_results_dir, | 73 upload_steps.UploadDartTestsResults(layout_test_results_dir, |
70 info.name, | 74 info.name, |
71 info.version, | 75 info.version, |
72 component, checked) | 76 component, checked) |
| 77 ClearTemp() |
73 return status | 78 return status |
74 | 79 |
75 | 80 |
76 def main(): | 81 def main(): |
77 # We need to chdir() to src/dart in order to get the correct revision number. | 82 # We need to chdir() to src/dart in order to get the correct revision number. |
78 with utils.ChangedWorkingDirectory(DART_PATH): | 83 with utils.ChangedWorkingDirectory(DART_PATH): |
79 dart_tools_utils = imp.load_source('dart_tools_utils', | 84 dart_tools_utils = imp.load_source('dart_tools_utils', |
80 os.path.join('tools', 'utils.py')) | 85 os.path.join('tools', 'utils.py')) |
81 dart_revision = dart_tools_utils.GetArchiveVersion() | 86 dart_revision = dart_tools_utils.GetArchiveVersion() |
82 | 87 |
83 version = '%s.0' % dart_revision | 88 version = '%s.0' % dart_revision |
84 info = upload_steps.BuildInfo(dart_revision, version) | 89 info = upload_steps.BuildInfo(dart_revision, version) |
85 | 90 |
86 result = 0 | 91 result = 0 |
87 | 92 |
88 # Archive to the revision bucket unless integration build | 93 # Archive to the revision bucket unless integration build |
89 if info.channel != 'integration': | 94 if info.channel != 'integration': |
90 result = upload_steps.ArchiveAndUpload(info, archive_latest=False) | 95 result = upload_steps.ArchiveAndUpload(info, archive_latest=False) |
91 # On dev/stable we archive to the latest bucket as well | 96 # On dev/stable we archive to the latest bucket as well |
92 if info.channel != 'be': | 97 if info.channel != 'be': |
93 result = (upload_steps.ArchiveAndUpload(info, archive_latest=True) | 98 result = (upload_steps.ArchiveAndUpload(info, archive_latest=True) |
94 or result) | 99 or result) |
95 | 100 |
96 # Run layout tests | 101 # Run layout tests |
97 if info.mode == 'Release' or platform.system() != 'Darwin': | 102 if info.mode == 'Release' or platform.system() != 'Darwin': |
98 result = Test(info, 'drt', 'layout', 'unchecked') or result | 103 result = Test(info, 'drt', 'layout', 'unchecked') or result |
99 result = Test(info, 'drt', 'layout', 'checked') or result | 104 result = Test(info, 'drt', 'layout', 'checked') or result |
100 | |
101 # Run dartium tests | 105 # Run dartium tests |
102 result = Test(info, 'dartium', 'core', 'unchecked') or result | 106 result = Test(info, 'dartium', 'core', 'unchecked') or result |
103 result = Test(info, 'dartium', 'core', 'checked') or result | 107 result = Test(info, 'dartium', 'core', 'checked') or result |
104 | 108 |
105 # Run ContentShell tests | 109 # Run ContentShell tests |
106 # NOTE: We don't run ContentShell tests on dartium-*-inc builders to keep | 110 # NOTE: We don't run ContentShell tests on dartium-*-inc builders to keep |
107 # cycle times down. | 111 # cycle times down. |
108 if not info.is_incremental: | 112 if not info.is_incremental: |
109 # If we run all checked tests on dartium, we restrict the number of | 113 # If we run all checked tests on dartium, we restrict the number of |
110 # unchecked tests on drt to DRT_FILTER | 114 # unchecked tests on drt to DRT_FILTER |
111 result = Test(info, 'drt', 'core', 'unchecked', | 115 result = Test(info, 'drt', 'core', 'unchecked', |
112 test_filter=DRT_FILTER) or result | 116 test_filter=DRT_FILTER) or result |
113 result = Test(info, 'drt', 'core', 'checked') or result | 117 result = Test(info, 'drt', 'core', 'checked') or result |
114 | 118 |
115 # On the 'be' channel, we only archive to the latest bucket if all tests were | 119 # On the 'be' channel, we only archive to the latest bucket if all tests were |
116 # successful. | 120 # successful. |
117 if result == 0 and info.channel == 'be': | 121 if result == 0 and info.channel == 'be': |
118 result = upload_steps.ArchiveAndUpload(info, archive_latest=True) or result | 122 result = upload_steps.ArchiveAndUpload(info, archive_latest=True) or result |
119 return result | 123 return result |
120 | 124 |
121 if __name__ == '__main__': | 125 if __name__ == '__main__': |
122 sys.exit(main()) | 126 sys.exit(main()) |
OLD | NEW |