Commit 4a699377 authored by eric@webkit.org's avatar eric@webkit.org
Browse files

2011-01-18 Eric Seidel <eric@webkit.org>

        Reviewed by Adam Barth.

        commit-queue dies when test archiving fails
        https://bugs.webkit.org/show_bug.cgi?id=52617

        I looked at the machine and it had 10 archives already
        thus find_unused_name was returning None.  I've upped
        the limit to 100 (per bug) and tested the case where
        find_unused_name returns None (making archive return None).

        * Scripts/webkitpy/common/system/workspace.py:
        * Scripts/webkitpy/common/system/workspace_unittest.py:
        * Scripts/webkitpy/tool/bot/commitqueuetask.py:
        * Scripts/webkitpy/tool/bot/commitqueuetask_unittest.py:
        * Scripts/webkitpy/tool/commands/queues.py:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@76071 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 4668a0de
2011-01-18 Eric Seidel <eric@webkit.org>
Reviewed by Adam Barth.
commit-queue dies when test archiving fails
https://bugs.webkit.org/show_bug.cgi?id=52617
I looked at the machine and it had 10 archives already
thus find_unused_name was returning None. I've upped
the limit to 100 (per bug) and tested the case where
find_unused_name returns None (making archive return None).
* Scripts/webkitpy/common/system/workspace.py:
* Scripts/webkitpy/common/system/workspace_unittest.py:
* Scripts/webkitpy/tool/bot/commitqueuetask.py:
* Scripts/webkitpy/tool/bot/commitqueuetask_unittest.py:
* Scripts/webkitpy/tool/commands/queues.py:
2011-01-18 Dirk Pranke <dpranke@chromium.org>
 
Reviewed by Ojan Vafai.
......@@ -36,7 +36,7 @@ class Workspace(object):
self._filesystem = filesystem
self._executive = executive # FIXME: Remove if create_zip is moved to python.
def find_unused_filename(self, directory, name, extension, search_limit=10):
def find_unused_filename(self, directory, name, extension, search_limit=100):
for count in range(search_limit):
if count:
target_name = "%s-%s.%s" % (name, count, extension)
......
......@@ -40,10 +40,13 @@ class WorkspaceTest(unittest.TestCase):
filesystem = MockFileSystem({
"dir/foo.jpg": "",
"dir/foo-1.jpg": "",
"dir/foo-2.jpg": "",
})
workspace = Workspace(filesystem, None)
self.assertEqual(workspace.find_unused_filename("bar", "bar", "bar"), "bar/bar.bar")
self.assertEqual(workspace.find_unused_filename("dir", "foo", "jpg"), "dir/foo-2.jpg")
self.assertEqual(workspace.find_unused_filename("dir", "foo", "jpg", search_limit=1), None)
self.assertEqual(workspace.find_unused_filename("dir", "foo", "jpg", search_limit=2), None)
self.assertEqual(workspace.find_unused_filename("dir", "foo", "jpg"), "dir/foo-3.jpg")
def test_create_zip(self):
workspace = Workspace(None, MockExecutive(should_log=True))
......
......@@ -187,7 +187,9 @@ class CommitQueueTask(object):
first_failing_tests = [result.filename for result in first_results]
first_results_archive = self._delegate.archive_last_layout_test_results(self._patch)
if self._test():
self._report_flaky_tests(first_results, first_results_archive)
# Only report flaky tests if we were successful at archiving results.
if first_results_archive:
self._report_flaky_tests(first_results, first_results_archive)
return True
second_results = self._failing_results_from_last_run()
......
......@@ -206,6 +206,34 @@ command_passed: success_message='Passed tests' patch='197'
report_flaky_tests: patch='197' flaky_tests='[]' archive='mock-archive-197.zip'
run_webkit_patch: ['land-attachment', '--force-clean', '--ignore-builders', '--non-interactive', '--parent-command=commit-queue', 197]
command_passed: success_message='Landed patch' patch='197'
"""
self._run_through_task(commit_queue, expected_stderr)
def test_failed_archive(self):
commit_queue = MockCommitQueue([
None,
None,
None,
None,
ScriptError("MOCK tests failure"),
])
# It's possible delegate to fail to archive layout tests, don't try to report
# flaky tests when that happens.
commit_queue.archive_last_layout_test_results = lambda patch: None
expected_stderr = """run_webkit_patch: ['clean']
command_passed: success_message='Cleaned working directory' patch='197'
run_webkit_patch: ['update']
command_passed: success_message='Updated working directory' patch='197'
run_webkit_patch: ['apply-attachment', '--no-update', '--non-interactive', 197]
command_passed: success_message='Applied patch' patch='197'
run_webkit_patch: ['build', '--no-clean', '--no-update', '--build-style=both']
command_passed: success_message='Built patch' patch='197'
run_webkit_patch: ['build-and-test', '--no-clean', '--no-update', '--test', '--non-interactive']
command_failed: failure_message='Patch does not pass tests' script_error='MOCK tests failure' patch='197'
run_webkit_patch: ['build-and-test', '--no-clean', '--no-update', '--test', '--non-interactive']
command_passed: success_message='Passed tests' patch='197'
run_webkit_patch: ['land-attachment', '--force-clean', '--ignore-builders', '--non-interactive', '--parent-command=commit-queue', 197]
command_passed: success_message='Landed patch' patch='197'
"""
self._run_through_task(commit_queue, expected_stderr)
......
......@@ -323,6 +323,8 @@ class CommitQueue(AbstractPatchQueue, StepSequenceErrorHandler, CommitQueueTaskD
results_name, _ = os.path.splitext(os.path.basename(results_directory))
# Note: We name the zip with the bug_id instead of patch_id to match work_item_log_path().
zip_path = self._tool.workspace.find_unused_filename(self._log_directory(), "%s-%s" % (patch.bug_id(), results_name), "zip")
if not zip_path:
return None
archive = self._tool.workspace.create_zip(zip_path, results_directory)
# Remove the results directory to prevent http logs, etc. from getting huge between runs.
# We could have create_zip remove the original, but this is more explicit.
......
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