Repository navigation
Expand file tree
/
Copy pathphpunit.xml
More file actions
132 lines (126 loc) · 6.7 KB
/
Copy pathphpunit.xml
File metadata and controls
132 lines (126 loc) · 6.7 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
<?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="tests/bootstrap.php"
colors="true"
>
<testsuites>
<testsuite name="Unit">
<directory>tests/Unit</directory>
</testsuite>
<testsuite name="Feature">
<directory>tests/Feature</directory>
</testsuite>
<!--
First-party plugins ship their own tests, and until this entry
existed none of them ran in CI: `php artisan test` reads these
testsuites, and the marketplace's licence, payment and console
tests sat outside all of them. A test nobody runs is a comment.
The glob takes everything in plugins-dev, which on a developer
machine is not only Magna's own plugins: client products live
there too, several times larger than core and with their own
infrastructure. Keep running it — it is the whole-tree sweep, and
it is what `composer test` and a developer asking for "the suite"
should get.
-->
<testsuite name="Plugins">
<directory>plugins-dev/*/*/tests</directory>
</testsuite>
<!--
The plugins a CORE RELEASE answers for, named rather than globbed.
This is the release gate's scope, and the reason it is not the
glob above is specific: a 1.4.8 build was refused by 660 failures
that were all `lekha_test` on Postgres —
SQLSTATE[08006] connection to server at "127.0.0.1", port 5432 failed
SQLSTATE[3F000] Invalid schema name: schema "public" does not exist
— a different product whose database server was not running. That
is an unrelated dependency, not a quality signal.
The line drawn here: core ships alongside these, so breaking one
of them should stop a core release. It does not ship roya/erp,
lekha/core, embhas/embhas or magna/restaurant-finance; those are
separate products with their own repositories and their own
release gates, and two of them need database servers a core
release has no business requiring.
Named directories, not a `magna/*` glob, so adding a client
product under plugins-dev/magna cannot quietly start gating core
releases. magna/pages, magna/forms and magna/seo carry no tests
of their own yet — Pages is covered by tests/Feature/Plugins in
core — and are added here on the day they do.
-->
<testsuite name="FirstPartyPlugins">
<directory>plugins-dev/magna/blog/tests</directory>
<directory>plugins-dev/magna/defence/tests</directory>
<directory>plugins-dev/magna/docs/tests</directory>
<directory>plugins-dev/magna/marketplace/tests</directory>
<directory>plugins-dev/magna/message-lite/tests</directory>
<directory>plugins-dev/magna/plugin-manager/tests</directory>
</testsuite>
</testsuites>
<!--
Coverage measures the real codebase: app/ holds exactly two scaffold
files, while src/ carries the ~45k lines the suite actually tests.
Any coverage number produced from app/ alone was fiction. (Collecting
coverage stays opt-in — CI sets coverage: none — this only decides
what is measured when someone asks.)
-->
<source>
<include>
<directory>app</directory>
<directory>src</directory>
</include>
</source>
<php>
<!--
The whole suite runs in one process, so peak memory is the sum of
~4000 tests' worth of retained state, not any single test's. PHP's
own 512M default started killing the run mid-suite — always in
whichever test happened to make the next large allocation, which
reads as a random unrelated failure. Set here rather than in a
developer's php.ini so CI and every machine agree.
Raised 1G -> 2G when the suite passed 4000 tests: it began dying
the same way again, and the same way it misreads — the last fatal
pointed at PHPUnit's value exporter, which suggests a failing
assertion with a huge diff and is nothing of the sort. Each
testsuite passed cleanly on its own (Unit 92, Feature 1486,
Plugins 2503, no failures); only the combined single-process run
ran out of room. Grow this with the suite.
-->
<ini name="memory_limit" value="2G"/>
<env name="APP_ENV" value="testing"/>
<env name="APP_MAINTENANCE_DRIVER" value="file"/>
<env name="BCRYPT_ROUNDS" value="4"/>
<env name="ARGON_MEMORY" value="1024"/>
<env name="ARGON_THREADS" value="1"/>
<env name="ARGON_TIME" value="1"/>
<env name="BROADCAST_CONNECTION" value="null"/>
<env name="CACHE_STORE" value="array"/>
<!-- The settings snapshot lives in its own store (see
config/magna.php), which defaults to `file`. Left at that default
the suite would write real cache files and carry one test's
settings into the next; the array store keeps it per-test. -->
<env name="MAGNA_SETTINGS_CACHE_STORE" value="array"/>
<env name="DB_CONNECTION" value="sqlite"/>
<env name="DB_DATABASE" value=":memory:"/>
<env name="DB_URL" value=""/>
<env name="MAIL_MAILER" value="array"/>
<env name="MAGNA_INSTALLED" value="true"/>
<env name="QUEUE_CONNECTION" value="sync"/>
<env name="SESSION_DRIVER" value="array"/>
<env name="PULSE_ENABLED" value="false"/>
<env name="TELESCOPE_ENABLED" value="false"/>
<env name="NIGHTWATCH_ENABLED" value="false"/>
<!-- Marketplace credentials default to unset in tests; the .env may carry
local placeholders that would otherwise leak in. Tests that need them
set config() explicitly. -->
<env name="MARKETPLACE_TURNSTILE_SITE_KEY" value=""/>
<env name="MARKETPLACE_TURNSTILE_SECRET" value=""/>
<env name="MARKETPLACE_GOOGLE_CLIENT_ID" value=""/>
<env name="MARKETPLACE_GOOGLE_CLIENT_SECRET" value=""/>
<env name="MARKETPLACE_GITHUB_CLIENT_ID" value=""/>
<env name="MARKETPLACE_GITHUB_CLIENT_SECRET" value=""/>
<!-- Password strength is validated locally in tests; the
have-i-been-pwned lookup would make every password assertion a
live network call. -->
<env name="MAGNA_PASSWORD_CHECK_COMPROMISED" value="false"/>
</php>
</phpunit>