Changeset 84333 in webkit


Ignore:
Timestamp:
Apr 19, 2011 8:17:20 PM (13 years ago)
Author:
eric@webkit.org
Message:

2011-04-19 Eric Seidel <eric@webkit.org>

Reviewed by Adam Barth.

The commit-queue is confused when non-layout tests fail
https://bugs.webkit.org/show_bug.cgi?id=58955

As seen in http://queues.webkit.org/results/8474435

It fails to create an archive of the layout test results
and then throws an exception.

I've fixed this by making it catch the exception as well
as made it so it never calls that path in the common case.

I've updated MockFileSystem to understand rmtree's affect on
directories as well as files.

  • Scripts/webkitpy/common/system/filesystem_mock.py:
  • Scripts/webkitpy/common/system/workspace.py:
  • Scripts/webkitpy/tool/commands/queues.py:
  • Scripts/webkitpy/tool/commands/queues_unittest.py:
  • Scripts/webkitpy/tool/mocktool.py:
Location:
trunk/Tools
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r84317 r84333  
     12011-04-19  Eric Seidel  <eric@webkit.org>
     2
     3        Reviewed by Adam Barth.
     4
     5        The commit-queue is confused when non-layout tests fail
     6        https://bugs.webkit.org/show_bug.cgi?id=58955
     7
     8        As seen in http://queues.webkit.org/results/8474435
     9
     10        It fails to create an archive of the layout test results
     11        and then throws an exception.
     12
     13        I've fixed this by making it catch the exception as well
     14        as made it so it never calls that path in the common case.
     15
     16        I've updated MockFileSystem to understand rmtree's affect on
     17        directories as well as files.
     18
     19        * Scripts/webkitpy/common/system/filesystem_mock.py:
     20        * Scripts/webkitpy/common/system/workspace.py:
     21        * Scripts/webkitpy/tool/commands/queues.py:
     22        * Scripts/webkitpy/tool/commands/queues_unittest.py:
     23        * Scripts/webkitpy/tool/mocktool.py:
     24
    1252011-04-19  Ojan Vafai  <ojan@chromium.org>
    226
  • trunk/Tools/Scripts/webkitpy/common/system/filesystem_mock.py

    r84075 r84333  
    148148        path = self.normpath(path)
    149149        if path in self.dirs:
    150             return True
     150            return self.dirs[path] is not None
    151151
    152152        # We need to use a copy of the keys here in order to avoid switching
     
    268268
    269269    def rmtree(self, path):
    270         if not path.endswith(self.sep):
    271             path += self.sep
     270        path = self.normpath(path)
    272271
    273272        for f in self.files:
    274273            if f.startswith(path):
    275274                self.files[f] = None
     275
     276        for d in self.dirs:
     277            if d.startswith(path):
     278                self.dirs[d] = None
    276279
    277280    def splitext(self, path):
  • trunk/Tools/Scripts/webkitpy/common/system/workspace.py

    r76071 r84333  
    3030# below more complicated objects.
    3131
     32import logging
    3233import zipfile
     34
     35
     36_log = logging.getLogger(__name__)
     37
    3338
    3439class Workspace(object):
     
    5863        # However, getting the paths, encoding and compression correct could be non-trivial.
    5964        # So, for now we depend on the environment having "zip" installed (likely fails on Win32)
    60         self._executive.run_command(['zip', '-r', zip_path, source_path])
     65        try:
     66            self._executive.run_command(['zip', '-r', zip_path, source_path])
     67        except ScriptError, e:
     68            _log.error("Workspace.create_zip failed:\n%s" % e.message_with_output())
     69            return None
     70
    6171        return zip_class(zip_path)
  • trunk/Tools/Scripts/webkitpy/tool/commands/queues.py

    r83906 r84333  
    354354        if not zip_path:
    355355            return None
     356        if not self._tool.filesystem.isdir(results_directory):
     357            log("%s does not exist, not archiving." % results_directory)
     358            return None
    356359        archive = self._tool.workspace.create_zip(zip_path, results_directory)
    357360        # Remove the results directory to prevent http logs, etc. from getting huge between runs.
  • trunk/Tools/Scripts/webkitpy/tool/commands/queues_unittest.py

    r83906 r84333  
    404404    def test_archive_last_layout_test_results(self):
    405405        queue = CommitQueue()
    406         queue.bind_to_tool(MockTool())
     406        tool = MockTool()
     407        queue.bind_to_tool(tool)
    407408        patch = queue._tool.bugs.fetch_attachment(128)
    408         # This is just to test that the method doesn't raise.
    409         queue.archive_last_layout_test_results(patch)
     409        # Should fail because the results_directory does not exist.
     410        expected_stderr = "/mock does not exist, not archiving.\n"
     411        archive = OutputCapture().assert_outputs(self, queue.archive_last_layout_test_results, [patch], expected_stderr=expected_stderr)
     412        self.assertEqual(archive, None)
     413
     414        results_directory = "/mock"
     415        # Sanity check what we assume our mock results directory is.
     416        self.assertEqual(queue._results_directory(), results_directory)
     417        tool.filesystem.maybe_make_directory(results_directory)
     418        self.assertTrue(tool.filesystem.exists(results_directory))
     419
     420        self.assertNotEqual(queue.archive_last_layout_test_results(patch), None)
     421        self.assertFalse(tool.filesystem.exists(results_directory))
    410422
    411423    def test_upload_results_archive_for_patch(self):
  • trunk/Tools/Scripts/webkitpy/tool/mocktool.py

    r83158 r84333  
    729729
    730730    def create_zip(self, zip_path, source_path):
    731         pass
     731        return object()  # Something that is not None
    732732
    733733
Note: See TracChangeset for help on using the changeset viewer.