fix: renforcer corrélation A/B et sorties stdout/fichier
Co-authored-by: aider (openrouter/openai/gpt-5.3-codex) <aider@aider.chat>
This commit is contained in:
@ -131,7 +131,7 @@ func TestValidate_AtLeastOneOutput(t *testing.T) {
|
||||
Outputs: OutputsConfig{
|
||||
File: FileOutputConfig{},
|
||||
ClickHouse: ClickHouseOutputConfig{Enabled: false},
|
||||
Stdout: false,
|
||||
Stdout: StdoutOutputConfig{Enabled: false},
|
||||
},
|
||||
}
|
||||
|
||||
@ -554,3 +554,37 @@ correlation:
|
||||
t.Errorf("expected log level DEBUG, got %s", cfg.Log.GetLevel())
|
||||
}
|
||||
}
|
||||
|
||||
func TestLoad_StdoutEnabledObject(t *testing.T) {
|
||||
content := `
|
||||
inputs:
|
||||
unix_sockets:
|
||||
- name: http
|
||||
path: /var/run/logcorrelator/http.socket
|
||||
- name: network
|
||||
path: /var/run/logcorrelator/network.socket
|
||||
|
||||
outputs:
|
||||
stdout:
|
||||
enabled: true
|
||||
|
||||
correlation:
|
||||
time_window_s: 1
|
||||
emit_orphans: true
|
||||
`
|
||||
|
||||
tmpDir := t.TempDir()
|
||||
configPath := filepath.Join(tmpDir, "config.yml")
|
||||
if err := os.WriteFile(configPath, []byte(content), 0644); err != nil {
|
||||
t.Fatalf("failed to write config: %v", err)
|
||||
}
|
||||
|
||||
cfg, err := Load(configPath)
|
||||
if err != nil {
|
||||
t.Fatalf("unexpected error: %v", err)
|
||||
}
|
||||
|
||||
if !cfg.Outputs.Stdout.Enabled {
|
||||
t.Error("expected outputs.stdout.enabled to be true")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user