[run-webkit-tests] Support python layout tests
https://bugs.webkit.org/show_bug.cgi?id=220749
Tools:
<rdar://problem/73375271>
Reviewed by Alexey Proskuryakov.
* Scripts/webkitpy/layout_tests/controllers/layout_test_finder.py:
(LayoutTestFinder._real_tests): Exclude "tools" directories.
(LayoutTestFinder._is_test_file): Special case for web socket's *_wsh.py files.
(LayoutTestFinder._is_w3c_resource_file): Exclude w3c Python files.
LayoutTests:
Reviewed by Alexey Proskuryakov.
* html5lib/generate-test-wrappers: Copied from LayoutTests/html5lib/generate-test-wrappers.py.
* html5lib/generate-test-wrappers.py: Removed.
* http/conf/apache2.2-httpd.conf: Allow .py files to be run as CGI binaries.
* http/conf/apache2.4-httpd.conf: Ditto.
* http/conf/apache2.4-php7-httpd.conf: Ditto.
* http/conf/archlinux-httpd.conf: Ditto.
* http/conf/debian-httpd-2.4-php7.0.conf: Ditto.
* http/conf/debian-httpd-2.4-php7.1.conf: Ditto.
* http/conf/debian-httpd-2.4-php7.2.conf: Ditto.
* http/conf/debian-httpd-2.4-php7.3.conf: Ditto.
* http/conf/debian-httpd-2.4-php7.4.conf: Ditto.
* http/conf/fedora-httpd-2.2.conf: Ditto.
* http/conf/fedora-httpd-2.4-php7.conf: Ditto.
* http/conf/fedora-httpd-2.4.conf: Ditto.
* http/conf/flatpak-httpd.conf: Ditto.
* http/conf/win-httpd-2.4-php5.conf: Ditto.
* http/conf/win-httpd-2.4-php7.conf: Ditto.
* media/track/opera/track/webvtt/parsing-cue-data/buildtests: Copied from LayoutTests/media/track/opera/track/webvtt/parsing-cue-data/buildtests.py.
* media/track/opera/track/webvtt/parsing-cue-data/buildtests.py: Removed.
* webgl/generate-webgl-tests: Copied from LayoutTests/webgl/generate-webgl-tests.py.
* webgl/generate-webgl-tests.py: Removed.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@271867 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 2650388..e6fad0d 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,32 @@
+2021-01-25 Jonathan Bedard <jbedard@apple.com>
+
+ [run-webkit-tests] Support python layout tests
+ https://bugs.webkit.org/show_bug.cgi?id=220749
+
+ Reviewed by Alexey Proskuryakov.
+
+ * html5lib/generate-test-wrappers: Copied from LayoutTests/html5lib/generate-test-wrappers.py.
+ * html5lib/generate-test-wrappers.py: Removed.
+ * http/conf/apache2.2-httpd.conf: Allow .py files to be run as CGI binaries.
+ * http/conf/apache2.4-httpd.conf: Ditto.
+ * http/conf/apache2.4-php7-httpd.conf: Ditto.
+ * http/conf/archlinux-httpd.conf: Ditto.
+ * http/conf/debian-httpd-2.4-php7.0.conf: Ditto.
+ * http/conf/debian-httpd-2.4-php7.1.conf: Ditto.
+ * http/conf/debian-httpd-2.4-php7.2.conf: Ditto.
+ * http/conf/debian-httpd-2.4-php7.3.conf: Ditto.
+ * http/conf/debian-httpd-2.4-php7.4.conf: Ditto.
+ * http/conf/fedora-httpd-2.2.conf: Ditto.
+ * http/conf/fedora-httpd-2.4-php7.conf: Ditto.
+ * http/conf/fedora-httpd-2.4.conf: Ditto.
+ * http/conf/flatpak-httpd.conf: Ditto.
+ * http/conf/win-httpd-2.4-php5.conf: Ditto.
+ * http/conf/win-httpd-2.4-php7.conf: Ditto.
+ * media/track/opera/track/webvtt/parsing-cue-data/buildtests: Copied from LayoutTests/media/track/opera/track/webvtt/parsing-cue-data/buildtests.py.
+ * media/track/opera/track/webvtt/parsing-cue-data/buildtests.py: Removed.
+ * webgl/generate-webgl-tests: Copied from LayoutTests/webgl/generate-webgl-tests.py.
+ * webgl/generate-webgl-tests.py: Removed.
+
2021-01-25 Sam Weinig <weinig@apple.com>
Support percentages when parsing color(srgb ...) and color(display-p3 ...) per-spec
diff --git a/LayoutTests/html5lib/generate-test-wrappers.py b/LayoutTests/html5lib/generate-test-wrappers
old mode 100755
new mode 100644
similarity index 100%
rename from LayoutTests/html5lib/generate-test-wrappers.py
rename to LayoutTests/html5lib/generate-test-wrappers
diff --git a/LayoutTests/http/conf/apache2.2-httpd.conf b/LayoutTests/http/conf/apache2.2-httpd.conf
index 28fddf7..4a740e4 100644
--- a/LayoutTests/http/conf/apache2.2-httpd.conf
+++ b/LayoutTests/http/conf/apache2.2-httpd.conf
@@ -108,7 +108,7 @@
AddEncoding x-compress .Z
AddEncoding x-gzip .gz .tgz
- AddHandler cgi-script .cgi .pl
+ AddHandler cgi-script .cgi .pl .py
AddType text/html .shtml
AddHandler server-parsed .shtml
diff --git a/LayoutTests/http/conf/apache2.4-httpd.conf b/LayoutTests/http/conf/apache2.4-httpd.conf
index 1abb51f..b202e0e 100644
--- a/LayoutTests/http/conf/apache2.4-httpd.conf
+++ b/LayoutTests/http/conf/apache2.4-httpd.conf
@@ -115,7 +115,7 @@
AddEncoding x-compress .Z
AddEncoding x-gzip .gz .tgz
- AddHandler cgi-script .cgi .pl
+ AddHandler cgi-script .cgi .pl .py
AddType text/html .shtml
AddHandler server-parsed .shtml
diff --git a/LayoutTests/http/conf/apache2.4-php7-httpd.conf b/LayoutTests/http/conf/apache2.4-php7-httpd.conf
index 0d61b50..6bc9392 100644
--- a/LayoutTests/http/conf/apache2.4-php7-httpd.conf
+++ b/LayoutTests/http/conf/apache2.4-php7-httpd.conf
@@ -119,7 +119,7 @@
AddEncoding x-compress .Z
AddEncoding x-gzip .gz .tgz
- AddHandler cgi-script .cgi .pl
+ AddHandler cgi-script .cgi .pl .py
AddType text/html .shtml
AddHandler server-parsed .shtml
diff --git a/LayoutTests/http/conf/archlinux-httpd.conf b/LayoutTests/http/conf/archlinux-httpd.conf
index 3b24710..f28ce3b 100644
--- a/LayoutTests/http/conf/archlinux-httpd.conf
+++ b/LayoutTests/http/conf/archlinux-httpd.conf
@@ -109,7 +109,7 @@
AddType application/x-x509-ca-cert .crt
AddType application/x-pkcs7-crl .crl
-AddHandler cgi-script .cgi .pl
+AddHandler cgi-script .cgi .pl .py
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
diff --git a/LayoutTests/http/conf/debian-httpd-2.4-php7.0.conf b/LayoutTests/http/conf/debian-httpd-2.4-php7.0.conf
index 538231d..1399baa 100644
--- a/LayoutTests/http/conf/debian-httpd-2.4-php7.0.conf
+++ b/LayoutTests/http/conf/debian-httpd-2.4-php7.0.conf
@@ -105,7 +105,7 @@
AddType application/x-x509-ca-cert .crt
AddType application/x-pkcs7-crl .crl
-AddHandler cgi-script .cgi .pl
+AddHandler cgi-script .cgi .pl .py
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
diff --git a/LayoutTests/http/conf/debian-httpd-2.4-php7.1.conf b/LayoutTests/http/conf/debian-httpd-2.4-php7.1.conf
index d83a308..2487f75 100644
--- a/LayoutTests/http/conf/debian-httpd-2.4-php7.1.conf
+++ b/LayoutTests/http/conf/debian-httpd-2.4-php7.1.conf
@@ -105,7 +105,7 @@
AddType application/x-x509-ca-cert .crt
AddType application/x-pkcs7-crl .crl
-AddHandler cgi-script .cgi .pl
+AddHandler cgi-script .cgi .pl .py
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
diff --git a/LayoutTests/http/conf/debian-httpd-2.4-php7.2.conf b/LayoutTests/http/conf/debian-httpd-2.4-php7.2.conf
index 1b32a05..5725426 100644
--- a/LayoutTests/http/conf/debian-httpd-2.4-php7.2.conf
+++ b/LayoutTests/http/conf/debian-httpd-2.4-php7.2.conf
@@ -105,7 +105,7 @@
AddType application/x-x509-ca-cert .crt
AddType application/x-pkcs7-crl .crl
-AddHandler cgi-script .cgi .pl
+AddHandler cgi-script .cgi .pl .py
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
diff --git a/LayoutTests/http/conf/debian-httpd-2.4-php7.3.conf b/LayoutTests/http/conf/debian-httpd-2.4-php7.3.conf
index bd763a5..d3d411b 100644
--- a/LayoutTests/http/conf/debian-httpd-2.4-php7.3.conf
+++ b/LayoutTests/http/conf/debian-httpd-2.4-php7.3.conf
@@ -105,7 +105,7 @@
AddType application/x-x509-ca-cert .crt
AddType application/x-pkcs7-crl .crl
-AddHandler cgi-script .cgi .pl
+AddHandler cgi-script .cgi .pl .py
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
diff --git a/LayoutTests/http/conf/debian-httpd-2.4-php7.4.conf b/LayoutTests/http/conf/debian-httpd-2.4-php7.4.conf
index affc39c..74b912f 100644
--- a/LayoutTests/http/conf/debian-httpd-2.4-php7.4.conf
+++ b/LayoutTests/http/conf/debian-httpd-2.4-php7.4.conf
@@ -105,7 +105,7 @@
AddType application/x-x509-ca-cert .crt
AddType application/x-pkcs7-crl .crl
-AddHandler cgi-script .cgi .pl
+AddHandler cgi-script .cgi .pl .py
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
diff --git a/LayoutTests/http/conf/fedora-httpd-2.2.conf b/LayoutTests/http/conf/fedora-httpd-2.2.conf
index 6eedb37..eff83a6 100644
--- a/LayoutTests/http/conf/fedora-httpd-2.2.conf
+++ b/LayoutTests/http/conf/fedora-httpd-2.2.conf
@@ -111,7 +111,7 @@
AddType application/x-x509-ca-cert .crt
AddType application/x-pkcs7-crl .crl
-AddHandler cgi-script .cgi .pl
+AddHandler cgi-script .cgi .pl .py
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
diff --git a/LayoutTests/http/conf/fedora-httpd-2.4-php7.conf b/LayoutTests/http/conf/fedora-httpd-2.4-php7.conf
index affa609..8f3c554 100644
--- a/LayoutTests/http/conf/fedora-httpd-2.4-php7.conf
+++ b/LayoutTests/http/conf/fedora-httpd-2.4-php7.conf
@@ -109,7 +109,7 @@
AddType application/x-x509-ca-cert .crt
AddType application/x-pkcs7-crl .crl
-AddHandler cgi-script .cgi .pl
+AddHandler cgi-script .cgi .pl .py
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
diff --git a/LayoutTests/http/conf/fedora-httpd-2.4.conf b/LayoutTests/http/conf/fedora-httpd-2.4.conf
index 020b2e4..a1b1b90 100644
--- a/LayoutTests/http/conf/fedora-httpd-2.4.conf
+++ b/LayoutTests/http/conf/fedora-httpd-2.4.conf
@@ -109,7 +109,7 @@
AddType application/x-x509-ca-cert .crt
AddType application/x-pkcs7-crl .crl
-AddHandler cgi-script .cgi .pl
+AddHandler cgi-script .cgi .pl .py
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
diff --git a/LayoutTests/http/conf/flatpak-httpd.conf b/LayoutTests/http/conf/flatpak-httpd.conf
index a74f56e..ab5c4db 100644
--- a/LayoutTests/http/conf/flatpak-httpd.conf
+++ b/LayoutTests/http/conf/flatpak-httpd.conf
@@ -108,7 +108,7 @@
AddType application/x-x509-ca-cert .crt
AddType application/x-pkcs7-crl .crl
-AddHandler cgi-script .cgi .pl
+AddHandler cgi-script .cgi .pl .py
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
diff --git a/LayoutTests/http/conf/win-httpd-2.4-php5.conf b/LayoutTests/http/conf/win-httpd-2.4-php5.conf
index 6596b1e..aa83b0e 100644
--- a/LayoutTests/http/conf/win-httpd-2.4-php5.conf
+++ b/LayoutTests/http/conf/win-httpd-2.4-php5.conf
@@ -117,7 +117,7 @@
AddEncoding x-compress .Z
AddEncoding x-gzip .gz .tgz
- AddHandler cgi-script .cgi .pl
+ AddHandler cgi-script .cgi .pl .py
AddType text/html .shtml
AddHandler server-parsed .shtml
diff --git a/LayoutTests/http/conf/win-httpd-2.4-php7.conf b/LayoutTests/http/conf/win-httpd-2.4-php7.conf
index 2b8196a..c42fa07 100644
--- a/LayoutTests/http/conf/win-httpd-2.4-php7.conf
+++ b/LayoutTests/http/conf/win-httpd-2.4-php7.conf
@@ -102,7 +102,7 @@
AddEncoding x-compress .Z
AddEncoding x-gzip .gz .tgz
- AddHandler cgi-script .cgi .pl
+ AddHandler cgi-script .cgi .pl .py
AddType text/html .shtml
AddHandler server-parsed .shtml
diff --git a/LayoutTests/media/track/opera/track/webvtt/parsing-cue-data/buildtests.py b/LayoutTests/media/track/opera/track/webvtt/parsing-cue-data/buildtests
old mode 100755
new mode 100644
similarity index 100%
rename from LayoutTests/media/track/opera/track/webvtt/parsing-cue-data/buildtests.py
rename to LayoutTests/media/track/opera/track/webvtt/parsing-cue-data/buildtests
diff --git a/LayoutTests/webgl/generate-webgl-tests.py b/LayoutTests/webgl/generate-webgl-tests
old mode 100644
new mode 100755
similarity index 99%
rename from LayoutTests/webgl/generate-webgl-tests.py
rename to LayoutTests/webgl/generate-webgl-tests
index 4271423..5a95f20
--- a/LayoutTests/webgl/generate-webgl-tests.py
+++ b/LayoutTests/webgl/generate-webgl-tests
@@ -1,3 +1,4 @@
+#!/usr/bin/env python3
# Copyright (C) 2013 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
diff --git a/Tools/ChangeLog b/Tools/ChangeLog
index b00a617..3dc8830 100644
--- a/Tools/ChangeLog
+++ b/Tools/ChangeLog
@@ -1,3 +1,16 @@
+2021-01-25 Jonathan Bedard <jbedard@apple.com>
+
+ [run-webkit-tests] Support python layout tests
+ https://bugs.webkit.org/show_bug.cgi?id=220749
+ <rdar://problem/73375271>
+
+ Reviewed by Alexey Proskuryakov.
+
+ * Scripts/webkitpy/layout_tests/controllers/layout_test_finder.py:
+ (LayoutTestFinder._real_tests): Exclude "tools" directories.
+ (LayoutTestFinder._is_test_file): Special case for web socket's *_wsh.py files.
+ (LayoutTestFinder._is_w3c_resource_file): Exclude w3c Python files.
+
2021-01-25 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, reverting r271805.
diff --git a/Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_finder.py b/Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_finder.py
index 7f9baf0..a4b27a9 100644
--- a/Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_finder.py
+++ b/Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_finder.py
@@ -40,7 +40,7 @@
# When collecting test cases, we include any file with these extensions.
-_supported_test_extensions = set(['.html', '.shtml', '.xml', '.xhtml', '.pl', '.htm', '.php', '.svg', '.mht', '.xht'])
+_supported_test_extensions = set(['.html', '.shtml', '.xml', '.xhtml', '.pl', '.py', '.htm', '.php', '.svg', '.mht', '.xht'])
# If any changes are made here be sure to update the isUsedInReftest method in old-run-webkit-tests as well.
@@ -107,7 +107,7 @@
def _real_tests(self, paths):
# When collecting test cases, skip these directories
- skipped_directories = set(['.svn', '_svn', 'resources', 'support', 'script-tests', 'reference', 'reftest'])
+ skipped_directories = set(['.svn', '_svn', 'resources', 'support', 'script-tests', 'tools', 'reference', 'reftest'])
files = find_files.find(self._port._filesystem, self._port.layout_tests_dir(), paths, skipped_directories, self._is_test_file, self._port.test_key)
return [self._port.relative_test_filename(f) for f in files]
@@ -118,6 +118,9 @@
return False
if self._is_w3c_resource_file(filesystem, dirname, filename):
return False
+ # Special case for websocket tooling
+ if filename.endswith('_wsh.py'):
+ return False
return True
def _is_w3c_resource_file(self, filesystem, dirname, filename):
@@ -131,6 +134,10 @@
json_data = filesystem.read_text_file(filepath)
self._w3c_resource_files = json.loads(json_data)
+ _, extension = filesystem.splitext(filename)
+ if extension == '.py':
+ return True
+
subpath = path[len(w3c_path) + 1:].replace('\\', '/')
if subpath in self._w3c_resource_files["files"]:
return True