2010-09-17 Dirk Pranke <dpranke@chromium.org>
authordpranke@chromium.org <dpranke@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 21 Sep 2010 19:11:35 +0000 (19:11 +0000)
committerdpranke@chromium.org <dpranke@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 21 Sep 2010 19:11:35 +0000 (19:11 +0000)
commit5c0453e9c1751af9ef16e7fcdfb821812684a707
tree5ec691c3d146baaea13b977d6eaf41a480ae2cce
parent5a108ce908eae445e11fd5edad257f1fc5577d33
2010-09-17  Dirk Pranke  <dpranke@chromium.org>

        Reviewed by Ojan Vafai.

        new-run-webkit-tests: pull the list of tests from the Port, and
           make it possible to run with no actual test files in the filesystem.

        This set of changes allows us to delete the special
        webkitpy/layout_tests/data directory and test the generic code without
        touching the filesystem (except to write results). This speeds up
        test-webkitpy substantially.

        This also cleans up and removes several code paths in the generic
        code and fixes some minor bugs, notably in the test_expectations
        parsing, which was previously fragile if the tests weren't present.

        We also change the way we diff image results to be able to do so
        in memory, without relying on files. This slows down chromium
        test_shell, which always writes images to files, but should speed
        up DRT and ImageDiff-based implementations slightly.

        Note that pulling the list of tests to run from the Port will allow
        ports to specify what tests to run as an inclusive list; previously
        you could only do this as an exclusive list by using a
        test_expectations file or Skipped files; nothing actually uses this
        feature yet and it's unclear if it should be used.

        Note that there are no functional changes -- apart from now
        always printing out the location of the checksum file when we are
        tracing test runs -- and the total number of lines of non-test code
        actually drops by two.

        There is some more cleanup that can be done in the Port/Driver
        interface and in some handling of filenames, but I'll save that
        for another change.

        https://bugs.webkit.org/show_bug.cgi?id=45801

        * Scripts/webkitpy/layout_tests/data/*: Removed.
            - no longer need special mock layout_tests_directory in the
              repository.
        * Scripts/webkitpy/layout_tests/layout_package/printing.py:
            - add code to display missing text files, checksums when tracing
            - update to not look at the filesystem directly.
        * Scripts/webkitpy/layout_tests/layout_package/printing_unittest.py:
            - add more unit tests
        * Scripts/webkitpy/layout_tests/layout_package/test_expectations.py:
            - remove tests_are_present flag
            - update with changes in Port interface - no longer access
              the filesystem directly, although we still use os.path for
              filename manipulation.
        * Scripts/webkitpy/layout_tests/layout_package/test_expectations_unittest.py:
            - add more unit tests
        * Scripts/webkitpy/layout_tests/layout_package/test_files.py: Removed.
            - renamed to port/test_files.py
        * Scripts/webkitpy/layout_tests/port/base.py:
            - change diff_image() to expect actual image data, not filenames
            - add expected_checksum(), expected_image(), expected_text() to
              return the content of the files so that we don't need a filesystem
            - add path_exists(), path_isdir() for filesystem-like access.
            - add test_dirs() to keep clobber-test-results from needing to
              actually look at a real layout tests dir
            - add tests() to return the list of tests to run on the port
              (calls port/test_files to do the work).
            - add update_baseline() to be able to save new baselines
            - add uri_to_test_name() from port/dryrun.py so we can easily check
              filename_to_uri()
        * Scripts/webkitpy/layout_tests/port/base_unittest.py:
            - add more unit tests
        * Scripts/webkitpy/layout_tests/port/chromium.py:
            - change diff_image() to accept image content, not filenames.
              This will be slower for test_shell/image_diff, but faster
              for DRT/ImageDiff.
        * Scripts/webkitpy/layout_tests/port/chromium_unittest.py:
            - add more unit tests
        * Scripts/webkitpy/layout_tests/port/dryrun.py:
            - simplify greatly
        * Scripts/webkitpy/layout_tests/port/port_testcase.py:
            - add more unit tests
        * Scripts/webkitpy/layout_tests/port/test.py:
            - massive rewrite to use in-script list of tests and expectations
        * Scripts/webkitpy/layout_tests/port/test_files.py:
            - rename from layout_package/test_files.
        * Scripts/webkitpy/layout_tests/port/test_files_unittest.py:
            - add unit tests
        * Scripts/webkitpy/layout_tests/port/webkit.py:
            - update diff_image() to take image contents, not files. Should
              make things slightly faster.
        * Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py:
            - update with changes to diff_image()
        * Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests_unittest.py:
            - update with changes to diff_image()
        * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
            - remove tests_are_present from test_expectations
            - pull the list of tests from port.tests() instead
              of calling test_files.py directly.
        * Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py:
            - update unit tests
        * Scripts/webkitpy/layout_tests/test_types/image_diff.py:
            - update with changes to
        * Scripts/webkitpy/layout_tests/test_types/test_type_base.py:
            - update with change in Port interface
        * Scripts/webkitpy/layout_tests/test_types/text_diff.py:
            - update with change in Port interface
        * Scripts/webkitpy/style/checkers/test_expectations.py:
            - remove the tests_are_present flag

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@67974 268f45cc-cd09-0410-ab3c-d52691b4dbfc
74 files changed:
WebKitTools/ChangeLog
WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/checksum-expected.checksum [deleted file]
WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/checksum-expected.png [deleted file]
WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/checksum-expected.txt [deleted file]
WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/checksum.html [deleted file]
WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/crash.html [deleted file]
WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/exception.html [deleted file]
WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/hang.html [deleted file]
WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/image-expected.checksum [deleted file]
WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/image-expected.png [deleted file]
WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/image-expected.txt [deleted file]
WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/image.html [deleted file]
WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/image_checksum-expected.checksum [deleted file]
WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/image_checksum-expected.png [deleted file]
WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/image_checksum-expected.txt [deleted file]
WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/image_checksum.html [deleted file]
WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/keyboard.html [deleted file]
WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/missing_check-expected.png [deleted file]
WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/missing_check-expected.txt [deleted file]
WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/missing_check.html [deleted file]
WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/missing_image.html [deleted file]
WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/missing_text.html [deleted file]
WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/text-expected.txt [deleted file]
WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/text.html [deleted file]
WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/timeout.html [deleted file]
WebKitTools/Scripts/webkitpy/layout_tests/data/failures/unexpected/text-image-checksum-expected.checksum [deleted file]
WebKitTools/Scripts/webkitpy/layout_tests/data/failures/unexpected/text-image-checksum-expected.png [deleted file]
WebKitTools/Scripts/webkitpy/layout_tests/data/failures/unexpected/text-image-checksum-expected.txt [deleted file]
WebKitTools/Scripts/webkitpy/layout_tests/data/failures/unexpected/text-image-checksum.html [deleted file]
WebKitTools/Scripts/webkitpy/layout_tests/data/http/tests/passes/text-expected.txt [deleted file]
WebKitTools/Scripts/webkitpy/layout_tests/data/http/tests/passes/text.html [deleted file]
WebKitTools/Scripts/webkitpy/layout_tests/data/http/tests/ssl/text-expected.txt [deleted file]
WebKitTools/Scripts/webkitpy/layout_tests/data/http/tests/ssl/text.html [deleted file]
WebKitTools/Scripts/webkitpy/layout_tests/data/passes/error-expected.txt [deleted file]
WebKitTools/Scripts/webkitpy/layout_tests/data/passes/error.html [deleted file]
WebKitTools/Scripts/webkitpy/layout_tests/data/passes/image-expected.checksum [deleted file]
WebKitTools/Scripts/webkitpy/layout_tests/data/passes/image-expected.png [deleted file]
WebKitTools/Scripts/webkitpy/layout_tests/data/passes/image-expected.txt [deleted file]
WebKitTools/Scripts/webkitpy/layout_tests/data/passes/image.html [deleted file]
WebKitTools/Scripts/webkitpy/layout_tests/data/passes/platform_image-expected.checksum [deleted file]
WebKitTools/Scripts/webkitpy/layout_tests/data/passes/platform_image-expected.png [deleted file]
WebKitTools/Scripts/webkitpy/layout_tests/data/passes/platform_image-expected.txt [deleted file]
WebKitTools/Scripts/webkitpy/layout_tests/data/passes/platform_image.html [deleted file]
WebKitTools/Scripts/webkitpy/layout_tests/data/passes/text-expected.txt [deleted file]
WebKitTools/Scripts/webkitpy/layout_tests/data/passes/text.html [deleted file]
WebKitTools/Scripts/webkitpy/layout_tests/data/platform/test/passes/platform_image-expected.checksum [deleted file]
WebKitTools/Scripts/webkitpy/layout_tests/data/platform/test/passes/platform_image-expected.png [deleted file]
WebKitTools/Scripts/webkitpy/layout_tests/data/platform/test/passes/platform_image-expected.txt [deleted file]
WebKitTools/Scripts/webkitpy/layout_tests/data/platform/test/test_expectations.txt [deleted file]
WebKitTools/Scripts/webkitpy/layout_tests/data/resources/README.txt [deleted file]
WebKitTools/Scripts/webkitpy/layout_tests/data/websocket/tests/passes/text-expected.txt [deleted file]
WebKitTools/Scripts/webkitpy/layout_tests/data/websocket/tests/passes/text.html [deleted file]
WebKitTools/Scripts/webkitpy/layout_tests/layout_package/printing.py
WebKitTools/Scripts/webkitpy/layout_tests/layout_package/printing_unittest.py
WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_expectations.py
WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_expectations_unittest.py
WebKitTools/Scripts/webkitpy/layout_tests/port/base.py
WebKitTools/Scripts/webkitpy/layout_tests/port/base_unittest.py
WebKitTools/Scripts/webkitpy/layout_tests/port/chromium.py
WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_unittest.py
WebKitTools/Scripts/webkitpy/layout_tests/port/dryrun.py
WebKitTools/Scripts/webkitpy/layout_tests/port/port_testcase.py
WebKitTools/Scripts/webkitpy/layout_tests/port/test.py
WebKitTools/Scripts/webkitpy/layout_tests/port/test_files.py [moved from WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_files.py with 92% similarity]
WebKitTools/Scripts/webkitpy/layout_tests/port/test_files_unittest.py [new file with mode: 0644]
WebKitTools/Scripts/webkitpy/layout_tests/port/webkit.py
WebKitTools/Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py
WebKitTools/Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests_unittest.py
WebKitTools/Scripts/webkitpy/layout_tests/run_webkit_tests.py
WebKitTools/Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py
WebKitTools/Scripts/webkitpy/layout_tests/test_types/image_diff.py
WebKitTools/Scripts/webkitpy/layout_tests/test_types/test_type_base.py
WebKitTools/Scripts/webkitpy/layout_tests/test_types/text_diff.py
WebKitTools/Scripts/webkitpy/style/checkers/test_expectations.py