Diff
Modified: trunk/Tools/CISupport/build-webkit-org/steps.py (281918 => 281919)
--- trunk/Tools/CISupport/build-webkit-org/steps.py 2021-09-02 11:03:53 UTC (rev 281918)
+++ trunk/Tools/CISupport/build-webkit-org/steps.py 2021-09-02 11:45:38 UTC (rev 281919)
@@ -940,11 +940,11 @@
class RunGtkAPITests(RunGLibAPITests):
- command = ["python", "./Tools/Scripts/run-gtk-tests", WithProperties("--%(configuration)s")]
+ command = ["python3", "./Tools/Scripts/run-gtk-tests", WithProperties("--%(configuration)s")]
class RunWPEAPITests(RunGLibAPITests):
- command = ["python", "./Tools/Scripts/run-wpe-tests", WithProperties("--%(configuration)s")]
+ command = ["python3", "./Tools/Scripts/run-wpe-tests", WithProperties("--%(configuration)s")]
class RunWebDriverTests(shell.Test):
Modified: trunk/Tools/CISupport/ews-build/steps.py (281918 => 281919)
--- trunk/Tools/CISupport/ews-build/steps.py 2021-09-02 11:03:53 UTC (rev 281918)
+++ trunk/Tools/CISupport/ews-build/steps.py 2021-09-02 11:45:38 UTC (rev 281919)
@@ -2857,7 +2857,7 @@
def start(self):
platform = self.getProperty('platform')
if platform == 'gtk':
- command = ['python', 'Tools/Scripts/run-gtk-tests',
+ command = ['python3', 'Tools/Scripts/run-gtk-tests',
'--{0}'.format(self.getProperty('configuration')),
'--json-output={0}'.format(self.jsonFileName)]
self.setCommand(command)
Modified: trunk/Tools/CISupport/ews-build/steps_unittest.py (281918 => 281919)
--- trunk/Tools/CISupport/ews-build/steps_unittest.py 2021-09-02 11:03:53 UTC (rev 281918)
+++ trunk/Tools/CISupport/ews-build/steps_unittest.py 2021-09-02 11:45:38 UTC (rev 281919)
@@ -3275,7 +3275,7 @@
self.expectRemoteCommands(
ExpectShell(workdir='wkdir',
logEnviron=False,
- command=['python', 'Tools/Scripts/run-gtk-tests', '--release', '--json-output={0}'.format(self.jsonFileName)],
+ command=['python3', 'Tools/Scripts/run-gtk-tests', '--release', '--json-output={0}'.format(self.jsonFileName)],
logfiles={'json': self.jsonFileName},
)
+ ExpectShell.log('stdio', stdout='''...
@@ -3552,7 +3552,7 @@
self.expectRemoteCommands(
ExpectShell(workdir='wkdir',
logEnviron=False,
- command=['python',
+ command=['python3',
'Tools/Scripts/run-gtk-tests',
'--debug',
'--json-output={0}'.format(self.jsonFileName)],
Modified: trunk/Tools/ChangeLog (281918 => 281919)
--- trunk/Tools/ChangeLog 2021-09-02 11:03:53 UTC (rev 281918)
+++ trunk/Tools/ChangeLog 2021-09-02 11:45:38 UTC (rev 281919)
@@ -1,3 +1,44 @@
+2021-09-02 Carlos Alberto Lopez Perez <clo...@igalia.com>
+
+ [GTK][WPE] Port API test runner to python3
+ https://bugs.webkit.org/show_bug.cgi?id=229782
+
+ Reviewed by Philippe Normand.
+
+ Port the GTK/WPE API test runner to be compatible with python3
+ and set it to run with python3 by default.
+ The runner is still compatible with python2 after this patch, so
+ we can land this without immediately requiring a restart of the CI.
+
+ * Scripts/run-gtk-tests:
+ (GtkTestRunner): Deleted.
+ (GtkTestRunner.__init__): Deleted.
+ (GtkTestRunner._ensure_accessibility_service_is_running): Deleted.
+ (GtkTestRunner._setup_testing_environment): Deleted.
+ (GtkTestRunner._tear_down_testing_environment): Deleted.
+ (GtkTestRunner.is_glib_test): Deleted.
+ (GtkTestRunner.is_google_test): Deleted.
+ (GtkTestRunner.is_qt_test): Deleted.
+ * Scripts/run-perf-tests:
+ * Scripts/run-wpe-tests:
+ (WPETestRunner): Deleted.
+ (WPETestRunner.__init__): Deleted.
+ (WPETestRunner.is_glib_test): Deleted.
+ (WPETestRunner.is_google_test): Deleted.
+ (WPETestRunner.is_qt_test): Deleted.
+ * glib/api_test_runner.py:
+ (TestRunner._get_tests_from_google_test_suite):
+ (TestRunner.run_tests):
+ (TestRunner.run_tests.number_of_tests):
+ * glib/common.py:
+ (parse_output_lines):
+ * glib/glib_test_runner.py:
+ (Message.create.read_string):
+ (Message):
+ (GLibTestRunner._read_from_pipe):
+ (GLibTestRunner._read_from_stderr):
+ (GLibTestRunner.run):
+
2021-09-01 Jonathan Bedard <jbed...@apple.com>
[contributors.json] Relocation (Part 2)
Modified: trunk/Tools/Scripts/run-gtk-tests (281918 => 281919)
--- trunk/Tools/Scripts/run-gtk-tests 2021-09-02 11:03:53 UTC (rev 281918)
+++ trunk/Tools/Scripts/run-gtk-tests 2021-09-02 11:45:38 UTC (rev 281919)
@@ -1,6 +1,6 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
#
-# Copyright (C) 2011, 2012, 2017 Igalia S.L.
+# Copyright (C) 2011, 2012, 2017, 2021 Igalia S.L.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
Modified: trunk/Tools/Scripts/run-perf-tests (281918 => 281919)
--- trunk/Tools/Scripts/run-perf-tests 2021-09-02 11:03:53 UTC (rev 281918)
+++ trunk/Tools/Scripts/run-perf-tests 2021-09-02 11:45:38 UTC (rev 281919)
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# Copyright (C) 2012 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
Modified: trunk/Tools/Scripts/run-wpe-tests (281918 => 281919)
--- trunk/Tools/Scripts/run-wpe-tests 2021-09-02 11:03:53 UTC (rev 281918)
+++ trunk/Tools/Scripts/run-wpe-tests 2021-09-02 11:45:38 UTC (rev 281919)
@@ -1,6 +1,6 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
#
-# Copyright (C) 2017 Igalia S.L.
+# Copyright (C) 2017, 2021 Igalia S.L.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
Modified: trunk/Tools/glib/api_test_runner.py (281918 => 281919)
--- trunk/Tools/glib/api_test_runner.py 2021-09-02 11:03:53 UTC (rev 281918)
+++ trunk/Tools/glib/api_test_runner.py 2021-09-02 11:45:38 UTC (rev 281919)
@@ -199,7 +199,7 @@
def _get_tests_from_google_test_suite(self, test_program, skipped_test_cases):
try:
- output = subprocess.check_output([test_program, '--gtest_list_tests'], env=self._test_env)
+ output = subprocess.check_output([test_program, '--gtest_list_tests'], env=self._test_env).decode('utf-8')
except subprocess.CalledProcessError:
sys.stderr.write("ERROR: could not list available tests for binary %s.\n" % (test_program))
sys.stderr.flush()
@@ -313,7 +313,7 @@
if number_of_executed_subtests_for_test > 1:
number_of_executed_tests += number_of_executed_subtests_for_test
number_of_total_tests += number_of_executed_subtests_for_test
- for test_case, result in results.iteritems():
+ for test_case, result in results.items():
if result in self._expectations.get_expectation(os.path.basename(test), test_case):
continue
@@ -329,7 +329,7 @@
self._tear_down_testing_environment()
def number_of_tests(tests):
- return sum(len(value) for value in tests.itervalues())
+ return sum(len(value) for value in tests.values())
def report(tests, title, base_dir):
if not tests:
Modified: trunk/Tools/glib/common.py (281918 => 281919)
--- trunk/Tools/glib/common.py 2021-09-02 11:03:53 UTC (rev 281918)
+++ trunk/Tools/glib/common.py 2021-09-02 11:45:38 UTC (rev 281919)
@@ -128,10 +128,12 @@
chunk = ''
else:
raise e
- if not chunk:
+
+ if chunk:
+ output += chunk.decode('utf-8')
+ else:
read_set.remove(fd)
- output += chunk
while '\n' in output:
pos = output.find('\n')
parse_line_callback(output[:pos + 1])
Modified: trunk/Tools/glib/glib_test_runner.py (281918 => 281919)
--- trunk/Tools/glib/glib_test_runner.py 2021-09-02 11:03:53 UTC (rev 281918)
+++ trunk/Tools/glib/glib_test_runner.py 2021-09-02 11:45:38 UTC (rev 281919)
@@ -37,12 +37,12 @@
LOG_MAX_RESULT,
LOG_MESSAGE,
LOG_START_SUITE,
- LOG_STOP_SUITE) = range(12)
+ LOG_STOP_SUITE) = list(range(12))
(TEST_RUN_SUCCESS,
TEST_RUN_SKIPPED,
TEST_RUN_FAILURE,
- TEST_RUN_INCOMPLETE) = range(4)
+ TEST_RUN_INCOMPLETE) = list(range(4))
class TestTimeout(Exception):
@@ -72,7 +72,7 @@
values = []
for i in range(n):
str_len = read_unsigned(bytes)[0]
- values.append(struct.unpack('%ds' % str_len, bytes.read(str_len))[0])
+ values.append(struct.unpack('%ds' % str_len, bytes.read(str_len))[0].decode('utf-8'))
return values
bytes = BytesIO(data)
@@ -127,7 +127,7 @@
self._subtest_message([message.strings[0]])
def _read_from_pipe(self, pipe_r):
- data = ''
+ data = ""
read_set = [pipe_r]
while read_set:
try:
@@ -165,7 +165,7 @@
if not buffer:
return data
- data += buffer
+ data += buffer.decode('utf-8')
@staticmethod
def _start_timeout(timeout):
@@ -248,7 +248,10 @@
if not self._results:
sys.stdout.write('TEST: %s...\n' % self._test_binary)
sys.stdout.flush()
- p = subprocess.Popen(command, stderr=subprocess.PIPE, env=env)
+ if sys.version_info.major > 2:
+ p = subprocess.Popen(command, stderr=subprocess.PIPE, env=env, pass_fds=[pipe_w])
+ else:
+ p = subprocess.Popen(command, stderr=subprocess.PIPE, env=env)
self._stderr_fd = p.stderr.fileno()
os.close(pipe_w)