-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathphpunit.xml
More file actions
141 lines (141 loc) · 7.83 KB
/
Copy pathphpunit.xml
File metadata and controls
141 lines (141 loc) · 7.83 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
bootstrap="vendor/autoload.php"
colors="true"
cacheDirectory=".phpunit.cache"
failOnRisky="true"
failOnWarning="true"
failOnDeprecation="true"
failOnNotice="true"
displayDetailsOnTestsThatTriggerDeprecations="true"
displayDetailsOnTestsThatTriggerWarnings="true"
displayDetailsOnTestsThatTriggerNotices="true"
displayDetailsOnTestsThatTriggerErrors="true"
displayDetailsOnPhpunitDeprecations="true"
>
<!--
The Pest suites of gate 5 in GUARDRAILS 10, and Browser for gate 8.
Unit no services: the monorepo's tooling, manifest and provider tests, and every
package test outside the directories below
Codecs PHP codec output against the browser's validator
Contract the same suite against the fake and the real adapter of each contract
Postgres real Postgres and Valkey from compose.yaml; run `composer services:up` first
Arch the architecture rules
Actions each action called directly with its DTOs and the fakes of its ports (GUARDRAILS 9)
Browser Chromium through the Pest browser plugin and Playwright, against the workbench
application served in-process on real Postgres and Valkey, as the Postgres
suite; run `composer services:up` and `composer panel:build` first, and the
suite through `composer image:run` in the dev image
Mutation the tests that need a coverage driver: mutation on changed files for real, on a
scratch repository. PCOV is in the php container and the CI image, not on the
host; the PR profile runs it in gate 5
A package puts its tests for a suite in packages/<package>/tests/<Suite>. The workbench's
fixture addons test themselves in workbench/addons/<addon>/tests, with their own Testbench
test case, in the Unit suite. The running examples
of the documentation pages (gate 10, composer docs:check) live in examples/<Suite>/<Topic>.
-->
<testsuites>
<testsuite name="Unit">
<directory suffix="Test.php">tests/Feature</directory>
<directory suffix="Test.php">examples/Unit</directory>
<directory suffix="Test.php">packages/*/tests</directory>
<directory suffix="Test.php">workbench/addons/*/tests</directory>
<exclude>packages/*/tests/Codecs</exclude>
<exclude>packages/*/tests/Contract</exclude>
<exclude>packages/*/tests/Postgres</exclude>
<exclude>packages/*/tests/Actions</exclude>
</testsuite>
<testsuite name="Codecs">
<directory suffix="Test.php">tests/Codecs</directory>
<directory suffix="Test.php">examples/Codecs</directory>
<directory suffix="Test.php">packages/*/tests/Codecs</directory>
</testsuite>
<testsuite name="Contract">
<directory suffix="Test.php">tests/Contract</directory>
<directory suffix="Test.php">examples/Contract</directory>
<directory suffix="Test.php">packages/*/tests/Contract</directory>
</testsuite>
<testsuite name="Postgres">
<directory suffix="Test.php">tests/Postgres</directory>
<directory suffix="Test.php">examples/Postgres</directory>
<directory suffix="Test.php">packages/*/tests/Postgres</directory>
</testsuite>
<testsuite name="Arch">
<directory suffix="Test.php">tests/Arch</directory>
</testsuite>
<testsuite name="Actions">
<directory suffix="Test.php">tests/Actions</directory>
<directory suffix="Test.php">packages/*/tests/Actions</directory>
</testsuite>
<testsuite name="Browser">
<directory suffix="Test.php">tests/Browser</directory>
</testsuite>
<testsuite name="Mutation">
<directory suffix="Test.php">tests/Mutation</directory>
</testsuite>
</testsuites>
<source>
<include>
<directory>packages/*/src</directory>
<directory>workbench/app</directory>
</include>
</source>
<php>
<!--
The Unit suite runs PHPStan's rule tests in-process and needs more than the 256M of
the PHP images' default, and the Arch suite keeps every class it has parsed, the
vendor's included, for the whole run, which passed 512M as the packages grew; its
expectations over every namespace of the package, the tests included, grow with the
code base, and at 512M Pest's test run history then failed the run (M1-T54); this
makes the suites run the same on the host, in the php container and in CI. The
fast suites' run of mutation on changed files collects coverage with PCOV in each
parallel worker as well, and at 1G a worker that ran the Arch suite and then more
files ran out of memory in Pest's test run history (M1-T66).
-->
<ini name="memory_limit" value="2G"/>
<env name="APP_ENV" value="testing"/>
<!-- A fixed key for the test application only; the web middleware encrypts cookies. -->
<env name="APP_KEY" value="base64:mAfSx1dFf0ps0RjZgJUdiGI87gLFyYzz5H7IqMVPD0M="/>
<!--
The services from compose.yaml on their host ports. Inside the php container and in
the dev image runs of composer check (DevImageRun), DB_HOST, DB_PORT, REDIS_HOST and
REDIS_PORT are set to the service names and container ports, and PHPUnit keeps a
variable that is already set.
Tests run as the app role (GUARDRAILS 6); pgsql_owner is the owner role, and
pgsql_identity the identity role of the credential store (PRD 5.16), the
CMS_IDENTITY_ROLE of compose.yaml, compose.ci.yaml and ci.yml.
DB_DATABASE is the configured database the harness connects to as the owner role; the
tests run in this checkout's own database, cms_test_<hash of the checkout's path>,
which the harness creates there (packages/testkit, TestDatabase).
-->
<env name="DB_CONNECTION" value="pgsql"/>
<env name="DB_HOST" value="127.0.0.1"/>
<env name="DB_PORT" value="54317"/>
<env name="DB_DATABASE" value="cms_test"/>
<env name="DB_SCHEMA" value="cms"/>
<env name="DB_USERNAME" value="cms_app"/>
<env name="DB_PASSWORD" value="cms_app"/>
<env name="DB_OWNER_USERNAME" value="cms_owner"/>
<env name="DB_OWNER_PASSWORD" value="cms_owner"/>
<env name="DB_IDENTITY_USERNAME" value="cms_identity"/>
<env name="DB_IDENTITY_PASSWORD" value="cms_identity"/>
<!--
The tests run in the workbench's console, which holds pgsql_owner and runs the
migrations, so it is the maintenance process for cms:doctor's
postgres.owner_credentials. The declaration is the process's environment, never the
configuration (docs/developers/doctor.md).
-->
<env name="CBOX_CMS_MAINTENANCE_PROCESS" value="true"/>
<!--
The superuser of compose.yaml, compose.ci.yaml and ci.yml. Only Postgres tests that make
scratch roles use it (packages/core/tests/Postgres/DoctorRoleMembershipTest.php); the
application never connects as it.
-->
<env name="DB_SUPERUSER_USERNAME" value="postgres"/>
<env name="DB_SUPERUSER_PASSWORD" value="postgres"/>
<env name="REDIS_CLIENT" value="phpredis"/>
<env name="REDIS_HOST" value="127.0.0.1"/>
<env name="REDIS_PORT" value="63797"/>
</php>
</phpunit>