Bug 227327

Summary: [webkitcorepy] Add test suite with temp directory
Product: WebKit Reporter: Jonathan Bedard <jbedard>
Component: Tools / TestsAssignee: Jonathan Bedard <jbedard>
Status: RESOLVED FIXED    
Severity: Normal CC: aakash_jain, dewei_zhu, slewis, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=225616
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Patch for landing none

Description Jonathan Bedard 2021-06-23 16:05:08 PDT
We end up duplicating quite a bit of code which creates and deletes a temporary directory during unit testing. It's pretty easy to build a shared TestCase class which reduces our duplicated code.
Comment 1 Radar WebKit Bug Importer 2021-06-23 16:06:20 PDT
<rdar://problem/79697909>
Comment 2 Jonathan Bedard 2021-06-23 16:12:34 PDT
Created attachment 432101 [details]
Patch
Comment 3 Jonathan Bedard 2021-06-28 07:06:52 PDT
Created attachment 432391 [details]
Patch
Comment 4 Stephanie Lewis 2021-06-28 09:24:59 PDT
Comment on attachment 432391 [details]
Patch

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

> Tools/Scripts/libraries/webkitcorepy/webkitcorepy/unittest.py:29
> +from unittest import TestCase

whats the value in overriding the name? I think importing unitest and something like webkitunittest would be a lot clearer.
Comment 5 Jonathan Bedard 2021-06-28 09:44:40 PDT
(In reply to Stephanie Lewis from comment #4)
> Comment on attachment 432391 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=432391&action=review
> 
> > Tools/Scripts/libraries/webkitcorepy/webkitcorepy/unittest.py:29
> > +from unittest import TestCase
> 
> whats the value in overriding the name? I think importing unitest and
> something like webkitunittest would be a lot clearer.

Mostly because then something importing it would be `from webkitcorepy.webkitunittest import <class>` which seemed redundant to me...would `from webkitcorepy.testing` be better?
Comment 6 Jonathan Bedard 2021-06-28 10:27:17 PDT
Created attachment 432407 [details]
Patch
Comment 7 Jonathan Bedard 2021-06-28 11:45:37 PDT
Created attachment 432411 [details]
Patch for landing
Comment 8 EWS 2021-06-28 12:57:23 PDT
Committed r279347 (239215@main): <https://commits.webkit.org/239215@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 432411 [details].