Title: [291240] trunk/Tools
Revision
291240
Author
[email protected]
Date
2022-03-14 11:25:28 -0700 (Mon, 14 Mar 2022)

Log Message

[Flatpack SDK] Api tests scripts have conflicting parameters with the flatpak scripts
https://bugs.webkit.org/show_bug.cgi?id=237778

Patch by Alejandro G. Castro <[email protected]> on 2022-03-14
Reviewed by Philippe Normand.

run-gtk-tests and run-wpe-tests have arguments that cause
conflicts with the flatpak sdk, we have to rewrite and consume
some of them to avoid problems because we do not know what the
user is requesting. This patch gives priority to the api tests
parameters, the flatpak ones for the conflictive situations need
to be passed with the long format, namely regenerate-toolchains
and sccache-token.

* Scripts/run-gtk-tests:
* Scripts/run-wpe-tests:
* glib/api_test_runner.py:
(add_options):
(get_runner_args):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (291239 => 291240)


--- trunk/Tools/ChangeLog	2022-03-14 18:14:06 UTC (rev 291239)
+++ trunk/Tools/ChangeLog	2022-03-14 18:25:28 UTC (rev 291240)
@@ -1,3 +1,24 @@
+2022-03-14  Alejandro G. Castro  <[email protected]>
+
+        [Flatpack SDK] Api tests scripts have conflicting parameters with the flatpak scripts
+        https://bugs.webkit.org/show_bug.cgi?id=237778
+
+        Reviewed by Philippe Normand.
+
+        run-gtk-tests and run-wpe-tests have arguments that cause
+        conflicts with the flatpak sdk, we have to rewrite and consume
+        some of them to avoid problems because we do not know what the
+        user is requesting. This patch gives priority to the api tests
+        parameters, the flatpak ones for the conflictive situations need
+        to be passed with the long format, namely regenerate-toolchains
+        and sccache-token.
+
+        * Scripts/run-gtk-tests:
+        * Scripts/run-wpe-tests:
+        * glib/api_test_runner.py:
+        (add_options):
+        (get_runner_args):
+
 2022-03-14  Jonathan Bedard  <[email protected]>
 
         [webkitcorepy] Do not fetch key without username

Modified: trunk/Tools/Scripts/run-gtk-tests (291239 => 291240)


--- trunk/Tools/Scripts/run-gtk-tests	2022-03-14 18:14:06 UTC (rev 291239)
+++ trunk/Tools/Scripts/run-gtk-tests	2022-03-14 18:25:28 UTC (rev 291240)
@@ -29,7 +29,7 @@
 import common
 import jhbuildutils
 import flatpakutils
-from api_test_runner import TestRunner, add_options
+from api_test_runner import TestRunner, add_options, get_runner_args
 
 
 try:
@@ -87,7 +87,8 @@
         return False
 
 if __name__ == "__main__":
-    flatpakutils.run_in_sandbox_if_available(sys.argv)
+    runner_args = get_runner_args(sys.argv)
+    flatpakutils.run_in_sandbox_if_available(runner_args)
     if not flatpakutils.is_sandboxed() and not jhbuildutils.enter_jhbuild_environment_if_available("gtk"):
         print('***')
         print('*** Warning: jhbuild environment not present and not running in flatpak.')

Modified: trunk/Tools/Scripts/run-wpe-tests (291239 => 291240)


--- trunk/Tools/Scripts/run-wpe-tests	2022-03-14 18:14:06 UTC (rev 291239)
+++ trunk/Tools/Scripts/run-wpe-tests	2022-03-14 18:25:28 UTC (rev 291240)
@@ -29,7 +29,7 @@
 import common
 import jhbuildutils
 import flatpakutils
-from api_test_runner import TestRunner, add_options
+from api_test_runner import TestRunner, add_options, get_runner_args
 
 class WPETestRunner(TestRunner):
     TestRunner.TEST_TARGETS = [ "WPE", "WPEQt", "TestWebKit", "TestJSC", "TestWTF", "TestWebCore" ]
@@ -47,7 +47,8 @@
         return os.path.basename(os.path.dirname(test_program)) == "WPEQt"
 
 if __name__ == "__main__":
-    flatpakutils.run_in_sandbox_if_available([sys.argv[0], "--wpe"] + sys.argv[1:])
+    runner_args = get_runner_args(sys.argv)
+    flatpakutils.run_in_sandbox_if_available([runner_args[0], "--wpe"] + runner_args[1:])
     if not flatpakutils.is_sandboxed() and not jhbuildutils.enter_jhbuild_environment_if_available("wpe"):
         print('***')
         print('*** Warning: jhbuild environment not present and not running in flatpak.')

Modified: trunk/Tools/glib/api_test_runner.py (291239 => 291240)


--- trunk/Tools/glib/api_test_runner.py	2022-03-14 18:14:06 UTC (rev 291239)
+++ trunk/Tools/glib/api_test_runner.py	2022-03-14 18:25:28 UTC (rev 291240)
@@ -396,3 +396,25 @@
                              help='Save test results as JSON to file')
     option_parser.add_option('-p', action='', dest='subtests', default=[],
                              help='Subtests to run')
+
+
+def get_runner_args(argv):
+    runner_args = []
+    for arg in argv:
+        if (arg == "-d"):
+            runner_args.append("--debug")
+            continue
+        # FIXME: This parameter -r is ambiguous for some or the
+        # scripts using flatpak, we consume it, users must use the
+        # long name format for the flatpak option --regenerate-toolchains.
+        if (arg == "-r"):
+            runner_args.append("--release")
+            continue
+        # FIXME: This parameter -t is ambiguous for some or the
+        # scripts using flatpak, we consume it, users must use the
+        # long name format for the flatpak option --sccache-token.
+        if (arg == "-t"):
+            runner_args.append("--timeout")
+            continue
+        runner_args.append(arg)
+    return runner_args
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to