Test infra: coverage in CI + savepoint isolation + Authorization gate#63
Merged
Conversation
…Wave-3 tail) Three things, +15 integration tests (265 green): 1. Coverage in CI — a `coverage` job (pcov, full suite) publishes a line-% summary to each PR's job-summary panel and enforces a ratcheting MIN_COVERAGE floor (report- above, fail-below), separate from the gating jobs so pcov never slows them. Baseline ~20% lines; target 90% — the floor bumps up as the backfill climbs, never down. 2. SavepointAdapter (resolves COVERAGE-PLAN §9 finding #7) — a test-only adapter that maps nested begin/commit/rollBack onto MySQL SAVEPOINTs, so a service's own _transaction() composes inside the per-test outer transaction instead of throwing "already an active transaction", and the outer rollback still discards everything. Wired into IntegrationTestCase. SavepointIsolationTest (6) locks it — incl. a real Access_Service_User::save nesting with no commit-and-purge. Unblocks clean service happy-path testing for every future wave. 3. Tiger_Controller_Plugin_Authorization (9) — the unbypassable deny-by-default gate's brains: _resolveRole() reads the role LIVE from org_user (session role ignored; revoked membership drops to base next request; locked session -> guest; actor/org stamped) and _resourceFor() controller->resource mapping. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
getForLocale() returns an unordered key=>value map (no ORDER BY), so row order is DB-defined and varies across engines/runs — assertSame (order-sensitive on arrays) flaked in CI's combined unit+integration coverage run. Use assertEquals (same pairs, any order). Surfaced by the new coverage job running both suites in one process. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Wave-3 tail + the test infrastructure that unblocks the drive to 90% coverage. +15 integration tests (265 green).
1. Coverage summary in CI
A new
coveragejob (pcov, full suite) publishes a line-% summary to each PR's job-summary panel and enforces a ratchetingMIN_COVERAGEfloor (reports above it, fails below it) so coverage can never silently regress. It's separate from the gating unit/integration jobs so pcov never slows them.Baseline ≈20% lines (2,863 / 14,397). The tested spine is ~100%; the drag is untested feature modules (blog/seo/media/profile/analytics/backup/identity/schedule at 0%) + the marketplace/install cluster. Target: 90% — the floor bumps up as the backfill climbs.
2. Savepoint isolation (resolves COVERAGE-PLAN §9 finding #7)
tests/Support/SavepointAdapter.php— a test-onlyZend_Db_Adapter_Pdo_Mysqlsubclass that maps nestedbegin/commit/rollBackonto MySQL SAVEPOINTs. So a real/apiservice's own_transaction()(or a modelsave()) composes inside the per-test outer transaction instead of throwing "already an active transaction" — and the outer rollback still discards everything for isolation.This kills the escape-and-scrub workaround the Wave-3 agents needed.
SavepointIsolationTest(6) locks it: nested commit/rollback/3-deep, cross-test isolation despite an inner COMMIT, and a realAccess_Service_User::savenesting inside the base txn with no commit-and-purge. Every future service wave now tests happy-paths with clean rollback isolation.3. Tiger_Controller_Plugin_Authorization (the queued Wave-3 tail)
9 tests on the unbypassable deny-by-default gate's decision logic:
_resolveRole()— the live-role guarantee: the role is read FRESH fromorg_userevery request (the session role is ignored); a revoked membership drops to the base role on the very next request; a locked session resolves toguest; the model actor/org are stamped._resourceFor()— controller → ACL resource class mapping (default ns, module-prefixed, StudlyCase, empty→null).The full preDispatch→redirect/403 cycle (front controller + exiting redirector) stays a functional/smoke concern.
Next
Wave 4 = breadth over the zero-coverage core modules (now unblocked by the savepoint mode) — parallel agents, one module/cluster each. Then the kernel install/marketplace cluster, then satellite repos.
🤖 Generated with Claude Code