Complete documentation rebuild
This commit is contained in:
@@ -866,15 +866,59 @@ func TestValidateMissingAudioSource(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestExamplesLoadAndValidate(t *testing.T) {
|
||||
pipelinePath := filepath.Join("..", "..", "examples", "pipeline.minimal.yml")
|
||||
sessionPath := filepath.Join("..", "..", "examples", "session.minimal.yml")
|
||||
|
||||
cfg, err := Load(pipelinePath, sessionPath)
|
||||
if err != nil {
|
||||
t.Fatalf("Load(examples) error = %v", err)
|
||||
examplesDir := filepath.Join("..", "..", "docs", "examples")
|
||||
tests := []struct {
|
||||
name string
|
||||
pipelineFile string
|
||||
sessionFile string
|
||||
sessionOpts SessionLoadOptions
|
||||
}{
|
||||
{
|
||||
name: "minimal pipeline with local audio session",
|
||||
pipelineFile: "pipeline.minimal.yml",
|
||||
sessionFile: "session.local-audio.yml",
|
||||
},
|
||||
{
|
||||
name: "production pipeline with s3 audio session",
|
||||
pipelineFile: "pipeline.production.yml",
|
||||
sessionFile: "session.s3-audio.yml",
|
||||
},
|
||||
{
|
||||
name: "full annotated pipeline with local audio session",
|
||||
pipelineFile: "pipeline.full.annotated.yml",
|
||||
sessionFile: "session.local-audio.yml",
|
||||
},
|
||||
{
|
||||
name: "template session renders with session_id option",
|
||||
pipelineFile: "pipeline.minimal.yml",
|
||||
sessionFile: "session.template.yml",
|
||||
sessionOpts: SessionLoadOptions{
|
||||
SessionID: "2026-05-03",
|
||||
},
|
||||
},
|
||||
}
|
||||
if err := Validate(cfg); err != nil {
|
||||
t.Fatalf("Validate(examples) error = %v", err)
|
||||
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
pipelinePath := filepath.Join(examplesDir, tt.pipelineFile)
|
||||
sessionPath := filepath.Join(examplesDir, tt.sessionFile)
|
||||
|
||||
var (
|
||||
cfg *Config
|
||||
err error
|
||||
)
|
||||
if strings.TrimSpace(tt.sessionOpts.SessionID) == "" {
|
||||
cfg, err = Load(pipelinePath, sessionPath)
|
||||
} else {
|
||||
cfg, err = LoadWithSessionOptions(pipelinePath, sessionPath, tt.sessionOpts)
|
||||
}
|
||||
if err != nil {
|
||||
t.Fatalf("load example config error = %v", err)
|
||||
}
|
||||
if err := Validate(cfg); err != nil {
|
||||
t.Fatalf("validate example config error = %v", err)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user