Bug 173772

Summary: [WPE] Add run-wpe-tests script to run WPE glib API tests
Product: WebKit Reporter: Carlos Garcia Campos <cgarcia>
Component: WPE WebKitAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: bugs-noreply, clopez, mcatanzaro
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 173770    
Bug Blocks:    
Attachments:
Description Flags
Patch mcatanzaro: review+

Description Carlos Garcia Campos 2017-06-23 09:27:08 PDT
Refactoring the run-gtk-tests script to share the code as much as possible.
Comment 1 Carlos Garcia Campos 2017-06-23 09:30:53 PDT
Created attachment 313723 [details]
Patch
Comment 2 Michael Catanzaro 2017-07-02 09:21:16 PDT
Comment on attachment 313723 [details]
Patch

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

> Tools/ChangeLog:8
> +        Move common code from run-gtk-tests to api_test_runner.py, to be shared by both run-gtk-tests and un-wpe-tests.

run-wpe-tests
Comment 3 Carlos Garcia Campos 2017-11-20 03:03:34 PST
Committed r225047: <https://trac.webkit.org/changeset/225047>
Comment 4 Michael Catanzaro 2017-11-20 15:39:19 PST
It broke run-gtk-tests:

$ run-gtk-tests
Traceback (most recent call last):
  File "/home/mcatanzaro/Projects/WebKit/Tools/Scripts/run-gtk-tests", line 159, in <module>
    if not jhbuildutils.enter_jhbuild_environment_if_available("gtk"):
  File "/home/mcatanzaro/Projects/WebKit/Tools/jhbuild/jhbuildutils.py", line 51, in enter_jhbuild_environment_if_available
    config = jhbuild.config.Config(get_config_file_for_platform(platform), [])
  File "/home/mcatanzaro/Projects/WebKit/WebKitBuild/DependenciesGTK/Source/jhbuild/jhbuild/config.py", line 167, in __init__
    self.load(filename)
  File "/home/mcatanzaro/Projects/WebKit/WebKitBuild/DependenciesGTK/Source/jhbuild/jhbuild/config.py", line 220, in load
    _('unknown keys defined in configuration file: %s') % \
NameError: global name '_' is not defined

It's tricky.
Comment 5 Michael Catanzaro 2017-11-20 15:51:16 PST
It has to be imported into Python's builtins namespace using gettext.install(), see https://docs.python.org/2.7/library/gettext.html#gettext.install. jhbuild does that itself, but we break that by trying to call into jhbuild's internal classes directly. So we have to do it ourselves.

I'm confused because none of the code you moved did this, so I'm not sure how it worked before. But whatever.
Comment 6 Michael Catanzaro 2017-11-20 15:51:58 PST
Committed r225055: <https://trac.webkit.org/changeset/225055>
Comment 7 Michael Catanzaro 2017-11-20 16:55:08 PST
(In reply to Michael Catanzaro from comment #6)
> Committed r225055: <https://trac.webkit.org/changeset/225055>

Bots are happy again. Well, the API tests are still failing, but they're being run again.