Bug 96543 - [GTK] Clear application cache between tests in DumpRenderTree
Summary: [GTK] Clear application cache between tests in DumpRenderTree
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Zan Dobersek
URL:
Keywords:
Depends on: 96681
Blocks:
  Show dependency treegraph
 
Reported: 2012-09-12 12:44 PDT by Zan Dobersek
Modified: 2012-09-14 05:42 PDT (History)
7 users (show)

See Also:


Attachments
Patch (5.44 KB, patch)
2012-09-12 12:50 PDT, Zan Dobersek
no flags Details | Formatted Diff | Diff
Patch (6.37 KB, patch)
2012-09-14 05:29 PDT, Zan Dobersek
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Zan Dobersek 2012-09-12 12:44:56 PDT
[GTK] Clear application cache between tests in DumpRenderTree
Comment 1 Zan Dobersek 2012-09-12 12:50:41 PDT
Created attachment 163671 [details]
Patch
Comment 2 Philippe Normand 2012-09-13 01:28:37 PDT
Comment on attachment 163671 [details]
Patch

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

> Tools/Scripts/webkitpy/layout_tests/port/gtk.py:-70
> +        environment['XDG_CACHE_HOME'] = self._filesystem.join(self.results_directory(), 'appcache')
>          self._copy_value_from_environ_if_set(environment, 'WEBKITOUTPUTDIR')
> -        if self.get_option('webkit_test_runner'):
> -            # FIXME: This is a workaround to ensure that testing with WebKitTestRunner is started with
> -            # a non-existing cache. This should be removed when (and if) it will be possible to properly
> -            # set the cache directory path through a WebKitWebContext.
> -            environment['XDG_CACHE_HOME'] = self._filesystem.join(self.results_directory(), 'appcache')

Not sure I understand this change. If the appcache is cleared properly why do we still need to set XDG_CACHE_HOME to point to the results directory?
Comment 3 Zan Dobersek 2012-09-13 01:39:56 PDT
(In reply to comment #2)
> 
> Not sure I understand this change. If the appcache is cleared properly why do we still need to set XDG_CACHE_HOME to point to the results directory?

One reason would be to avoid manipulating the default user's cache (~/.cache/) which is used by Epiphany as well.
Another reason is to start every test run (at least on the builders, with each build) with a clean, non-existent cache.

I can put a comment above this change, explaining why this is done.
Comment 4 Philippe Normand 2012-09-13 01:49:34 PDT
(In reply to comment #3)
> (In reply to comment #2)
> > 
> > Not sure I understand this change. If the appcache is cleared properly why do we still need to set XDG_CACHE_HOME to point to the results directory?
> 
> One reason would be to avoid manipulating the default user's cache (~/.cache/) which is used by Epiphany as well.

Well Epiphany uses a custom directory I hope?

> Another reason is to start every test run (at least on the builders, with each build) with a clean, non-existent cache.
> 

But that's exactly the purpose of the method added in DRT support no?
Comment 5 Zan Dobersek 2012-09-13 02:04:45 PDT
(In reply to comment #4)
> (In reply to comment #3)
> > (In reply to comment #2)
> > > 
> > > Not sure I understand this change. If the appcache is cleared properly why do we still need to set XDG_CACHE_HOME to point to the results directory?
> > 
> > One reason would be to avoid manipulating the default user's cache (~/.cache/) which is used by Epiphany as well.
> 
> Well Epiphany uses a custom directory I hope?

I can't tell for sure, the cache directory is by default set to $XDG_CACHE_HOME/webkitgtk/applications:
http://trac.webkit.org/browser/trunk/Source/WebKit/gtk/webkit/webkitglobals.cpp#L585

> > Another reason is to start every test run (at least on the builders, with each build) with a clean, non-existent cache.
> > 
> 
> But that's exactly the purpose of the method added in DRT support no?

The main use of that method is to clean the cache between each test. Setting XDG_CACHE_HOME env just assures we're not poking around user's actual WebKitGTK+ cache and that the testing is started with an empty cache directory.
Comment 6 Zan Dobersek 2012-09-13 02:10:58 PDT
(In reply to comment #5)
> (In reply to comment #4)
> > (In reply to comment #3)
> > > Another reason is to start every test run (at least on the builders, with each build) with a clean, non-existent cache.
> > > 
> > 
> > But that's exactly the purpose of the method added in DRT support no?
> 
> The main use of that method is to clean the cache between each test. Setting XDG_CACHE_HOME env just assures we're not poking around user's actual WebKitGTK+ cache and that the testing is started with an empty cache directory.

Another option is to point XDG_CACHE_HOME to a temporary directory (if it's decided overriding XDG_CACHE_HOME is acceptable).
Comment 7 Philippe Normand 2012-09-13 03:11:38 PDT
Ok I think it's fine to use the results directory then. Thanks for the clarification!
Comment 8 Zan Dobersek 2012-09-13 05:54:55 PDT
(In reply to comment #7)
> Ok I think it's fine to use the results directory then. Thanks for the clarification!

So r+ maybe? :>
Comment 9 Philippe Normand 2012-09-13 06:31:12 PDT
Comment on attachment 163671 [details]
Patch

r=me
Comment 10 Zan Dobersek 2012-09-13 06:59:31 PDT
(In reply to comment #9)
> (From update of attachment 163671 [details])
> r=me

Thanks!
Comment 11 Zan Dobersek 2012-09-13 07:02:30 PDT
Comment on attachment 163671 [details]
Patch

Clearing flags on attachment: 163671

Committed r128453: <http://trac.webkit.org/changeset/128453>
Comment 12 Zan Dobersek 2012-09-13 07:02:37 PDT
All reviewed patches have been landed.  Closing bug.
Comment 13 WebKit Review Bot 2012-09-13 12:16:19 PDT
Re-opened since this is blocked by 96681
Comment 14 Zan Dobersek 2012-09-14 05:29:49 PDT
Created attachment 164115 [details]
Patch
Comment 15 Zan Dobersek 2012-09-14 05:42:46 PDT
Comment on attachment 164115 [details]
Patch

Clearing flags on attachment: 164115

Committed r128596: <http://trac.webkit.org/changeset/128596>
Comment 16 Zan Dobersek 2012-09-14 05:42:51 PDT
All reviewed patches have been landed.  Closing bug.