Skip to content

test(matrix): W5 resource-lifecycle block integration tests (move exempt→mapped)#255

Merged
mastermanas805 merged 1 commit into
masterfrom
test/resources-lifecycle-integration-2026-06-05
Jun 5, 2026
Merged

test(matrix): W5 resource-lifecycle block integration tests (move exempt→mapped)#255
mastermanas805 merged 1 commit into
masterfrom
test/resources-lifecycle-integration-2026-06-05

Conversation

@mastermanas805

Copy link
Copy Markdown
Member

What

Closes the ten W5 resource-lifecycle routes in route_donebar_guard_test.go's routeCoverageExemptions, moving them exempt → routeTestMap:

Route Covering test
GET /api/v1/resources/families TestResourceFamilies_ListGroupsCorrectly
GET /api/v1/resources/:id/family TestResourceFamily_ThreeMembers_ReturnedInOrder
POST /api/v1/resources/:id/provision-twin TestResourceProvisionTwin_Pro_HappyPath_Returns201
POST /api/v1/families/bulk-twin TestBulkTwin_HappyPath_ThreePostgresParents
POST /api/v1/resources/:id/pause TestResourcesLifecycleBlock_Member_PauseResume
POST /api/v1/resources/:id/resume TestResourcesLifecycleBlock_Member_PauseResume
POST /api/v1/resources/:id/backup TestResourcesLifecycleBlock_Member_BackupAndList
GET /api/v1/resources/:id/backups TestResourcesLifecycleBlock_Member_BackupAndList
POST /api/v1/resources/:id/restore TestResourcesLifecycleBlock_Member_RestoreAndList
GET /api/v1/resources/:id/restores TestResourcesLifecycleBlock_Member_RestoreAndList

Coverage

Each route's happy path + tier-gate 402 + cross-team 404 + invalid-id 400 + bad-state 409 is already exercised by the per-handler DB-backed suites (resource_pause_test.go, backup_test.go, twin_test.go, family_bulk_twin_test.go, resource_family_test.go) — all driving the route through the production RequireAuth + PopulateTeamRole stack that testhelpers.NewTestApp / NewTestAppWithServices rebuild from the same registrations as router.go.

New suite resources_lifecycle_block_integration_test.go (TestResourcesLifecycleBlock_*) adds the genuinely-missing axes:

  • Non-owner team-member role axis — these routes carry NO RequireRole gate (ownership is team-scoped), so a developer member must be able to drive pause/resume/backup/restore/family. This is the regression that REDs if an owner-gate is ever bolted on.
  • Registry-iterating sweeps (rule 18) over lifecycleRoutes(): unauth → 401 and cross-team → 404 for every route. Adding an eleventh lifecycle route without auth + ownership handling REDs the sweep.

The twin / bulk-twin provisioning leg needs a live postgres-customers backend; those tests assert the auth+ownership+tier contract and skip the provisioned-row assertion when the backend is unreachable (deferred to the api/e2e live-cluster specs).

Verification

  • Both done-bar guards GREEN (TestDoneBar_EveryRouteCovered, TestDoneBar_TestMapPointsAtRealTests).
  • New TestResourcesLifecycleBlock_* GREEN.
  • make gate green except the documented pre-existing TestLinkGitHubID flake (verified identical on clean origin/master with these files stashed; CI authoritative, has the customer-DB/NATS backends this local sandbox lacks).
  • Rebased on origin/master post-test(matrix): W4 deploy-approval block integration suite (move exempt→mapped) #254 (deploy-approval) — disjoint route moves, both sets preserved.

No production-source changes (test-only file + guard-map move).

🤖 Generated with Claude Code

…mpt→mapped)

Close the ten W5 resource-lifecycle routes in route_donebar_guard_test.go's
routeCoverageExemptions, moving them exempt→routeTestMap:

  GET  /api/v1/resources/families
  GET  /api/v1/resources/:id/family
  POST /api/v1/resources/:id/provision-twin
  POST /api/v1/families/bulk-twin
  POST /api/v1/resources/:id/pause
  POST /api/v1/resources/:id/resume
  POST /api/v1/resources/:id/backup
  GET  /api/v1/resources/:id/backups
  POST /api/v1/resources/:id/restore
  GET  /api/v1/resources/:id/restores

Each route's happy path + tier-gate 402 + cross-team 404 + invalid-id 400 +
bad-state 409 is already exercised by the per-handler DB-backed suites
(resource_pause_test.go, backup_test.go, twin_test.go, family_bulk_twin_test.go,
resource_family_test.go), all of which drive the route through the production
RequireAuth + PopulateTeamRole stack that testhelpers.NewTestApp /
NewTestAppWithServices rebuild from the same registrations as router.go.

Adds the genuinely-missing axis in a new block suite
(resources_lifecycle_block_integration_test.go, TestResourcesLifecycleBlock_*):
the NON-OWNER team-member role axis (these routes carry no RequireRole gate, so
a 'developer' member must drive pause/resume/backup/restore/family — the
regression that REDs if an owner-gate is ever bolted on), plus two
registry-iterating sweeps (rule 18) over lifecycleRoutes() asserting unauth 401
and cross-team 404 for every route. The twin/bulk-twin provisioning leg needs a
live postgres-customers backend; those tests assert the auth+ownership+tier
contract and skip the provisioned-row leg when the backend is unreachable
(deferred to the api/e2e live-cluster specs).

Both done-bar guards stay green. No production-source changes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@mastermanas805 mastermanas805 enabled auto-merge (squash) June 5, 2026 00:19
@mastermanas805 mastermanas805 merged commit c7082ac into master Jun 5, 2026
18 checks passed
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