refactor(config): удалена опция opencode.config (OPENCODE_CONFIG)
This commit is contained in:
@@ -146,26 +146,6 @@ log:
|
||||
}
|
||||
}
|
||||
|
||||
func TestLoad_EnvOverride(t *testing.T) {
|
||||
t.Setenv("TG_TOKEN", "tok")
|
||||
t.Setenv("TG_CHAT_ID", "42")
|
||||
// env override для opencode.timeout
|
||||
t.Setenv("OPENCODE_CONFIG", "/custom/opencode.json")
|
||||
|
||||
yaml := `telegram:
|
||||
token: "${TG_TOKEN}"
|
||||
chat_id: "${TG_CHAT_ID}"
|
||||
`
|
||||
path := writeCfg(t, yaml)
|
||||
cfg, err := Load(path)
|
||||
if err != nil {
|
||||
t.Fatalf("Load: %v", err)
|
||||
}
|
||||
if cfg.OpenCode.Config != "/custom/opencode.json" {
|
||||
t.Errorf("opencode config = %q", cfg.OpenCode.Config)
|
||||
}
|
||||
}
|
||||
|
||||
func TestLoad_MissingEnvVarUsesDefault(t *testing.T) {
|
||||
t.Setenv("TG_TOKEN", "tok")
|
||||
t.Setenv("TG_CHAT_ID", "42")
|
||||
|
||||
@@ -88,7 +88,6 @@ type TelegramCfg struct {
|
||||
type OpenCodeCfg struct {
|
||||
Bin string `yaml:"bin" default:"opencode"`
|
||||
DBPath string `yaml:"db_path" default:""`
|
||||
Config string `yaml:"config" env:"OPENCODE_CONFIG"`
|
||||
HardTimeout Duration `yaml:"hard_timeout" default:"20m"`
|
||||
IdleTimeout Duration `yaml:"idle_timeout" default:"5m"`
|
||||
PollMs Duration `yaml:"poll_ms" default:"2s"`
|
||||
|
||||
Reference in New Issue
Block a user