aboutsummaryrefslogtreecommitdiffhomepage
path: root/infra
diff options
context:
space:
mode:
authorGravatar borenet <borenet@chromium.org>2016-03-17 09:01:33 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-03-17 09:01:33 -0700
commit64e9816429bfff0a666b5f0995e9124e2689595d (patch)
tree5259e48e447ad46ef29c9ab20a5fb535d4a6403c /infra
parente1849d14b9b50ba0346840f74adfcd7052603b43 (diff)
Some fixes for Swarming bots
Diffstat (limited to 'infra')
-rw-r--r--infra/bots/common.py19
-rw-r--r--infra/bots/flavor/default_flavor.py4
-rw-r--r--infra/bots/win_toolchain_utils.py5
3 files changed, 20 insertions, 8 deletions
diff --git a/infra/bots/common.py b/infra/bots/common.py
index b154ec4d6e..d4f317af4c 100644
--- a/infra/bots/common.py
+++ b/infra/bots/common.py
@@ -7,6 +7,7 @@
import contextlib
+import glob
import math
import os
import psutil
@@ -33,8 +34,12 @@ CONFIG_RELEASE = 'Release'
VALID_CONFIGS = (CONFIG_COVERAGE, CONFIG_DEBUG, CONFIG_RELEASE)
BUILD_PRODUCTS_WHITELIST = [
- 'dm', 'dm.exe',
- 'nanobench', 'nanobench.exe',
+ 'dm',
+ 'dm.exe',
+ 'nanobench',
+ 'nanobench.exe',
+ '*.so',
+ '*.dll',
]
GM_ACTUAL_FILENAME = 'actual-results.json'
@@ -256,11 +261,11 @@ class BotInfo(object):
self.flavor.compile(t)
dst = os.path.join(self.swarm_out_dir, 'out', self.configuration)
os.makedirs(dst)
- for f in BUILD_PRODUCTS_WHITELIST:
- path = os.path.join(self.out_dir, self.configuration, f)
- if os.path.exists(path):
- print 'Copying build product %s' % path
- shutil.copy(path, dst)
+ for pattern in BUILD_PRODUCTS_WHITELIST:
+ path = os.path.join(self.out_dir, self.configuration, pattern)
+ for f in glob.glob(path):
+ print 'Copying build product %s' % f
+ shutil.copy(f, dst)
self.cleanup()
def _run_once(self, fn, *args, **kwargs):
diff --git a/infra/bots/flavor/default_flavor.py b/infra/bots/flavor/default_flavor.py
index 5933b6c3cf..5cf0eee85b 100644
--- a/infra/bots/flavor/default_flavor.py
+++ b/infra/bots/flavor/default_flavor.py
@@ -75,11 +75,13 @@ class DefaultFlavorUtils(object):
"""Runs a step as appropriate for this flavor."""
path_to_app = os.path.join(self._bot_info.out_dir,
self._bot_info.configuration, cmd[0])
- if (sys.platform == 'linux' and
+ if ('linux' in sys.platform and
'x86_64' in self._bot_info.bot_name and
not 'TSAN' in self._bot_info.bot_name):
new_cmd = ['catchsegv', path_to_app]
else:
+ if sys.platform == 'win32':
+ path_to_app += '.exe'
new_cmd = [path_to_app]
new_cmd.extend(cmd[1:])
return self._bot_info.run(new_cmd, **kwargs)
diff --git a/infra/bots/win_toolchain_utils.py b/infra/bots/win_toolchain_utils.py
index 43f62863cd..f8033e925b 100644
--- a/infra/bots/win_toolchain_utils.py
+++ b/infra/bots/win_toolchain_utils.py
@@ -10,6 +10,8 @@
import json
+import os
+import stat
PLACEHOLDER = '<(TOOLCHAIN_BASE_DIR)'
@@ -36,6 +38,9 @@ def _replace(val, before, after):
def _replace_in_file(filename, before, after):
"""Replace occurrences of one string with another within the file."""
+ # Make the file writeable, or the below won't work.
+ os.chmod(filename, stat.S_IWRITE)
+
with open(filename) as f:
contents = json.load(f)
new_contents = _replace(contents, before, after)