H-263 restore PostgreSQL E2E coverage (#41)

Co-authored-by: Rogee <rogee@ipao.vip>
This commit is contained in:
Rogee
2026-08-18 00:55:45 +08:00
committed by GitHub
co-authored by rogee
parent 9555397b6b
commit a3b01e664e
12 changed files with 222 additions and 266 deletions
+5 -8
View File
@@ -24,16 +24,13 @@ import (
// Reference: Chatwoot's rack-cors configuration and middleware integration specs.
type MiddlewareE2ETestSuite struct {
suite.Suite
server *httptest.Server
router *gin.Engine
jwtCfg *config.JWTConfig
server *httptest.Server
router *gin.Engine
jwtCfg *config.JWTConfig
}
// SetupSuite builds a minimal Gin router with CORS + Auth middleware and a health endpoint.
func (s *MiddlewareE2ETestSuite) SetupSuite() {
// E2E tests require PostgreSQL; skip in SQLite test mode.
s.T().Skip("E2E tests require PostgreSQL; skipping in SQLite test mode")
s.jwtCfg = &config.JWTConfig{
Secret: "middleware-e2e-test-secret",
ExpiryHours: 1,
@@ -72,7 +69,7 @@ func (s *MiddlewareE2ETestSuite) SetupSuite() {
c.JSON(200, gin.H{
"user_id": userID,
"account_id": accountID,
"role": role,
"role": role,
})
})
}
@@ -544,4 +541,4 @@ func (s *MiddlewareE2ETestSuite) TestCORSAndAuth_DisallowedOriginBlocksEvenWithV
func TestMiddlewareE2ESuite(t *testing.T) {
suite.Run(t, new(MiddlewareE2ETestSuite))
}
}