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

Unified Diff: scripts/master/factory/commands.py

Issue 11369025: Update Compile Step to Build Swarm Targets if Needed (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Created 8 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « masters/master.tryserver.chromium/master.cfg ('k') | scripts/master/factory/swarm_commands.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: scripts/master/factory/commands.py
diff --git a/scripts/master/factory/commands.py b/scripts/master/factory/commands.py
index 44ef69216247ac1323d71e5400b51266072cded8..67938b8a1eb90239ffecc4aa1641420a755ea45a 100644
--- a/scripts/master/factory/commands.py
+++ b/scripts/master/factory/commands.py
@@ -112,6 +112,34 @@ class SwarmShellForHashes(shell.ShellCommand):
self.setProperty('swarm_hashes', swarm_hashes)
+def GetSwarmTestsFromTestFilter(test_filters):
+ """Returns a list of all the tests in the list that should be run with
+ swarm."""
+ swarm_tests = []
+ for test_filter in test_filters:
+ if '_swarm:' in test_filter:
+ swarm_tests.append(test_filter.split('_swarm:', 1)[0])
+ elif test_filter.endswith('_swarm'):
+ swarm_tests.append(test_filter[:-len('_swarm')])
+
+ return swarm_tests
+
+
+class CompileWithRequiredSwarmTargets(shell.Compile):
+ def start(self):
+ try:
+ test_filters = self.getProperty('testfilter')
+ except KeyError:
+ test_filters = []
+
+ command = self.command
+ swarm_tests = GetSwarmTestsFromTestFilter(test_filters)
+ command.extend(swarm_test + '_run' for swarm_test in swarm_tests)
+
+ self.setCommand(command)
+ return shell.Compile.start(self)
+
+
class FactoryCommands(object):
# Base URL for performance test results.
PERF_BASE_URL = config.Master.perf_base_url
@@ -914,7 +942,7 @@ class FactoryCommands(object):
halfOnFailure: should stop the build if compile fails
"""
self._factory.addStep(
- shell.Compile,
+ CompileWithRequiredSwarmTargets,
name='compile',
timeout=timeout,
description=description,
« no previous file with comments | « masters/master.tryserver.chromium/master.cfg ('k') | scripts/master/factory/swarm_commands.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698