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

Unified Diff: tests/run_test_cases_smoke_test.py

Issue 12459014: Implement clustering support in run_test_cases.py. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/swarm_client
Patch Set: Created 7 years, 9 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
« tests/gtest_fake/gtest_fake_pass.py ('K') | « tests/gtest_fake/gtest_fake_pass.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/run_test_cases_smoke_test.py
diff --git a/tests/run_test_cases_smoke_test.py b/tests/run_test_cases_smoke_test.py
index e13bbec585d20ecd337066c98cd47a2bd328aaf9..0a6e7080de17a85080c76303bb2738f4703d82af 100755
--- a/tests/run_test_cases_smoke_test.py
+++ b/tests/run_test_cases_smoke_test.py
@@ -154,6 +154,7 @@ class RunTestCases(unittest.TestCase):
def test_simple_pass(self):
out, err, return_code = RunTest(
[
+ '--clusters', '1',
'--jobs', '3',
'--result', self.filename,
os.path.join(ROOT_DIR, 'tests', 'gtest_fake', 'gtest_fake_pass.py'),
@@ -184,11 +185,46 @@ class RunTestCases(unittest.TestCase):
success=sorted([u'Foo.Bar1', u'Foo.Bar2', u'Foo.Bar/3']),
test_cases=test_cases)
+ def test_simple_pass_cluster(self):
+ out, err, return_code = RunTest(
+ [
+ '--clusters', '10',
+ '--jobs', '1',
+ '--result', self.filename,
+ os.path.join(ROOT_DIR, 'tests', 'gtest_fake', 'gtest_fake_pass.py'),
+ ])
+
+ self.assertEqual(0, return_code)
+
+ expected_out_re = [
+ r'\[\d/\d\] \d\.\d\ds .+',
+ r'\[\d/\d\] \d\.\d\ds .+',
+ r'\[\d/\d\] \d\.\d\ds .+',
+ re.escape('Summary:'),
+ re.escape(' Success: 3 100.00% ') + r' +\d+\.\d\ds',
+ re.escape(' Flaky: 0 0.00% ') + r' +\d+\.\d\ds',
+ re.escape(' Fail: 0 0.00% ') + r' +\d+\.\d\ds',
+ r' \d+\.\d\ds Done running 3 tests with 3 executions. \d+\.\d\d test/s',
+ ]
+ self._check_results(expected_out_re, out, err)
+
+ test_cases = [
+ ('Foo.Bar1', 1),
+ ('Foo.Bar2', 1),
+ ('Foo.Bar/3', 1)
+ ]
+ self._check_results_file(
+ fail=[],
+ flaky=[],
+ success=sorted([u'Foo.Bar1', u'Foo.Bar2', u'Foo.Bar/3']),
+ test_cases=test_cases)
+
def test_simple_pass_verbose(self):
# We take verbosity seriously so test it.
out, err, return_code = RunTest(
[
# Linearize execution.
+ '--clusters', '1',
'--jobs', '1',
'--verbose',
'--result', self.filename,
@@ -237,6 +273,8 @@ class RunTestCases(unittest.TestCase):
def test_simple_fail(self):
out, err, return_code = RunTest(
[
+ # Linearize execution.
+ '--clusters', '1',
'--jobs', '1',
'--result', self.filename,
os.path.join(ROOT_DIR, 'tests', 'gtest_fake', 'gtest_fake_fail.py'),
@@ -299,6 +337,7 @@ class RunTestCases(unittest.TestCase):
out, err, return_code = RunTest(
[
# Linearize execution.
+ '--clusters', '1',
'--jobs', '1',
'--verbose',
'--result', self.filename,
@@ -409,7 +448,7 @@ class RunTestCases(unittest.TestCase):
out, err, return_code = RunTest(
[
'--result', self.filename,
- # Make it determinist.
+ # Linearize execution.
'--clusters', '1',
'--jobs', '1',
'--retries', '1',
@@ -442,7 +481,7 @@ class RunTestCases(unittest.TestCase):
# In that case, it's an XML file even if it has the wrong extension.
'--gtest_output=xml:' + self.filename,
'--no-dump',
- # Make it determinist.
+ # Linearize execution.
'--clusters', '1',
'--jobs', '1',
'--retries', '1',
« tests/gtest_fake/gtest_fake_pass.py ('K') | « tests/gtest_fake/gtest_fake_pass.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698