test(log): expand handler, config, and metrics coverage

This commit is contained in:
zenfun
2025-12-21 16:18:38 +08:00
parent c2c65e774b
commit 6e6c669ea0
9 changed files with 112 additions and 11 deletions

View File

@@ -0,0 +1,14 @@
package config
import "testing"
func TestLoad_LogDSNOverride(t *testing.T) {
t.Setenv("EZ_LOG_PG_DSN", "host=log-db user=postgres dbname=logs")
cfg, err := Load()
if err != nil {
t.Fatalf("load config: %v", err)
}
if cfg.Log.DSN != "host=log-db user=postgres dbname=logs" {
t.Fatalf("expected log dsn to be set, got %q", cfg.Log.DSN)
}
}