fix(tests,spec): unstick the two red PHPUnit cells and gate-46 - #2443
Merged
Conversation
Two independent reds on `development`, neither of them a defect in shipped behaviour, both of them a test/spec artefact that CI is right to refuse. 1. PHPUnit (PHP 8.3 and 8.4, NC stable32) — ONE failing test out of 16306. a5b8dc2 ("a mapping you just created was invisible to every read") deliberately made MapNode::resolve() ask find() FIRST for a non-numeric reference, because find() is the only lookup that consults the uuid and slug columns. MapNodeTest::testANonNumericReferenceResolvesByRef still pinned the OLD order with `expects($this->never())->method('find')`, so the fix and its own suite disagreed: Expectation failed for method name is "find" when invoked 0 times. Method was expected to be called 0 times, actually called 1 time. The test's intent — a name living in the `reference` column alone still resolves — is unchanged and worth keeping. It now reaches findByRef() the way production does: through find() MISSING. That fall-through is the part that actually carries an exported flow, so making find() throw is a stronger test than making it unreachable. testAUuidReferenceResolvesThroughFind is added because nothing pinned the new order at all. Its `never()` on findByRef() is the assertion: a resolve() that went back to consulting the `reference` column first would satisfy every other test in the file. POSITIVE CONTROL. At the tree before this commit the suite is 8 tests, 1 failure — the exact CI message. With this commit, 9/9 green. Deleting the find()-first block from MapNode::resolve() again turns it into 1 failure + 1 error, on exactly these two tests, with the predicted text ("expected 1 time, actually 0" and RuntimeException "No mapping matches ..."). MapNode.php is restored byte-identical; it is NOT touched here. 2. Hydra Gates — [gate-46] spec-anchor-existence, 3 findings, 1 target. #2438 tagged three methods `@spec openspec/specs/federation/spec.md`. That file did not exist: federation's only written specs live in openspec/changes/federation-scope-enforcement and openspec/changes/federated-config-sharing, and a change directory is not a canonical target. The gate says "fix the TARGET, not each tag", so the canonical spec is written rather than the tags retargeted. Its content is read off the code it describes — CONFIDENTIALITY_KEYS, PUBLIC_CONFIDENTIALITY and applyShareVisibility() — and its scenarios are the seven data-provider cases that already exist in FederationControllerConfidentialityTest plus the object-scope bypass. Nothing is invented. The two requirements carry a reason-bearing `@e2e exclude` naming that test file. Without it this commit would have traded gate-46 for gate-19: measured, the spec's 7 new scenarios fail gate-19 as "missing @e2e" and pass with the excludes. POSITIVE CONTROL. check_spec_anchors.py against the two tagged files reports exactly the 3 CI findings when the spec is moved aside and 0 when it is present. check_e2e_coverage.py reports FAIL 7 without the exclusions and PASS with them. check_spec_coverage.py (gate-16) is 0 either way — nothing here is in its scope. NOT FIXED HERE, and deliberately so: phpmd's 6 findings are all in lib/Service/Flow (FlowRunAdvancer:83, FlowService:55/78/480, IterateNode:238, ObjectWriteNode:1445), which is another session's live work under #2429. phpcs's two errors were fixed by that session in 61c9f38/9c05a3f44 while this was in progress — verified here, full-tree phpcs is 0 errors on 1428 files at that base. Quality Report is a pure aggregator and carries no finding of its own.
Contributor
Quality Report — ConductionNL/openregister @
|
| Check | PHP | Vue | Security | License | Tests |
|---|---|---|---|---|---|
| lint | ✅ | ||||
| phpcs | ✅ | ||||
| phpmd | ✅ | ||||
| psalm | ✅ | ||||
| phpstan | ✅ | ||||
| phpmetrics | ✅ | ||||
| eslint | ✅ | ||||
| stylelint | ✅ | ||||
| build | ✅ | ||||
| check-specs | ✅ | ||||
| test-l10n | ✅ | ||||
| composer | ✅ | ✅ 173/173 | |||
| npm | ✅ | ✅ 546/546 | |||
| PHPUnit | ✅ | ||||
| Newman | ✅ | ||||
| Playwright | ✅ | ||||
| Hydra gates | ❌ |
Quality workflow — 2026-08-12 09:10 UTC
Download the full PDF report from the workflow artifacts.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this fixes
Two of the six non-green cells on
developmentat run31577691221.PHPUnit (PHP 8.3 / 8.4, NC stable32) — one failing test out of 16306
a5b8dc22bdeliberately madeMapNode::resolve()askfind()first for a non-numeric reference (it is the only lookup that consults theuuidandslugcolumns).MapNodeTest::testANonNumericReferenceResolvesByRefstill pinned the old order withexpects($this->never())->method('find'), so the fix and its own suite disagreed.The test keeps its intent — a name living in the
referencecolumn alone still resolves — but now reachesfindByRef()the way production does: throughfind()missing. A second test pins the new order, which nothing pinned at all.lib/Service/Flow/Nodes/MapNode.phpis not touched.Hydra Gates —
[gate-46] spec-anchor-existence#2438tagged three methods@spec openspec/specs/federation/spec.md; that file did not exist. The canonical spec is written (content read offCONFIDENTIALITY_KEYS/PUBLIC_CONFIDENTIALITY/applyShareVisibility(), scenarios matching the existingFederationControllerConfidentialityTestcases), rather than the tags retargeted at a change directory.Its two requirements carry a reason-bearing
@e2e exclude. Without that this PR would trade gate-46 for gate-19: the 7 new scenarios fail gate-19 asmissing @e2eand pass with the exclusions.Positive controls
MapNodeTestfind()-first inMapNode::resolve()check_spec_anchors.py(gate-46)check_e2e_coverage.py(gate-19)check_spec_coverage.py(gate-16)Not fixed here
lib/Service/Flow/(FlowRunAdvancer:83,FlowService:55/78/480,IterateNode:238,ObjectWriteNode:1445), another session's live work under development red since ee3448fea: phpmd (5 findings in lib/Service/Flow) — phpstan + PHPUnit already fixed in #2427 #2429.61c9f389c/9c05a3f44; full-tree phpcs is 0 errors on 1428 files at that base.