Remove retired reporting and diagnostic code

This commit is contained in:
2026-11-10 20:26:43 +00:00
parent a0e45c8f92
commit 9a52c8c246
21 changed files with 59 additions and 706 deletions

View File

@@ -93,6 +93,42 @@ func TestProcessUsesResolvedReportingMode(t *testing.T) {
}
}
func TestProcessChecksOnlyTheActiveReportDirectory(t *testing.T) {
for _, tc := range []struct {
name string
flags []string
wantReport bool
wantError bool
}{
{"file output ignores blank configured directory", nil, true, false},
{"explicit blank directory", []string{"--report-dir="}, false, true},
{"disabled reporting ignores explicit blank directory", []string{"--reporting=false", "--report-dir="}, false, false},
} {
t.Run(tc.name, func(t *testing.T) {
dir := t.TempDir()
configPath := filepath.Join(dir, "config.yml")
if err := os.WriteFile(configPath, []byte("version: 3\npipeline: {stages: []}\nreporting: {stdout_dir: ''}\n"), 0600); err != nil {
t.Fatal(err)
}
transcript := filepath.Join(dir, "transcript.json")
if err := os.WriteFile(transcript, []byte(`[{"speaker":"Alice","start":0,"end":1,"text":"hello"}]`), 0600); err != nil {
t.Fatal(err)
}
output := filepath.Join(dir, "output.json")
args := append([]string{"process", "--config", configPath, "--output", output}, tc.flags...)
var stdout, stderr bytes.Buffer
status := Run(context.Background(), append(args, transcript), &stdout, &stderr)
if (status != 0) != tc.wantError || (tc.wantError && !strings.Contains(stderr.String(), "report directory is required")) {
t.Fatalf("status=%d stdout=%q stderr=%q", status, stdout.String(), stderr.String())
}
_, err := os.Stat(filepath.Join(dir, "errors.yml"))
if (tc.wantReport && err != nil) || (!tc.wantReport && !os.IsNotExist(err)) {
t.Fatalf("report file: %v, want present=%t", err, tc.wantReport)
}
})
}
}
func TestProcessCollectionFlags(t *testing.T) {
dir := t.TempDir()
for name, contents := range map[string]string{