test(matrix): W5 resource-lifecycle block integration tests (move exempt→mapped)#255
Merged
mastermanas805 merged 1 commit intoJun 5, 2026
Conversation
…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>
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
Closes the ten W5 resource-lifecycle routes in
route_donebar_guard_test.go'srouteCoverageExemptions, moving them exempt →routeTestMap:GET /api/v1/resources/familiesTestResourceFamilies_ListGroupsCorrectlyGET /api/v1/resources/:id/familyTestResourceFamily_ThreeMembers_ReturnedInOrderPOST /api/v1/resources/:id/provision-twinTestResourceProvisionTwin_Pro_HappyPath_Returns201POST /api/v1/families/bulk-twinTestBulkTwin_HappyPath_ThreePostgresParentsPOST /api/v1/resources/:id/pauseTestResourcesLifecycleBlock_Member_PauseResumePOST /api/v1/resources/:id/resumeTestResourcesLifecycleBlock_Member_PauseResumePOST /api/v1/resources/:id/backupTestResourcesLifecycleBlock_Member_BackupAndListGET /api/v1/resources/:id/backupsTestResourcesLifecycleBlock_Member_BackupAndListPOST /api/v1/resources/:id/restoreTestResourcesLifecycleBlock_Member_RestoreAndListGET /api/v1/resources/:id/restoresTestResourcesLifecycleBlock_Member_RestoreAndListCoverage
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 productionRequireAuth+PopulateTeamRolestack thattesthelpers.NewTestApp/NewTestAppWithServicesrebuild from the same registrations asrouter.go.New suite
resources_lifecycle_block_integration_test.go(TestResourcesLifecycleBlock_*) adds the genuinely-missing axes:RequireRolegate (ownership is team-scoped), so adevelopermember must be able to drive pause/resume/backup/restore/family. This is the regression that REDs if an owner-gate is ever bolted on.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-customersbackend; those tests assert the auth+ownership+tier contract and skip the provisioned-row assertion when the backend is unreachable (deferred to theapi/e2elive-cluster specs).Verification
TestDoneBar_EveryRouteCovered,TestDoneBar_TestMapPointsAtRealTests).TestResourcesLifecycleBlock_*GREEN.make gategreen except the documented pre-existingTestLinkGitHubIDflake (verified identical on cleanorigin/masterwith these files stashed; CI authoritative, has the customer-DB/NATS backends this local sandbox lacks).origin/masterpost-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