Two compounding test bugs were causing CI failures in the Platform (Go) job:
1. workspace_crud_test.go: 9 Update tests still registered routes on a
separate r2 := gin.New() but called r.ServeHTTP() on the original
engine from setupWorkspaceCrudTest. This sent requests to r (which
had no PATCH route) → 404 instead of the expected validation error.
Fixed: use r consistently for both route registration and serving.
2. instructions_test.go: setupInstructionsTest() called setupTestDB()
(which sets global db.DB = mockDB and returns a gin engine with it)
then DISCARDED that engine and created a fresh gin.New(). Every test
then created ANOTHER fresh gin.New() for route registration. So the
route registration and r.ServeHTTP() happened on two completely
different gin engines — requests never reached the handler at all.
Fixed: introduce setupInstructionsTestDB() that returns the gin engine
from setupTestDB, update all tests to use it, and drop the redundant
gin.New() calls.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>