Commit 938b1425 authored by Raphael Kubo da Costa's avatar Raphael Kubo da Costa Committed by Commit Bot

WPT export: Add more logging messages to test_exporter's workflow.

Add some more information so that it is easier to understand when the code
is querying Gerrit and when it is looking at existing Chromium commits, and
say git errors are not fatal.

R=robertma

Change-Id: I3f8de589186d0d2facafb6a92fcccd129d1899be
Reviewed-on: https://chromium-review.googlesource.com/899242
Commit-Queue: Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com>
Reviewed-by: default avatarRobert Ma <robertma@chromium.org>
Cr-Commit-Position: refs/heads/master@{#534093}
parent c02da461
......@@ -57,21 +57,27 @@ class TestExporter(object):
self.local_wpt = self.local_wpt or LocalWPT(self.host, credentials['GH_TOKEN'])
self.local_wpt.fetch()
_log.info('Searching for exportable in-flight CLs.')
# The Gerrit search API is slow and easy to fail, so we wrap it in a try
# statement to continue exporting landed commits when it fails.
try:
open_gerrit_cls = self.gerrit.query_exportable_open_cls()
except GerritError as e:
_log.info('In-flight CLs cannot be exported due to the following error:')
_log.error(str(e))
gerrit_error = True
else:
self.process_gerrit_cls(open_gerrit_cls)
gerrit_error = False
_log.info('Searching for exportable Chromium commits.')
exportable_commits, git_errors = self.get_exportable_commits()
for error in git_errors:
_log.error(error)
self.process_chromium_commits(exportable_commits)
if git_errors:
_log.info('Attention: The following errors have prevented some commits from being '
'exported:')
for error in git_errors:
_log.error(error)
return not (gerrit_error or git_errors)
......
......@@ -361,7 +361,10 @@ class TestExporterTest(LoggingTestCase):
self.assertFalse(success)
self.assertLog(['INFO: Cloning GitHub w3c/web-platform-tests into /tmp/wpt\n',
'ERROR: Gerrit API fails.\n'])
'INFO: Searching for exportable in-flight CLs.\n',
'INFO: In-flight CLs cannot be exported due to the following error:\n',
'ERROR: Gerrit API fails.\n',
'INFO: Searching for exportable Chromium commits.\n'])
def test_run_returns_false_on_patch_failure(self):
test_exporter = TestExporter(self.host)
......@@ -372,4 +375,7 @@ class TestExporterTest(LoggingTestCase):
self.assertFalse(success)
self.assertLog(['INFO: Cloning GitHub w3c/web-platform-tests into /tmp/wpt\n',
'INFO: Searching for exportable in-flight CLs.\n',
'INFO: Searching for exportable Chromium commits.\n',
'INFO: Attention: The following errors have prevented some commits from being exported:\n',
'ERROR: There was an error with the rutabaga.\n'])
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment