Finish implementation of the scriptorium migration
This commit is contained in:
@@ -707,6 +707,63 @@ pipelines:
|
||||
}
|
||||
}
|
||||
|
||||
func TestRunConfigValidateIgnoresNonLLMStageScriptoriumProfiles(t *testing.T) {
|
||||
profilePath := writeScriptoriumProfileFile(t, "known", "http://profile.test/v1", "test-model")
|
||||
configPath := writeTestConfig(t, `version: 2
|
||||
scriptorium:
|
||||
profile_file: `+profilePath+`
|
||||
pipelines:
|
||||
example:
|
||||
input:
|
||||
module: fake/input
|
||||
llm_profile: missing-input
|
||||
output:
|
||||
module: json
|
||||
llm_profile: missing-output
|
||||
artifacts:
|
||||
events:
|
||||
extract: fake/extract
|
||||
merge:
|
||||
module: appendorder
|
||||
llm_profile: missing-merge
|
||||
`)
|
||||
var stdout bytes.Buffer
|
||||
var stderr bytes.Buffer
|
||||
|
||||
code := RunWithOptions([]string{"config", "validate", "--config", configPath, "--pipeline", "example"}, &stdout, &stderr, Options{
|
||||
Catalog: fakeCatalog(t),
|
||||
})
|
||||
|
||||
if code != 0 {
|
||||
t.Fatalf("RunWithOptions() code = %d, stderr=%q, want success", code, stderr.String())
|
||||
}
|
||||
if strings.Contains(stderr.String(), "missing-") {
|
||||
t.Fatalf("stderr = %q, want non-LLM stage profiles ignored", stderr.String())
|
||||
}
|
||||
}
|
||||
|
||||
func TestEffectiveLLMProfileIDsUsesLLMCapableStagesOnly(t *testing.T) {
|
||||
resolved := pipeline.ResolvedPipeline{
|
||||
Input: pipeline.ModuleBinding{LLMProfile: "input-profile"},
|
||||
Chunk: pipeline.ModuleBinding{LLMProfile: "chunk-profile"},
|
||||
Output: pipeline.ModuleBinding{LLMProfile: "output-profile"},
|
||||
ArtifactLanes: []pipeline.ResolvedArtifactLane{
|
||||
{
|
||||
Extract: pipeline.ModuleBinding{LLMProfile: "extract-profile"},
|
||||
Merge: pipeline.ModuleBinding{LLMProfile: "merge-profile"},
|
||||
Normalize: pipeline.ModuleBinding{LLMProfile: "normalize-profile"},
|
||||
Validators: []pipeline.ModuleBinding{{LLMProfile: "validator-profile"}},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
got := effectiveLLMProfileIDs(resolved)
|
||||
want := []string{"chunk-profile", "extract-profile", "normalize-profile"}
|
||||
if !reflect.DeepEqual(got, want) {
|
||||
t.Fatalf("effectiveLLMProfileIDs() = %#v, want %#v", got, want)
|
||||
}
|
||||
}
|
||||
|
||||
func TestRunPipelineSessionIDFlagRecordsExplicitTrimmedValue(t *testing.T) {
|
||||
configPath := writeTestConfig(t, mvpConfigYAML("dnd-session", "dnd/spells"))
|
||||
inputPath := writeSeriatimInput(t)
|
||||
|
||||
Reference in New Issue
Block a user