| OLD | NEW |
| 1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 2013 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 argparse | 5 import argparse |
| 6 import datetime | 6 import datetime |
| 7 import random | 7 import random |
| 8 import re | 8 import re |
| 9 import urllib | 9 import urllib |
| 10 | 10 |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 env['CXX'] = self.c.gyp_env.CXX | 257 env['CXX'] = self.c.gyp_env.CXX |
| 258 if self.c.gyp_env.LINK: | 258 if self.c.gyp_env.LINK: |
| 259 env['LINK'] = self.c.gyp_env.LINK | 259 env['LINK'] = self.c.gyp_env.LINK |
| 260 if self.c.gyp_env.RANLIB: | 260 if self.c.gyp_env.RANLIB: |
| 261 env['RANLIB'] = self.c.gyp_env.RANLIB | 261 env['RANLIB'] = self.c.gyp_env.RANLIB |
| 262 # TODO(machenbach): Make this the default on windows. | 262 # TODO(machenbach): Make this the default on windows. |
| 263 if self.m.chromium.c.gyp_env.GYP_MSVS_VERSION: | 263 if self.m.chromium.c.gyp_env.GYP_MSVS_VERSION: |
| 264 env['GYP_MSVS_VERSION'] = self.m.chromium.c.gyp_env.GYP_MSVS_VERSION | 264 env['GYP_MSVS_VERSION'] = self.m.chromium.c.gyp_env.GYP_MSVS_VERSION |
| 265 self.m.chromium.runhooks(env=env, **kwargs) | 265 self.m.chromium.runhooks(env=env, **kwargs) |
| 266 | 266 |
| 267 @property | |
| 268 def build_environment(self): | |
| 269 if self.m.properties.get('build_environment'): | |
| 270 return self.m.properties['build_environment'] | |
| 271 if self.bot_type == 'tester': | |
| 272 return None | |
| 273 build_environment = dict( | |
| 274 (k, v) for (k, v) in self.m.chromium.c.gyp_env.as_jsonish().iteritems() | |
| 275 if k.startswith('GYP') and v is not None | |
| 276 ) | |
| 277 build_environment.update(self.c.gyp_env.as_jsonish()) | |
| 278 if 'GYP_DEFINES' in build_environment: | |
| 279 # Filter out gomadir. | |
| 280 build_environment['GYP_DEFINES'] = ' '.join( | |
| 281 d for d in build_environment['GYP_DEFINES'].split() | |
| 282 if not d.startswith('gomadir') | |
| 283 ) | |
| 284 return build_environment | |
| 285 | |
| 286 def setup_mips_toolchain(self): | 267 def setup_mips_toolchain(self): |
| 287 mips_dir = self.m.path['slave_build'].join(MIPS_DIR, 'bin') | 268 mips_dir = self.m.path['slave_build'].join(MIPS_DIR, 'bin') |
| 288 if not self.m.path.exists(mips_dir): | 269 if not self.m.path.exists(mips_dir): |
| 289 self.m.gsutil.download_url( | 270 self.m.gsutil.download_url( |
| 290 'gs://chromium-v8/%s' % MIPS_TOOLCHAIN, | 271 'gs://chromium-v8/%s' % MIPS_TOOLCHAIN, |
| 291 self.m.path['slave_build'], | 272 self.m.path['slave_build'], |
| 292 name='bootstrapping mips toolchain') | 273 name='bootstrapping mips toolchain') |
| 293 self.m.step('unzipping', | 274 self.m.step('unzipping', |
| 294 ['tar', 'xf', MIPS_TOOLCHAIN], | 275 ['tar', 'xf', MIPS_TOOLCHAIN], |
| 295 cwd=self.m.path['slave_build']) | 276 cwd=self.m.path['slave_build']) |
| (...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 707 """Returns log lines for all results of a unique command.""" | 688 """Returns log lines for all results of a unique command.""" |
| 708 assert results | 689 assert results |
| 709 lines = [] | 690 lines = [] |
| 710 | 691 |
| 711 # Add common description for multiple runs. | 692 # Add common description for multiple runs. |
| 712 flaky_suffix = ' (flaky in a repeated run)' if flaky else '' | 693 flaky_suffix = ' (flaky in a repeated run)' if flaky else '' |
| 713 lines.append('Test: %s%s' % (results[0]['name'], flaky_suffix)) | 694 lines.append('Test: %s%s' % (results[0]['name'], flaky_suffix)) |
| 714 lines.append('Flags: %s' % ' '.join(results[0]['flags'])) | 695 lines.append('Flags: %s' % ' '.join(results[0]['flags'])) |
| 715 lines.append('Command: %s' % results[0]['command']) | 696 lines.append('Command: %s' % results[0]['command']) |
| 716 lines.append('') | 697 lines.append('') |
| 717 lines.append('Build environment:') | |
| 718 build_environment = self.build_environment | |
| 719 if build_environment is None: | |
| 720 lines.append( | |
| 721 'Not available. Please look up the builder\'s configuration.') | |
| 722 else: | |
| 723 for key in sorted(build_environment): | |
| 724 lines.append(' %s: %s' % (key, build_environment[key])) | |
| 725 lines.append('') | |
| 726 | 698 |
| 727 # Add results for each run of a command. | 699 # Add results for each run of a command. |
| 728 for result in sorted(results, key=lambda r: int(r['run'])): | 700 for result in sorted(results, key=lambda r: int(r['run'])): |
| 729 lines.append('Run #%d' % int(result['run'])) | 701 lines.append('Run #%d' % int(result['run'])) |
| 730 lines.append('Exit code: %s' % result['exit_code']) | 702 lines.append('Exit code: %s' % result['exit_code']) |
| 731 lines.append('Result: %s' % result['result']) | 703 lines.append('Result: %s' % result['result']) |
| 732 if result.get('expected'): | 704 if result.get('expected'): |
| 733 lines.append('Expected outcomes: %s' % ", ".join(result['expected'])) | 705 lines.append('Expected outcomes: %s' % ", ".join(result['expected'])) |
| 734 lines.append('Duration: %s' % V8Api.format_duration(result['duration'])) | 706 lines.append('Duration: %s' % V8Api.format_duration(result['duration'])) |
| 735 lines.append('') | 707 lines.append('') |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 966 rietveld=str(self.m.properties['rietveld']), | 938 rietveld=str(self.m.properties['rietveld']), |
| 967 ) | 939 ) |
| 968 else: | 940 else: |
| 969 # On non-tryservers, we can set the revision to whatever the | 941 # On non-tryservers, we can set the revision to whatever the |
| 970 # triggering builder checked out. | 942 # triggering builder checked out. |
| 971 properties['revision'] = self.revision | 943 properties['revision'] = self.revision |
| 972 | 944 |
| 973 # TODO(machenbach): Also set meaningful buildbucket tags of triggering | 945 # TODO(machenbach): Also set meaningful buildbucket tags of triggering |
| 974 # parent. | 946 # parent. |
| 975 | 947 |
| 976 # Pass build environment to testers if it doesn't exceed buildbot's | |
| 977 # limits. | |
| 978 # TODO(machenbach): Remove the check in the after-buildbot age. | |
| 979 if len(self.m.json.dumps(self.build_environment)) < 1024: | |
| 980 properties['build_environment'] = self.build_environment | |
| 981 | |
| 982 swarm_hashes = self.m.isolate.isolated_tests | 948 swarm_hashes = self.m.isolate.isolated_tests |
| 983 if swarm_hashes: | 949 if swarm_hashes: |
| 984 properties['swarm_hashes'] = swarm_hashes | 950 properties['swarm_hashes'] = swarm_hashes |
| 985 properties.update(**additional_properties) | 951 properties.update(**additional_properties) |
| 986 self.m.trigger(*[{ | 952 self.m.trigger(*[{ |
| 987 'builder_name': builder_name, | 953 'builder_name': builder_name, |
| 988 'properties': properties, | 954 'properties': properties, |
| 989 } for builder_name in triggers]) | 955 } for builder_name in triggers]) |
| 990 | 956 |
| 991 if triggers_proxy: | 957 if triggers_proxy: |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1124 def report_culprits(self, culprit_range): | 1090 def report_culprits(self, culprit_range): |
| 1125 assert culprit_range | 1091 assert culprit_range |
| 1126 if len(culprit_range) > 1: | 1092 if len(culprit_range) > 1: |
| 1127 text = 'Suspecting multiple commits' | 1093 text = 'Suspecting multiple commits' |
| 1128 else: | 1094 else: |
| 1129 text = 'Suspecting %s' % culprit_range[0][:8] | 1095 text = 'Suspecting %s' % culprit_range[0][:8] |
| 1130 | 1096 |
| 1131 step_result = self.m.step(text, cmd=None) | 1097 step_result = self.m.step(text, cmd=None) |
| 1132 for culprit in culprit_range: | 1098 for culprit in culprit_range: |
| 1133 step_result.presentation.links[culprit[:8]] = COMMIT_TEMPLATE % culprit | 1099 step_result.presentation.links[culprit[:8]] = COMMIT_TEMPLATE % culprit |
| OLD | NEW |