Bug 151542

Summary: run-webkit-tests: http server for imported W3C tests doesn't work with --layout-tests-directory switch
Product: WebKit Reporter: David Kilzer (:ddkilzer) <ddkilzer>
Component: Tools / TestsAssignee: David Kilzer (:ddkilzer) <ddkilzer>
Status: RESOLVED FIXED    
Severity: Normal CC: andersca, bfulgham, commit-queue, darin, dbates, glenn, lforschler, youennf
Priority: P2    
Version: Other   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch v1 dbates: review+

Description David Kilzer (:ddkilzer) 2015-11-22 02:43:35 PST
When invoking run-webkit-tests with the --layout-tests-directory command-line switch, the http server for the imported W3C tests ignores that path and instead creates a path relative to the Tools directory from which it is invoked.

That causes a problem when the WebKit working directory for Tools is sparse (just the Tools directory has been checked out), and the LayoutTests directory is also sparse.

As it turns out, it's pretty easy to fix, and it removes an argument from the WebPlatformTestServer constructor.
Comment 1 David Kilzer (:ddkilzer) 2015-11-22 02:55:56 PST
Created attachment 266052 [details]
Patch v1
Comment 2 youenn fablet 2015-11-22 11:20:24 PST
Comment on attachment 266052 [details]
Patch v1

View in context: https://bugs.webkit.org/attachment.cgi?id=266052&action=review

> Tools/Scripts/webkitpy/layout_tests/servers/web_platform_test_server_unittest.py:59
> +        options.ensure_value("layout_tests_dir", "/mock-checkout/LayoutTests")

Would this test work without this option?
Would it be good to have an additional test dedicated to a non-default layout_tests_dir value?
Comment 3 Daniel Bates 2015-11-22 12:33:03 PST
Comment on attachment 266052 [details]
Patch v1

This looks sane to me. I did not mark this cq+ to give you a chance to reply to Youenn Fablet and/or amend the patch.
Comment 4 David Kilzer (:ddkilzer) 2015-11-22 19:44:05 PST
(In reply to comment #2)
> Comment on attachment 266052 [details]
> Patch v1
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=266052&action=review
> 
> > Tools/Scripts/webkitpy/layout_tests/servers/web_platform_test_server_unittest.py:59
> > +        options.ensure_value("layout_tests_dir", "/mock-checkout/LayoutTests")
> 
> Would this test work without this option?

Good question!  The existing tests do work without this, so I removed it.

> Would it be good to have an additional test dedicated to a non-default
> layout_tests_dir value?

And I added a test that requires that layout_tests_dir be set.

Thanks!
Comment 5 David Kilzer (:ddkilzer) 2015-11-22 20:03:50 PST
Committed r192738: <http://trac.webkit.org/changeset/192738>