Unify effective config projection
This commit is contained in:
@@ -83,6 +83,42 @@ whisperx:
|
||||
}
|
||||
}
|
||||
|
||||
func TestEffectivePipelineValuesPreserveNilEmptyAndExactIntegers(t *testing.T) {
|
||||
base := &PipelineConfig{Audita: AuditaConfig{Modules: nil}}
|
||||
nilValues, err := EffectivePipelineValues(base)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
base.Audita.Modules = []string{}
|
||||
base.Scriptorium = &ScriptoriumConfig{Artifacts: map[string]ScriptoriumArtifactConfig{
|
||||
"recap": {Vars: map[string]any{"exact": int64(9007199254740993)}},
|
||||
}}
|
||||
emptyValues, err := EffectivePipelineValues(base)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if got := effectiveValueForTest(t, nilValues, "audita.modules"); got != "null" {
|
||||
t.Fatalf("nil sequence value = %q, want null", got)
|
||||
}
|
||||
if got := effectiveValueForTest(t, emptyValues, "audita.modules"); got != "[]" {
|
||||
t.Fatalf("empty sequence value = %q, want []", got)
|
||||
}
|
||||
if got := effectiveValueForTest(t, emptyValues, "scriptorium.artifacts.recap.vars.exact"); got != "9007199254740993" {
|
||||
t.Fatalf("exact integer value = %q", got)
|
||||
}
|
||||
}
|
||||
|
||||
func effectiveValueForTest(t *testing.T, values []EffectivePipelineValueRecord, path string) string {
|
||||
t.Helper()
|
||||
for _, value := range values {
|
||||
if value.Path == path {
|
||||
return value.Value
|
||||
}
|
||||
}
|
||||
t.Fatalf("effective value %q not found", path)
|
||||
return ""
|
||||
}
|
||||
|
||||
func TestValidateMissingAudioSource(t *testing.T) {
|
||||
cfg := loadedValidConfig(t)
|
||||
cfg.Session.Inputs.AudioDir = ""
|
||||
|
||||
Reference in New Issue
Block a user