fix(test): fix TestInitNoDbMode for no-db mode config persistence
Changes: - Save issue-prefix in config.yaml when using --no-db mode (previously only saved in database which doesn't exist in no-db mode) - Add config.ResetForTesting() to allow reloading config in tests - Simplify test to verify config values rather than execute subsequent commands (cobra's flag caching makes multi-Execute() testing complex) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
committed by
Steve Yegge
parent
81828db6ef
commit
fe67e9e232
@@ -153,6 +153,13 @@ func Initialize() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// ResetForTesting clears the config state, allowing Initialize() to be called again.
|
||||
// This is intended for tests that need to change config.yaml between test steps.
|
||||
// WARNING: Not thread-safe. Only call from single-threaded test contexts.
|
||||
func ResetForTesting() {
|
||||
v = nil
|
||||
}
|
||||
|
||||
// ConfigSource represents where a configuration value came from
|
||||
type ConfigSource string
|
||||
|
||||
|
||||
Reference in New Issue
Block a user