fix: renforcer corrélation A/B et sorties stdout/fichier
Some checks failed
Build and Test / test (push) Has been cancelled
Build and Test / build (push) Has been cancelled
Build and Test / docker (push) Has been cancelled

Co-authored-by: aider (openrouter/openai/gpt-5.3-codex) <aider@aider.chat>
This commit is contained in:
Jacquin Antoine
2026-03-01 12:10:17 +01:00
parent d3436f6245
commit 27c7659397
13 changed files with 441 additions and 259 deletions

View File

@ -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")
}
}