Skip to content

Test infra: coverage in CI + savepoint isolation + Authorization gate#63

Merged
WebTigers merged 2 commits into
mainfrom
test/coverage-ci-and-w3tail
Jul 24, 2026
Merged

Test infra: coverage in CI + savepoint isolation + Authorization gate#63
WebTigers merged 2 commits into
mainfrom
test/coverage-ci-and-w3tail

Conversation

@WebTigers

Copy link
Copy Markdown
Owner

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 coverage job (pcov, full suite) publishes a line-% summary to each PR's job-summary panel and enforces a ratcheting MIN_COVERAGE floor (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-only Zend_Db_Adapter_Pdo_Mysql subclass that maps nested begin/commit/rollBack onto MySQL SAVEPOINTs. So a real /api service's own _transaction() (or a model save()) 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 real Access_Service_User::save nesting 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 from org_user every request (the session role is ignored); a revoked membership drops to the base role on the very next request; a locked session resolves to guest; 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

WebTigers and others added 2 commits July 24, 2026 14:33
…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>
@WebTigers
WebTigers merged commit 9388932 into main Jul 24, 2026
11 checks passed
@WebTigers
WebTigers deleted the test/coverage-ci-and-w3tail branch July 24, 2026 21:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant