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

Unified Diff: build/android/pylib/base/shard_unittest.py

Issue 16682003: [Android] Add a check in sharder for an empty test list. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added unit test Created 7 years, 6 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/base/shard.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/pylib/base/shard_unittest.py
diff --git a/build/android/pylib/base/shard_unittest.py b/build/android/pylib/base/shard_unittest.py
index aca44a00537e6854881d7f13846e31ccc966ad04..25695be515066cce9cec18fcf2b4dbaf01d295b3 100644
--- a/build/android/pylib/base/shard_unittest.py
+++ b/build/android/pylib/base/shard_unittest.py
@@ -83,7 +83,7 @@ class TestFunctions(unittest.TestCase):
results = []
tests = shard._TestCollection([shard._Test(t) for t in tests])
shard._RunTestsFromQueue(mock_runner, tests, results,
- watchdog_timer.WatchdogTimer(None))
+ watchdog_timer.WatchdogTimer(None), 2)
run_results = base_test_result.TestRunResults()
for r in results:
run_results.AddTestRunResults(r)
@@ -133,7 +133,7 @@ class TestThreadGroupFunctions(unittest.TestCase):
def testRun(self):
runners = [MockRunner('0'), MockRunner('1')]
- results = shard._RunAllTests(runners, self.tests)
+ results = shard._RunAllTests(runners, self.tests, 0)
self.assertEqual(len(results.GetPass()), len(self.tests))
def testTearDown(self):
@@ -144,13 +144,13 @@ class TestThreadGroupFunctions(unittest.TestCase):
def testRetry(self):
runners = shard._CreateRunners(MockRunnerFail, ['0', '1'])
- results = shard._RunAllTests(runners, self.tests)
+ results = shard._RunAllTests(runners, self.tests, 0)
self.assertEqual(len(results.GetFail()), len(self.tests))
def testReraise(self):
runners = shard._CreateRunners(MockRunnerException, ['0', '1'])
with self.assertRaises(TestException):
- shard._RunAllTests(runners, self.tests)
+ shard._RunAllTests(runners, self.tests, 0)
class TestShard(unittest.TestCase):
@@ -168,6 +168,10 @@ class TestShard(unittest.TestCase):
self.assertEqual(len(results.GetPass()), 0)
self.assertEqual(len(results.GetFail()), 3)
+ def testNoTests(self):
+ results = shard.ShardAndRunTests(MockRunner, ['0', '1'], [])
+ self.assertEqual(len(results.GetAll()), 0)
+
if __name__ == '__main__':
unittest.main()
« no previous file with comments | « build/android/pylib/base/shard.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698