Bug 37731

Summary: Integrate v8 testing utility with webkit tests
Product: WebKit Reporter: Yaar Schnitman <yaar>
Component: New BugsAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, eric
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Other   
OS: OS X 10.5   
Attachments:
Description Flags
Patch
none
Patch none

Description Yaar Schnitman 2010-04-16 15:15:14 PDT
Integrate v8 testing utility with webkit tests
Comment 1 Yaar Schnitman 2010-04-16 15:20:42 PDT
Created attachment 53571 [details]
Patch
Comment 2 Yaar Schnitman 2010-04-16 15:21:30 PDT
Comment on attachment 53571 [details]
Patch

Please cq+ if LGTM
Comment 3 Yaar Schnitman 2010-04-16 15:23:06 PDT
Eric, this refactor of the original test utility can be run to see if output is different from the reference files and optionally, to update the reference files.

I'll leave the hookup to EWS, commit queue, etc to you.

Cheers,
Yaar
Comment 4 Adam Barth 2010-04-17 13:16:40 PDT
Comment on attachment 53571 [details]
Patch

+ os.system(' '.join(cmd))

os.system is a dangerous API.  Please consider using popen or webkitpy.common.system.executive.

+ webkitRoot = os.path.join(os.path.dirname(__file__), '..', '..')

This seems very fragile.  Please consider using checkout_root in webkitpy.common.checkout.scm.

+ workDir = tempfile.mkdtemp()

I don't understand why we need a working temp directory.  Can't we just generate the new output into a memory buffer?
Comment 5 Yaar Schnitman 2010-04-19 10:18:16 PDT
Created attachment 53687 [details]
Patch
Comment 6 Yaar Schnitman 2010-04-19 10:18:38 PDT
Comment on attachment 53687 [details]
Patch

Ready for review.
Comment 7 Yaar Schnitman 2010-04-19 10:21:15 PDT
(In reply to comment #4)
> (From update of attachment 53571 [details])
> + os.system(' '.join(cmd))
> 
> os.system is a dangerous API.  Please consider using popen or
> webkitpy.common.system.executive.
Fixed to use subprocess.call

> + webkitRoot = os.path.join(os.path.dirname(__file__), '..', '..')
> 
> This seems very fragile.  Please consider using checkout_root in
> webkitpy.common.checkout.scm.
Fixed.
> 
> + workDir = tempfile.mkdtemp()
> 
> I don't understand why we need a working temp directory.  Can't we just
> generate the new output into a memory buffer?
There are 3 reasons:
1) Its hard to run 'diff' on a memory buffer.
2) Its hard to predict pipe the output of the Perl generator into a memory buffer, as there is no agreed interface for how many files and what files it outputs. While I can hard code something for V8, I want this to generalize to other generators.
3) Its shorter, simpler code.
Comment 8 Yaar Schnitman 2010-04-19 10:21:45 PDT
(Please cq+ if ok)
Comment 9 Adam Barth 2010-04-22 13:01:36 PDT
Comment on attachment 53687 [details]
Patch

Thanks for the patch!  Glad to have this testing harness.  :)

WebKitTools/Scripts/run-bindings-tests:105
 +      overwrite = "--overwrite" in argv
We should probably use option parser here instead of doing this manually.

WebKitTools/Scripts/run-bindings-tests:82
 +              workDir = tempfile.mkdtemp()
I still think we should do this in memory, but ok.
Comment 10 WebKit Commit Bot 2010-04-22 20:30:31 PDT
Comment on attachment 53687 [details]
Patch

Clearing flags on attachment: 53687

Committed r58143: <http://trac.webkit.org/changeset/58143>
Comment 11 WebKit Commit Bot 2010-04-22 20:30:36 PDT
All reviewed patches have been landed.  Closing bug.