Skip to content

Commit 0efc237

Browse files
authored
docs: name the 110 tests that cannot pass here, and who owns them (#12)
110 of the Module suite's failures are not defects in this package. They are tests referencing classes owned by other packages — and every one of those packages already requires dappcore/php: dappcore/php-tenant requires dappcore/php: * dappcore/agent requires dappcore/php: * So no dependency could make them pass here. They cannot be fixed inside this repository by any amount of work; they need to move to the repository that owns what they test. Naming them is the only useful thing this repo can do with them, which is what docs/misfiled-tests.md does — by owner, by file, with counts. php-tenant 82 failures, 13 files Core\Tenant\Models\User (78), Core\Tenant\Rules\ResourceStatusRule (4) agent 25 failures, 1 file and wrong twice: it names Core\Agentic\Services\AgentDetection, while the class lives at Core\Mod\Agentic\Services — a namespace the ecosystem has moved away from, in a package that cannot be depended on from here. Fixing the namespace alone would not make it pass. host.uk.com 3 failures, 1 file Website\Host\Mail\ContactFormSubmission lives in the application, not in any package. A framework package testing its consumer's mailable. Most of the php-tenant ones want a User only to authenticate a request, and the note says so: where that is all they need, a fixture user this package owns is cheaper than moving the file. Where the test genuinely exercises tenancy, it belongs in php-tenant. That distinction is theirs to make, not mine to guess. The module-debt job's comment now points at the document rather than repeating a summary that would drift from it. No code changed. No test moved or deleted — deleting them here would erase the findings their owners need. python3 yaml.safe_load .github/workflows/tests.yml valid vendor/bin/pint --test pass
1 parent 5551b59 commit 0efc237

2 files changed

Lines changed: 91 additions & 6 deletions

File tree

.github/workflows/tests.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,14 @@ jobs:
5959
# The Module suite — src/**/*Test.php — reported, never gating.
6060
#
6161
# It carries known failures, and the number is worth seeing rather than
62-
# hiding: 448 at the time of writing, and they are not 448 bugs. Roughly 114
63-
# are class-not-found for classes owned by sibling packages (Core\Tenant\Models,
64-
# Core\Agentic\Services) — tests that cannot pass in this repository at all;
65-
# about 30 are one real defect, StorageUrlResolver being handed a CdnUrlBuilder
66-
# where it wants a BunnyStorageService; the rest are ordinary assertion and
67-
# status-code failures.
62+
# hiding — but it is not one number. 110 of them are tests referencing classes
63+
# owned by dappcore/php-tenant, dappcore/agent, or the consuming application,
64+
# and since every one of those already requires dappcore/php, no dependency
65+
# could make them pass here. They are in the wrong repository rather than
66+
# broken. docs/misfiled-tests.md names them by owner and file.
67+
#
68+
# The rest are this package's own: assertion mismatches, status codes, and a
69+
# missing offload:migrate command registration.
6870
#
6971
# continue-on-error rather than `|| true`, and the difference matters: this
7072
# way the step's own result is visible in the run, so the count can be driven

docs/misfiled-tests.md

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# Tests in this repository that cannot pass in this repository
2+
3+
110 of the Module suite's failures are not defects in `dappcore/php`. They are
4+
tests that reference classes owned by other packages — classes this package
5+
cannot depend on, because **every one of those packages already depends on this
6+
one**.
7+
8+
```
9+
dappcore/php-tenant requires dappcore/php: *
10+
dappcore/agent requires dappcore/php: *
11+
dappcore/service requires dappcore/php: *
12+
```
13+
14+
Adding any of them to `composer.json` closes a loop. So these tests cannot be
15+
made to pass where they are, by any amount of work inside this repository. They
16+
need to move to the repository that owns what they test.
17+
18+
This document names them so their owners inherit findings rather than
19+
archaeology. It is deliberately not a fix list for this repo.
20+
21+
## By owner
22+
23+
### `dappcore/php-tenant` — 82 failures, 13 files
24+
25+
Referencing `Core\Tenant\Models\User` (78) and `Core\Tenant\Rules\ResourceStatusRule` (4).
26+
Both exist, in `php-tenant/Models/User.php` and `php-tenant/Rules/ResourceStatusRule.php`.
27+
28+
```
29+
src/Core/Config/Tests/Feature/ConfigServiceTest.php
30+
src/Core/Tests/Feature/DatabaseMigrationTest.php
31+
src/Core/Tests/Feature/ValidationRulesTest.php
32+
src/Core/Tests/Feature/PerformanceBaselineTest.php
33+
src/Core/Tests/Feature/SecurityHeadersTest.php
34+
src/Core/Tests/Feature/ErrorPagesTest.php
35+
src/Core/Tests/Feature/SecurityFixesTest.php
36+
src/Core/Tests/Feature/ImageOptimizerTest.php
37+
src/Core/Tests/Feature/AdminRouteSmokeTest.php
38+
src/Mod/Trees/Tests/Feature/SignupReferralTest.php
39+
src/Mod/Trees/Tests/Feature/SubscriberMonthlyCommandTest.php
40+
src/Mod/Trees/Tests/Feature/DailyLimitAndBonusTest.php
41+
src/Mod/Trees/Tests/Feature/TreePlantingTest.php
42+
```
43+
44+
Most of these want a `User` only to authenticate a request. Where that is all
45+
they need, the cheaper fix than moving the file is a test user this package
46+
owns — a fixture model, or Testbench's own — rather than the tenant package's.
47+
Where the test genuinely exercises tenancy, it belongs in `php-tenant`.
48+
49+
### `dappcore/agent` — 25 failures, 1 file
50+
51+
```
52+
src/Mod/Trees/Tests/Unit/AgentDetectionTest.php
53+
```
54+
55+
It references `Core\Agentic\Services\AgentDetection` and
56+
`Core\Agentic\Support\AgentIdentity`. **Both names are also stale**: the classes
57+
exist in `dappcore/agent` under `Core\Mod\Agentic\Services` and
58+
`Core\Mod\Agentic\Support`. So this file is wrong twice — a namespace the
59+
ecosystem has moved away from, in a package that cannot be depended on from here.
60+
Correcting the namespace alone would not make it pass.
61+
62+
### host.uk.com — 3 failures, 1 file
63+
64+
```
65+
src/Core/Tests/Feature/MailConfigurationTest.php
66+
```
67+
68+
References `Website\Host\Mail\ContactFormSubmission`, which lives in the
69+
**application**, not in any package: `app/Website/Host/Mail/ContactFormSubmission.php`
70+
in host.uk.com. A framework package testing its consumer's mailable. There is no
71+
dependency that could make this work; the test belongs in the application.
72+
73+
## Why this is worth writing down
74+
75+
The Module suite reports one number, and one number invites one explanation.
76+
These 110 have nothing wrong with them as tests — several look well written. They
77+
are in the wrong repository, which is a different problem with a different owner
78+
and a different fix, and it does not get solved by anyone driving a failure count
79+
down inside this package.
80+
81+
The remaining Module-suite failures are ordinary: assertion mismatches, status
82+
codes, a missing `offload:migrate` command registration. Those are this
83+
repository's own and are being worked separately.

0 commit comments

Comments
 (0)