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

Side by Side Diff: scripts/slave/recipe_modules/v8/api.py

Issue 1901103004: V8: Show build environment in failure logs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Created 4 years, 8 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
OLDNEW
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
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 build_environment = dict(
272 (k, v) for (k, v) in self.m.chromium.c.gyp_env.as_jsonish().iteritems()
273 if k.startswith('GYP') and v is not None
274 )
275 build_environment.update(self.c.gyp_env.as_jsonish())
276 if 'GYP_DEFINES' in build_environment:
277 # Filter out gomadir.
278 build_environment['GYP_DEFINES'] = ' '.join(
279 d for d in build_environment['GYP_DEFINES'].split()
280 if not d.startswith('gomadir')
281 )
282 return build_environment
283
267 def setup_mips_toolchain(self): 284 def setup_mips_toolchain(self):
268 mips_dir = self.m.path['slave_build'].join(MIPS_DIR, 'bin') 285 mips_dir = self.m.path['slave_build'].join(MIPS_DIR, 'bin')
269 if not self.m.path.exists(mips_dir): 286 if not self.m.path.exists(mips_dir):
270 self.m.gsutil.download_url( 287 self.m.gsutil.download_url(
271 'gs://chromium-v8/%s' % MIPS_TOOLCHAIN, 288 'gs://chromium-v8/%s' % MIPS_TOOLCHAIN,
272 self.m.path['slave_build'], 289 self.m.path['slave_build'],
273 name='bootstrapping mips toolchain') 290 name='bootstrapping mips toolchain')
274 self.m.step('unzipping', 291 self.m.step('unzipping',
275 ['tar', 'xf', MIPS_TOOLCHAIN], 292 ['tar', 'xf', MIPS_TOOLCHAIN],
276 cwd=self.m.path['slave_build']) 293 cwd=self.m.path['slave_build'])
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after
688 """Returns log lines for all results of a unique command.""" 705 """Returns log lines for all results of a unique command."""
689 assert results 706 assert results
690 lines = [] 707 lines = []
691 708
692 # Add common description for multiple runs. 709 # Add common description for multiple runs.
693 flaky_suffix = ' (flaky in a repeated run)' if flaky else '' 710 flaky_suffix = ' (flaky in a repeated run)' if flaky else ''
694 lines.append('Test: %s%s' % (results[0]['name'], flaky_suffix)) 711 lines.append('Test: %s%s' % (results[0]['name'], flaky_suffix))
695 lines.append('Flags: %s' % ' '.join(results[0]['flags'])) 712 lines.append('Flags: %s' % ' '.join(results[0]['flags']))
696 lines.append('Command: %s' % results[0]['command']) 713 lines.append('Command: %s' % results[0]['command'])
697 lines.append('') 714 lines.append('')
715 lines.append('Build environment:')
716 build_environment = self.build_environment
717 for i in sorted(build_environment):
tandrii(chromium) 2016/04/20 14:58:24 nit: s/i/k[ey]
Michael Achenbach 2016/04/21 14:41:33 Done.
718 lines.append(' %s: %s' % (i, build_environment[i]))
719 lines.append('')
698 720
699 # Add results for each run of a command. 721 # Add results for each run of a command.
700 for result in sorted(results, key=lambda r: int(r['run'])): 722 for result in sorted(results, key=lambda r: int(r['run'])):
701 lines.append('Run #%d' % int(result['run'])) 723 lines.append('Run #%d' % int(result['run']))
702 lines.append('Exit code: %s' % result['exit_code']) 724 lines.append('Exit code: %s' % result['exit_code'])
703 lines.append('Result: %s' % result['result']) 725 lines.append('Result: %s' % result['result'])
704 if result.get('expected'): 726 if result.get('expected'):
705 lines.append('Expected outcomes: %s' % ", ".join(result['expected'])) 727 lines.append('Expected outcomes: %s' % ", ".join(result['expected']))
706 lines.append('Duration: %s' % V8Api.format_duration(result['duration'])) 728 lines.append('Duration: %s' % V8Api.format_duration(result['duration']))
707 lines.append('') 729 lines.append('')
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
938 rietveld=str(self.m.properties['rietveld']), 960 rietveld=str(self.m.properties['rietveld']),
939 ) 961 )
940 else: 962 else:
941 # On non-tryservers, we can set the revision to whatever the 963 # On non-tryservers, we can set the revision to whatever the
942 # triggering builder checked out. 964 # triggering builder checked out.
943 properties['revision'] = self.revision 965 properties['revision'] = self.revision
944 966
945 # TODO(machenbach): Also set meaningful buildbucket tags of triggering 967 # TODO(machenbach): Also set meaningful buildbucket tags of triggering
946 # parent. 968 # parent.
947 969
970 # Pass build environment to testers.
971 properties['build_environment'] = self.build_environment
tandrii(chromium) 2016/04/20 14:58:23 can it potentially be so large so as not fitting i
Michael Achenbach 2016/04/20 15:05:08 I'll add a check. And I should also add a check th
972
948 swarm_hashes = self.m.isolate.isolated_tests 973 swarm_hashes = self.m.isolate.isolated_tests
949 if swarm_hashes: 974 if swarm_hashes:
950 properties['swarm_hashes'] = swarm_hashes 975 properties['swarm_hashes'] = swarm_hashes
951 properties.update(**additional_properties) 976 properties.update(**additional_properties)
952 self.m.trigger(*[{ 977 self.m.trigger(*[{
953 'builder_name': builder_name, 978 'builder_name': builder_name,
954 'properties': properties, 979 'properties': properties,
955 } for builder_name in triggers]) 980 } for builder_name in triggers])
956 981
957 if triggers_proxy: 982 if triggers_proxy:
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
1090 def report_culprits(self, culprit_range): 1115 def report_culprits(self, culprit_range):
1091 assert culprit_range 1116 assert culprit_range
1092 if len(culprit_range) > 1: 1117 if len(culprit_range) > 1:
1093 text = 'Suspecting multiple commits' 1118 text = 'Suspecting multiple commits'
1094 else: 1119 else:
1095 text = 'Suspecting %s' % culprit_range[0][:8] 1120 text = 'Suspecting %s' % culprit_range[0][:8]
1096 1121
1097 step_result = self.m.step(text, cmd=None) 1122 step_result = self.m.step(text, cmd=None)
1098 for culprit in culprit_range: 1123 for culprit in culprit_range:
1099 step_result.presentation.links[culprit[:8]] = COMMIT_TEMPLATE % culprit 1124 step_result.presentation.links[culprit[:8]] = COMMIT_TEMPLATE % culprit
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698