Commit 7d836d5
Add tests for config.validateOpenTelemetryConfig and related validation functions
Cover all 9+ branches of validateOpenTelemetryConfig including:
- nil config fast-return
- enforceHTTPS=true: endpoint required and must use HTTPS
- enforceHTTPS=false: endpoint checks bypassed
- W3C traceId: valid 32-char hex, too short/long, uppercase, non-hex, all-zero rejection
- W3C spanId: valid 16-char hex, too short/long, uppercase, all-zero rejection
- spanId without traceId: warning path (no error)
- Fully valid config with all fields
Also add direct tests for previously uncovered functions:
- validateTrustedBots: nil/empty/valid/whitespace/indexed-error cases
- validateCustomSchemas: nil/empty/https-valid/reserved-names/non-https rejection
- validateGuardPolicies: nil/empty/nil-policy-skip/valid/invalid-with-guard-name
- TestValidateGatewayConfig_OpenTelemetry: OTel integration via validateGatewayConfig
- TestValidateGatewayConfig_TrustedBots: trustedBots integration via validateGatewayConfig
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 18b19a6 commit 7d836d5
1 file changed
Lines changed: 685 additions & 0 deletions
0 commit comments