summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Koleszar <jkoleszar@google.com>2012-08-22 10:02:45 -0700
committerGerrit Code Review <gerrit@gerrit.golo.chromium.org>2012-08-22 10:02:45 -0700
commita8f9842dd4aac6395f107e0f32cf51efbb305aa9 (patch)
tree0f9b96deff93bf69be87f6440913cf6456308adf
parentb43ed7a5b1f4da8698fde0d13f772091a32c0029 (diff)
parent778393cfd2d186f9fe771218da9e42ad1eda109b (diff)
downloadlibvpx-a8f9842dd4aac6395f107e0f32cf51efbb305aa9.tar
libvpx-a8f9842dd4aac6395f107e0f32cf51efbb305aa9.tar.gz
libvpx-a8f9842dd4aac6395f107e0f32cf51efbb305aa9.tar.bz2
libvpx-a8f9842dd4aac6395f107e0f32cf51efbb305aa9.zip
Merge "all_builds.py: support for sharding builds" into experimental
-rwxr-xr-xall_builds.py31
1 files changed, 24 insertions, 7 deletions
diff --git a/all_builds.py b/all_builds.py
index 765086528..b2bab7300 100755
--- a/all_builds.py
+++ b/all_builds.py
@@ -1,8 +1,12 @@
#!/usr/bin/python
+import getopt
import subprocess
import sys
+LONG_OPTIONS = ["shard=", "shards="]
+BASE_COMMAND = "./configure --enable-internal-stats --enable-experimental"
+
def RunCommand(command):
run = subprocess.Popen(command, shell=True)
output = run.communicate()
@@ -26,12 +30,25 @@ def list_of_experiments():
experiments.append(experiment)
return experiments
-def main():
- base_command = "./configure --enable-internal-stats"
- test_build(base_command)
- for experiment_name in list_of_experiments():
- test_build("%s --enable-experimental --enable-%s" % (base_command,
- experiment_name))
+def main(argv):
+ # Parse arguments
+ options = {"--shard": 0, "--shards": 1}
+ o, _ = getopt.getopt(argv[1:], None, LONG_OPTIONS)
+ options.update(o)
+
+ # Shard experiment list
+ shard = int(options["--shard"])
+ shards = int(options["--shards"])
+ experiments = list_of_experiments()
+ configs = [BASE_COMMAND]
+ configs += ["%s --enable-%s" % (BASE_COMMAND, e) for e in experiments]
+ my_configs = zip(configs, range(len(configs)))
+ my_configs = filter(lambda x: x[1] % shards == shard, my_configs)
+ my_configs = [e[0] for e in my_configs]
+
+ # Run configs for this shard
+ for config in my_configs:
+ test_build(config)
def test_build(configure_command):
print "\033[34m\033[47mTesting %s\033[0m" % (configure_command)
@@ -40,4 +57,4 @@ def test_build(configure_command):
RunCommand("make")
if __name__ == "__main__":
- main()
+ main(sys.argv)