Skip to content

Commit f4621f2

Browse files
committed
Merge branch 'tests_psalm_phpstan_phpseclib'
2 parents 96b6c1e + 2db7e8b commit f4621f2

File tree

216 files changed

+11958
-19866
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

216 files changed

+11958
-19866
lines changed

.editorconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,7 @@ max_line_length = 80
3232

3333
[*.patch]
3434
trim_trailing_whitespace = false
35+
36+
[*.rst]
37+
indent_style = space
38+
max_line_length = 100

.github/actions/apt-x32/action.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ runs:
3838
libxml2-dev:i386 \
3939
libxpm-dev:i386 \
4040
libxslt1-dev:i386 \
41+
firebird-dev:i386 \
4142
locales \
4243
make \
4344
pkg-config:i386 \

.github/actions/configure-x32/action.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ runs:
2727
--with-pgsql \
2828
--with-pdo-pgsql \
2929
--with-pdo-sqlite \
30+
--with-pdo-firebird \
3031
--without-pear \
3132
--enable-gd \
3233
--with-jpeg \

.github/actions/test-linux/action.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ runs:
3030
export PDO_PGSQL_TEST_DSN="pgsql:host=localhost port=5432 dbname=test user=postgres password=postgres"
3131
fi
3232
export PDO_FIREBIRD_TEST_DATABASE=test.fdb
33-
export PDO_FIREBIRD_TEST_DSN=firebird:dbname=localhost:test.fdb
33+
if [[ -z "$PDO_FIREBIRD_TEST_DSN" ]]; then
34+
export PDO_FIREBIRD_TEST_DSN=firebird:dbname=localhost:test.fdb
35+
fi
3436
export PDO_FIREBIRD_TEST_PASS=test
3537
export PDO_FIREBIRD_TEST_USER=test
3638
export ODBC_TEST_USER="odbc_test"

.github/nightly.php

Lines changed: 109 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,114 @@ function (): iterable {
3737
if ($file->getExtension() == 'php' && ctype_upper($file->getBasename()[0])) {
3838
yield [
3939
getcwd()."/vendor/bin/phpunit",
40-
$file->getRealPath(),
40+
$file->getRealPath(),
41+
];
42+
}
43+
}
44+
},
45+
2
46+
];
47+
48+
$repos["phpseclib"] = [
49+
"https://github.com/phpseclib/phpseclib",
50+
"master",
51+
null,
52+
function (): iterable {
53+
$it = new RecursiveDirectoryIterator("tests");
54+
/** @var SplFileInfo $file */
55+
foreach(new RecursiveIteratorIterator($it) as $file) {
56+
if ($file->getExtension() == 'php' && ctype_upper($file->getBasename()[0])) {
57+
yield [
58+
getcwd()."/vendor/bin/phpunit",
59+
'-c',
60+
getcwd()."/tests/phpunit.xml",
61+
$file->getRealPath(),
62+
];
63+
}
64+
}
65+
},
66+
2
67+
];
68+
69+
$repos["phpunit"] = [
70+
"https://github.com/sebastianbergmann/phpunit.git",
71+
"main",
72+
null,
73+
["./phpunit"],
74+
2
75+
];
76+
77+
$repos["infection"] = [
78+
"https://github.com/infection/infection",
79+
"master",
80+
null,
81+
["vendor/bin/phpunit"],
82+
2
83+
];
84+
85+
$repos["wordpress"] = [
86+
"https://github.com/WordPress/wordpress-develop.git",
87+
"",
88+
function (): void {
89+
$f = file_get_contents('wp-tests-config-sample.php');
90+
$f = str_replace('youremptytestdbnamehere', 'test', $f);
91+
$f = str_replace('yourusernamehere', 'root', $f);
92+
$f = str_replace('yourpasswordhere', 'root', $f);
93+
file_put_contents('wp-tests-config.php', $f);
94+
},
95+
["vendor/bin/phpunit"],
96+
2
97+
];
98+
99+
foreach (['amp', 'cache', 'dns', 'file', 'http', 'parallel', 'parser', 'pipeline', 'process', 'serialization', 'socket', 'sync', 'websocket-client', 'websocket-server'] as $repo) {
100+
$repos["amphp-$repo"] = ["https://github.com/amphp/$repo.git", "", null, ["vendor/bin/phpunit"], 2];
101+
}
102+
103+
$repos["laravel"] = [
104+
"https://github.com/laravel/framework.git",
105+
"master",
106+
function (): void {
107+
$c = file_get_contents("tests/Filesystem/FilesystemTest.php");
108+
$c = str_replace("public function testSharedGet()", "#[\\PHPUnit\\Framework\\Attributes\\Group('skip')]\n public function testSharedGet()", $c);
109+
file_put_contents("tests/Filesystem/FilesystemTest.php", $c);
110+
},
111+
["vendor/bin/phpunit", "--exclude-group", "skip"],
112+
2
113+
];
114+
115+
foreach (['async', 'cache', 'child-process', 'datagram', 'dns', 'event-loop', 'promise', 'promise-stream', 'promise-timer', 'stream'] as $repo) {
116+
$repos["reactphp-$repo"] = ["https://github.com/reactphp/$repo.git", "", null, ["vendor/bin/phpunit"], 2];
117+
}
118+
119+
$repos["revolt"] = ["https://github.com/revoltphp/event-loop.git", "", null, ["vendor/bin/phpunit"], 2];
120+
121+
$repos["symfony"] = [
122+
"https://github.com/symfony/symfony.git",
123+
"",
124+
function (): void {
125+
e("php ./phpunit install");
126+
127+
// Test causes a heap-buffer-overflow but I cannot reproduce it locally...
128+
$c = file_get_contents("src/Symfony/Component/HtmlSanitizer/Tests/HtmlSanitizerCustomTest.php");
129+
$c = str_replace("public function testSanitizeDeepNestedString()", "/** @group skip */\n public function testSanitizeDeepNestedString()", $c);
130+
file_put_contents("src/Symfony/Component/HtmlSanitizer/Tests/HtmlSanitizerCustomTest.php", $c);
131+
// Buggy FFI test in Symfony, see https://github.com/symfony/symfony/issues/47668
132+
$c = file_get_contents("src/Symfony/Component/VarDumper/Tests/Caster/FFICasterTest.php");
133+
$c = str_replace("*/\n public function testCastNonTrailingCharPointer()", "* @group skip\n */\n public function testCastNonTrailingCharPointer()", $c);
134+
file_put_contents("src/Symfony/Component/VarDumper/Tests/Caster/FFICasterTest.php", $c);
135+
},
136+
function (): iterable {
137+
$it = new RecursiveDirectoryIterator("src/Symfony");
138+
/** @var SplFileInfo $file */
139+
foreach(new RecursiveIteratorIterator($it) as $file) {
140+
if ($file->getBasename() == 'phpunit.xml.dist') {
141+
yield [
142+
getcwd()."/phpunit",
143+
dirname($file->getRealPath()),
144+
"--exclude-group",
145+
"tty,benchmark,intl-data,transient",
146+
"--exclude-group",
147+
"skip"
41148
];
42149
}
43150
}
@@ -64,8 +171,8 @@ function (): iterable {
64171
unset($parentPids[$res]);
65172
if (pcntl_wifexited($status)) {
66173
$status = pcntl_wexitstatus($status);
174+
printMutex("Child task $desc exited with status $status");
67175
if ($status !== 0) {
68-
printMutex("Child task $desc exited with status $status");
69176
$finalStatus = $status;
70177
}
71178
} elseif (pcntl_wifstopped($status)) {

.github/scripts/windows/build_task.bat

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@ if %errorlevel% neq 0 exit /b 3
3030

3131
if "%THREAD_SAFE%" equ "0" set ADD_CONF=%ADD_CONF% --disable-zts
3232
if "%INTRINSICS%" neq "" set ADD_CONF=%ADD_CONF% --enable-native-intrinsics=%INTRINSICS%
33+
if "%ASAN%" equ "1" set ADD_CONF=%ADD_CONF% --enable-sanitizer --enable-debug-pack
3334

34-
set CFLAGS=/W1 /WX
35+
set CFLAGS=/W1 /WX /w14013
3536

3637
cmd /c configure.bat ^
3738
--enable-snapshot-build ^

.github/scripts/windows/test_task.bat

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,11 @@ for %%i in (ldap) do (
133133

134134
set TEST_PHPDBG_EXECUTABLE=%PHP_BUILD_DIR%\phpdbg.exe
135135

136+
if "%ASAN%" equ "1" set ASAN_OPTS=--asan
137+
136138
mkdir c:\tests_tmp
137139

138-
nmake test TESTS="%OPCACHE_OPTS% -g FAIL,BORK,LEAK,XLEAK --no-progress -q --offline --show-diff --show-slow 1000 --set-timeout 120 --temp-source c:\tests_tmp --temp-target c:\tests_tmp %PARALLEL%"
140+
nmake test TESTS="%OPCACHE_OPTS% -g FAIL,BORK,LEAK,XLEAK %ASAN_OPTS% --no-progress -q --offline --show-diff --show-slow 1000 --set-timeout 120 --temp-source c:\tests_tmp --temp-target c:\tests_tmp %PARALLEL%"
139141

140142
set EXIT_CODE=%errorlevel%
141143

.github/workflows/docs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ jobs:
1919
- name: git checkout
2020
uses: actions/checkout@v4
2121
- name: Install dependencies
22-
run: pip install sphinx-design sphinxawesome-theme rstfmt
22+
run: pip install -r docs/requirements.txt
2323
- name: Check formatting
24-
run: rstfmt --check -w 100 docs/source
24+
run: make -C docs check-formatting
2525
- name: Publish
2626
if: github.event_name == 'push'
2727
uses: sphinx-notes/pages@v3

.github/workflows/nightly.yml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,8 @@ jobs:
227227
runs-on: ubuntu-latest
228228
container:
229229
image: ubuntu:${{ inputs.ubuntu_version }}
230+
env:
231+
PDO_FIREBIRD_TEST_DSN: firebird:dbname=firebird:test.fdb
230232
services:
231233
mysql:
232234
image: mysql:8.3
@@ -235,6 +237,15 @@ jobs:
235237
env:
236238
MYSQL_DATABASE: test
237239
MYSQL_ROOT_PASSWORD: root
240+
firebird:
241+
image: jacobalberty/firebird
242+
ports:
243+
- 3050:3050
244+
env:
245+
ISC_PASSWORD: test
246+
FIREBIRD_DATABASE: test.fdb
247+
FIREBIRD_USER: test
248+
FIREBIRD_PASSWORD: test
238249
steps:
239250
- name: git checkout
240251
uses: actions/checkout@v4
@@ -866,10 +877,18 @@ jobs:
866877
- x64: true
867878
zts: true
868879
opcache: true
880+
asan: false
869881
- x64: false
870882
zts: false
871883
opcache: false
872-
name: "WINDOWS_${{ matrix.x64 && 'X64' || 'X86' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}"
884+
asan: false
885+
- x64: true
886+
zts: true
887+
opcache: true
888+
asan: true
889+
branch: 'master'
890+
timeout: 120
891+
name: "WINDOWS_${{ matrix.x64 && 'X64' || 'X86' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}${{ matrix.asan && '_ASAN' || ''}}"
873892
runs-on: windows-${{ inputs.windows_version }}
874893
env:
875894
PHP_BUILD_CACHE_BASE_DIR: C:\build-cache
@@ -882,6 +901,7 @@ jobs:
882901
INTRINSICS: "${{ matrix.zts && 'AVX2' || '' }}"
883902
PARALLEL: -j2
884903
OPCACHE: "${{ matrix.opcache && '1' || '0' }}"
904+
ASAN: "${{ matrix.asan && '1' || '0' }}"
885905
steps:
886906
- name: git config
887907
run: git config --global core.autocrlf false && git config --global core.eol lf

.github/workflows/push.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ jobs:
147147
MYSQL_TEST_HOST: mysql
148148
PDO_MYSQL_TEST_DSN: mysql:host=mysql;dbname=test
149149
PDO_MYSQL_TEST_HOST: mysql
150+
PDO_FIREBIRD_TEST_DSN: firebird:dbname=firebird:test.fdb
150151
services:
151152
mysql:
152153
image: mysql:8.3
@@ -155,6 +156,15 @@ jobs:
155156
env:
156157
MYSQL_DATABASE: test
157158
MYSQL_ROOT_PASSWORD: root
159+
firebird:
160+
image: jacobalberty/firebird
161+
ports:
162+
- 3050:3050
163+
env:
164+
ISC_PASSWORD: test
165+
FIREBIRD_DATABASE: test.fdb
166+
FIREBIRD_USER: test
167+
FIREBIRD_PASSWORD: test
158168
steps:
159169
- name: git checkout
160170
uses: actions/checkout@v4

0 commit comments

Comments
 (0)