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

Unified Diff: build/android/pylib/instrumentation/test_sharder.py

Issue 12256021: [Android] Split out the instrumentation test runner, sharder, and dispatcher. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix some host_driven imports Created 7 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « build/android/pylib/instrumentation/test_runner.py ('k') | build/android/run_instrumentation_tests.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/pylib/instrumentation/test_sharder.py
diff --git a/build/android/pylib/instrumentation/test_sharder.py b/build/android/pylib/instrumentation/test_sharder.py
new file mode 100644
index 0000000000000000000000000000000000000000..fd3415640aabe1a9b4e036d32bf3e6ee264da65b
--- /dev/null
+++ b/build/android/pylib/instrumentation/test_sharder.py
@@ -0,0 +1,39 @@
+# Copyright (c) 2013 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+"""Sharder for the instrumentation tests."""
+
+from pylib.base import base_test_sharder
+from pylib.base import sharded_tests_queue
+
+import test_runner
+
+
+class TestSharder(base_test_sharder.BaseTestSharder):
+ """Responsible for sharding the tests on the connected devices."""
+
+ def __init__(self, attached_devices, options, tests, apks):
+ super(TestSharder, self).__init__(attached_devices,
+ options.build_type)
+ self.options = options
+ self.tests = tests
+ self.apks = apks
+
+ def SetupSharding(self, tests):
+ """Called before starting the shards."""
+ base_test_sharder.SetTestsContainer(sharded_tests_queue.ShardedTestsQueue(
+ len(self.attached_devices), tests))
+
+ def CreateShardedTestRunner(self, device, index):
+ """Creates a sharded test runner.
+
+ Args:
+ device: Device serial where this shard will run.
+ index: Index of this device in the pool.
+
+ Returns:
+ A TestRunner object.
+ """
+ return test_runner.TestRunner(self.options, device, None, False, index,
+ self.apks, [])
« no previous file with comments | « build/android/pylib/instrumentation/test_runner.py ('k') | build/android/run_instrumentation_tests.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698