Repository navigation
Expand file tree
/
Copy pathphpunit.xml.dist
More file actions
71 lines (70 loc) 路 4.39 KB
/
Copy pathphpunit.xml.dist
File metadata and controls
71 lines (70 loc) 路 4.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
backupGlobals="false"
bootstrap="tests/bootstrap.php"
beStrictAboutTestsThatDoNotTestAnything="false"
cacheResultFile=".phpunit.cache/test-results"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.6/phpunit.xsd">
<testsuites>
<!--
Run with ./vendor/bin/counit, which puts the whole run inside one coroutine and gives every test its own,
so time/IO bound tests overlap instead of queueing up behind each other.
-->
<testsuite name="concurrent">
<directory suffix="Test.php">tests/unit</directory>
<exclude>tests/unit/Thread</exclude>
<exclude>tests/unit/Coroutine/FunctionTest.php</exclude>
<exclude>tests/unit/Coroutine/HttpFunctionTest.php</exclude>
<exclude>tests/unit/Database/MysqliReportModeTest.php</exclude>
<exclude>tests/unit/Database/PDOPoolTest.php</exclude>
<exclude>tests/unit/Database/RedisPoolTest.php</exclude>
<exclude>tests/unit/Process/ProcessManagerTest.php</exclude>
<exclude>tests/unit/RemoteObject/DefaultServerTest.php</exclude>
</testsuite>
<!--
Run with ./vendor/bin/phpunit. These tests cannot share a run with the ones above:
- Coroutine/FunctionTest calls Swoole\Runtime::setHookFlags() directly in its test bodies. That takes
effect process-wide and immediately, even from inside a running coroutine, so it turns on the STDIO
and file hooks counit excludes on purpose and then unhooks everything for whatever is in flight;
with it running concurrently, Barrier and Http2/MultiplexClient failed every time. It also calls
sleep()/usleep() unqualified from namespace Swoole\Coroutine, where counit installs shims of its
own, so under counit it would stop exercising Swoole's sleep hook altogether.
- Coroutine/HttpFunctionTest sets the process-wide http_client_driver option, which
Coroutine\Http\request() reads on every call. Concurrent tests overwrite each other's choice after
the first yield, so the driver-specific tests silently stop testing the driver they selected.
- Database/MysqliReportModeTest switches the process-wide mysqli report mode off for the length of a
test, because what it checks is only observable when mysqli returns false instead of throwing. Every
other mysqli test running meanwhile would stop getting the mysqli_sql_exception it relies on.
- Database/PDOPoolTest::testOracle blocks the scheduler: PDO_OCI is not coroutine-hooked, so its round
trips are blocking syscalls and no timer fires meanwhile. Measured at roughly 0.9s of timer lateness
for every other test in the run, which invalidates any wall-clock assertion in the concurrent suite.
- Database/RedisPoolTest sets a server-wide `requirepass` and creates ACL users on the shared Redis
server. That is invisible while tests run one at a time, but it breaks any test using Redis
concurrently: NameResolverTest's Redis cases fail whenever the two overlap.
- Process/ProcessManagerTest forks worker processes, and Swoole refuses to fork from inside a
coroutine ("must be forked outside the coroutine" from Swoole\Process\Pool::start()). Under counit
the run dies at exit 255 with no summary at all, because PHPUnit's output buffer swallows the fatal.
- RemoteObject/DefaultServerTest points the process-wide option default_remote_object_server_dir at a
directory of its own, to start a server there. A test that starts the default remote object server
meanwhile would start it in that directory, which goes away with the test.
-->
<testsuite name="serial">
<file>tests/unit/Coroutine/FunctionTest.php</file>
<file>tests/unit/Coroutine/HttpFunctionTest.php</file>
<file>tests/unit/Database/MysqliReportModeTest.php</file>
<file>tests/unit/Database/PDOPoolTest.php</file>
<file>tests/unit/Database/RedisPoolTest.php</file>
<file>tests/unit/Process/ProcessManagerTest.php</file>
<file>tests/unit/RemoteObject/DefaultServerTest.php</file>
</testsuite>
</testsuites>
<extensions>
<extension class="Deminy\Counit\CounitExtension"/>
</extensions>
<php>
<ini name="error_reporting" value="-1"/>
<ini name="display_errors" value="On"/>
<ini name="display_startup_errors" value="On"/>
</php>
</phpunit>