Review normalize command architecture
All checks were successful
ci/woodpecker/tag/release Pipeline was successful
All checks were successful
ci/woodpecker/tag/release Pipeline was successful
This commit is contained in:
@@ -349,6 +349,31 @@ func TestNormalizeReportIncludesBareArrayShape(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestNormalizeReportDoesNotIncludeTranscriptText(t *testing.T) {
|
||||
dir := t.TempDir()
|
||||
const segmentText = "normalize-report-secret-text"
|
||||
input := writeJSONFile(t, dir, "input.json", `[{"start":1,"end":2,"speaker":"A","text":"`+segmentText+`"}]`)
|
||||
output := filepath.Join(dir, "normalized.json")
|
||||
reportPath := filepath.Join(dir, "report.json")
|
||||
|
||||
err := executeNormalize(
|
||||
"--input-file", input,
|
||||
"--output-file", output,
|
||||
"--report-file", reportPath,
|
||||
)
|
||||
if err != nil {
|
||||
t.Fatalf("normalize failed: %v", err)
|
||||
}
|
||||
|
||||
var rpt report.Report
|
||||
readJSON(t, reportPath, &rpt)
|
||||
for _, event := range rpt.Events {
|
||||
if strings.Contains(event.Message, segmentText) {
|
||||
t.Fatalf("report unexpectedly contained transcript text in event %#v", event)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestNormalizeReportEmptyInputEmitsWarning(t *testing.T) {
|
||||
dir := t.TempDir()
|
||||
input := writeJSONFile(t, dir, "input.json", `{"segments":[]}`)
|
||||
|
||||
@@ -10,7 +10,7 @@ import (
|
||||
func NewRootCommand() *cobra.Command {
|
||||
cmd := &cobra.Command{
|
||||
Use: "seriatim",
|
||||
Short: "Merge per-speaker transcripts into a chronological transcript",
|
||||
Short: "Merge, trim, and normalize transcript artifacts",
|
||||
Version: buildinfo.Version,
|
||||
SilenceErrors: true,
|
||||
SilenceUsage: true,
|
||||
|
||||
Reference in New Issue
Block a user