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

Unified Diff: scripts/slave/run_slavelastic_unittest.py

Issue 10035003: Split up Each Swarm Test into Two Steps (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Adding tests to presubmit Created 8 years, 8 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
Index: scripts/slave/run_slavelastic_unittest.py
diff --git a/scripts/slave/run_slavelastic_unittest.py b/scripts/slave/run_slavelastic_unittest.py
deleted file mode 100644
index 3329941c2f9f35cebec9955e703d9915da96b257..0000000000000000000000000000000000000000
--- a/scripts/slave/run_slavelastic_unittest.py
+++ /dev/null
@@ -1,76 +0,0 @@
-#!/usr/bin/env python
-# Copyright (c) 2012 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.
-
-import os
-import sys
-import unittest
-
-HERE = os.path.dirname(os.path.abspath(__file__))
-sys.path.insert(0, os.path.join(HERE, '..', '..', 'site_config'))
-sys.path.insert(0, os.path.join(HERE, '..'))
-sys.path.insert(0, HERE)
-
-import slave.run_slavelastic as slavelastic
-
-
-class TestSummaryTest(unittest.TestCase):
- def test_correct_output(self):
- summary_output = [
- ('[ PASSED ] 10 tests.\n'
- 'YOU HAVE 1 DISABLED TESTS\n'
- 'YOU HAVE 1 test with ignored failures (FAILS prefix)'),
- ('[ PASSED ] 10 tests\n'
- '[ FAILED ] 1 test, listed below:\n'
- '[ FAILED ] ObserverListThreadSafeTest.RemoveObserver\n'
- '1 FAILED TEST\n'
- 'YOU HAVE 2 DISABLED TESTS\n'
- 'YOU HAVE 2 test with ignored failures (FAILS prefix)\n')]
-
- expected_output = ['[ PASSED ] 20 tests.',
- '[ FAILED ] failed tests listed below:',
- '[ FAILED ] ObserverListThreadSafeTest.RemoveObserver',
- '1 FAILED TESTS',
- '3 DISABLED TESTS',
- '3 tests with ignored failures (FAILS prefix)']
-
- summary = slavelastic.TestSummary()
-
- for data in summary_output:
- summary.AddSummaryData(data)
-
- self.assertEquals(expected_output, summary.Output())
- self.assertEquals(1, summary.exit_code())
-
- def test_correct_all_pass(self):
- summary_output = [
- ('[ PASSED ] 10 tests.'),
- ('[ PASSED ] 10 tests')]
-
- expected_output = ['[ PASSED ] 20 tests.']
-
- summary = slavelastic.TestSummary()
-
- for data in summary_output:
- summary.AddSummaryData(data)
-
- self.assertEquals(expected_output, summary.Output())
-
- def test_test_run_output(self):
- full_output = ('[==========] Running 1 tests from results test run.\n'
- '[ RUN ] results.Run Test\n'
- 'DONE\n'
- '[ OK ] results.Run Test (10 ms)\n\n'
- '[----------] results summary\n'
- '[==========] 1 tests ran. (10 ms total)\n'
- '[ PASSED ] 1 tests.\n'
- '[ FAILED ] 0 tests\n\n'
- ' 0 FAILED TESTS')
-
- cleaned_output = slavelastic.TestRunOutput(full_output)
-
- self.assertEquals('DONE', cleaned_output)
-
-if __name__ == '__main__':
- unittest.main()

Powered by Google App Engine
This is Rietveld 408576698