Index: scripts/slave/runtest.py |
=================================================================== |
--- scripts/slave/runtest.py (revision 147800) |
+++ scripts/slave/runtest.py (working copy) |
@@ -36,6 +36,7 @@ |
# pylint checks. |
# pylint: disable=E0611 |
# pylint: disable=E1101 |
+from buildbot.process.properties import WithProperties |
cmp
2012/07/31 23:52:04
please remove this line, we won't need it
ramant (doing other things)
2012/08/01 00:23:31
Done.
|
from buildbot.status import builder |
from common import chromium_utils |
@@ -303,6 +304,40 @@ |
print '@@@STEP_TEXT@%s@@@' % desc |
+def upload_profiling_data(options): |
+ """Using the target build configuration, archive the profiling data to Google |
+ Storage. |
+ """ |
+ build_dir = os.path.normpath(os.path.abspath(options.build_dir)) |
+ |
+ # Profiling data is in /b/build/slave/SLAVE_NAME/build/src/chrome/test/data |
+ profiling_data_dir = os.path.join(build_dir, 'src', 'chrome', 'test', 'data') |
+ if not os.path.exists(profiling_data_dir): |
+ return True |
+ |
+ profiling_file = os.path.join(profiling_data_dir, 'task_profile.json') |
+ if not os.path.exists(profiling_file): |
+ return True |
+ |
+ # Profiling tool is in |
+ # /b/build/slave/SLAVE_NAME/build/src/build/scripts/slave/chromium |
+ profiling_archive_tool = os.path.join(build_dir, 'src', 'build', 'scripts', |
+ 'slave', 'chromium', |
+ 'archive_profiling_data.py') |
+ |
+ if sys.platform == 'win32': |
+ python = 'python_slave' |
+ else: |
+ python = 'python' |
+ |
+ cmd = [python, |
+ profiling_archive_tool, |
+ '--run-id', WithProperties('%(got_revision)s_%(buildername)s'), |
cmp
2012/07/31 23:52:04
you can access these properties as:
options.build_
ramant (doing other things)
2012/08/01 00:23:31
Done.
|
+ '--profiling-data-dir', profiling_data_dir] |
+ |
+ return chromium_utils.RunCommand(cmd) |
+ |
+ |
def main_mac(options, args): |
if len(args) < 1: |
raise chromium_utils.MissingArgument('Usage: %s' % USAGE) |
@@ -703,6 +738,8 @@ |
sys.stderr.write('Unknown sys.platform value %s\n' % repr(sys.platform)) |
return 1 |
+ upload_profiling_data(options) |
cmp
2012/07/31 23:52:04
this should be behind a conditional of some sort,
ramant (doing other things)
2012/08/01 00:23:31
Done.
|
+ |
new_temp_files = get_temp_count() |
if temp_files > new_temp_files: |
print >> sys.stderr, ( |