diff options
author | Yu-Ju Hong <yjhong@chromium.org> | 2014-05-19 12:56:46 -0700 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2014-05-20 07:34:38 +0000 |
commit | fbf50480edf5bf87b4e61502361d253edc70c78d (patch) | |
tree | 143f2849e1419dae9ab0b04d50e53e61e1b02d1c /buildbot | |
parent | dcd020939d033baac3af23bfa157661717c61733 (diff) | |
download | chromite-fbf50480edf5bf87b4e61502361d253edc70c78d.tar.gz |
Fix reporting failed tests in VMTestStage
There is a bug that only one test_report.log will be processed.
This fixes the bug. Also adds unit tests to make sure we can
handle multiple reports.
BUG=chromium:366869
TEST=`buildbot/run_tests` passes
Change-Id: I8d6f3c9454b6fafd745322b6e45a4212dcbd1f4d
Reviewed-on: https://chromium-review.googlesource.com/200456
Reviewed-by: David James <davidjames@chromium.org>
Commit-Queue: Yu-Ju Hong <yjhong@chromium.org>
Tested-by: Yu-Ju Hong <yjhong@chromium.org>
Diffstat (limited to 'buildbot')
-rw-r--r-- | buildbot/cbuildbot_commands.py | 2 | ||||
-rwxr-xr-x | buildbot/cbuildbot_commands_unittest.py | 20 |
2 files changed, 16 insertions, 6 deletions
diff --git a/buildbot/cbuildbot_commands.py b/buildbot/cbuildbot_commands.py index 53ea542e7..9f8aa2279 100644 --- a/buildbot/cbuildbot_commands.py +++ b/buildbot/cbuildbot_commands.py @@ -609,7 +609,7 @@ def ListFailedTests(results_path): failed_tests.append((test_name, rel_path)) processed_tests.append(test_name) - return failed_tests + return failed_tests def GetTestResultsDir(buildroot, test_results_dir): diff --git a/buildbot/cbuildbot_commands_unittest.py b/buildbot/cbuildbot_commands_unittest.py index 166ded438..a7a0214fa 100755 --- a/buildbot/cbuildbot_commands_unittest.py +++ b/buildbot/cbuildbot_commands_unittest.py @@ -451,23 +451,33 @@ class UnmockedTests(cros_test_lib.TempDirTestCase): def testListFaliedTests(self): """Tests if we can list failed tests.""" - test_report = """ + test_report_1 = """ /tmp/taco/taste_tests/all/results-01-has_salsa [ PASSED ] /tmp/taco/taste_tests/all/results-01-has_salsa/has_salsa [ PASSED ] /tmp/taco/taste_tests/all/results-02-has_cheese [ FAILED ] /tmp/taco/taste_tests/all/results-02-has_cheese/has_cheese [ FAILED ] /tmp/taco/taste_tests/all/results-02-has_cheese/has_cheese FAIL: No cheese. """ + test_report_2 = """ +/tmp/taco/verify_tests/all/results-01-has_salsa [ PASSED ] +/tmp/taco/verify_tests/all/results-01-has_salsa/has_salsa [ PASSED ] +/tmp/taco/verify_tests/all/results-02-has_cheese [ PASSED ] +/tmp/taco/verify_tests/all/results-02-has_cheese/has_cheese [ PASSED ] +""" results_path = os.path.join(self.tempdir, 'tmp/taco') os.makedirs(results_path) # Create two reports with the same content to test that we don't # list the same test twice. osutils.WriteFile( - os.path.join(results_path, 'all', 'test_report.log'), - test_report, makedirs=True) + os.path.join(results_path, 'taste_tests', 'all', 'test_report.log'), + test_report_1, makedirs=True) + osutils.WriteFile( + os.path.join(results_path, 'taste_tests', 'failed', 'test_report.log'), + test_report_1, makedirs=True) osutils.WriteFile( - os.path.join(results_path, 'failed', 'test_report.log'), - test_report, makedirs=True) + os.path.join(results_path, 'verify_tests', 'all', 'test_report.log'), + test_report_2, makedirs=True) + self.assertEquals( commands.ListFailedTests(results_path), [('has_cheese', 'taste_tests/all/results-02-has_cheese')]) |