Migrate maintained D&D examples to native configuration
This commit is contained in:
@@ -388,14 +388,14 @@ func TestProductionSpellNormalizerRejectsInvalidCatalogReferencesBeforeExecution
|
||||
t.Fatal(err)
|
||||
}
|
||||
content := productionSpellCatalogContractConfig(t)
|
||||
catalogSource := repositoryPath("examples", "dnd-spell-catalog.json")
|
||||
catalogSource := repositoryPath("examples", "dnd-complete", "spell-catalog.json")
|
||||
content = strings.Replace(content, catalogSource, "__extract_catalog__", 1)
|
||||
content = replaceRequiredOnce(t, content, catalogSource, catalogPath)
|
||||
content = replaceRequiredOnce(t, content, "__extract_catalog__", catalogSource)
|
||||
configFile := writeProductionContractConfig(t, content)
|
||||
client := &productionFakeLLMClient{}
|
||||
var stdout, stderr strings.Builder
|
||||
code := RunWithOptions([]string{"run", "dnd-session", "--config", configFile, "--input-file", repositoryPath("examples", "seriatim-minimal-transcript.json"), "--cache", "bypass"}, &stdout, &stderr, productionRunOptions(t, client))
|
||||
code := RunWithOptions([]string{"run", "dnd-session", "--config", configFile, "--input-file", repositoryPath("examples", "dnd-minimal", "transcript.json"), "--cache", "bypass"}, &stdout, &stderr, productionRunOptions(t, client))
|
||||
for _, fragment := range []string{"normalize", `lane "spells"`, `reference slot "spell_catalog"`, "1048577 bytes", "limit 1048576"} {
|
||||
if code == 0 || !strings.Contains(stderr.String(), fragment) {
|
||||
t.Fatalf("status=%d stderr=%q, want %q", code, stderr.String(), fragment)
|
||||
@@ -565,7 +565,7 @@ func TestProductionSceneRunPublishesAnnotationFreeChunkPlan(t *testing.T) {
|
||||
path := writeProductionContractConfig(t, productionRunConfig(outputRoot, "dnd/scenes"))
|
||||
client := &productionFakeLLMClient{}
|
||||
var stdout, stderr strings.Builder
|
||||
code := RunWithOptions([]string{"run", "dnd-session", "--config", path, "--input-file", repositoryPath("examples", "seriatim-minimal-transcript.json"), "--cache", "bypass", "--llm-session-id", "offline-session", "--format", "json"}, &stdout, &stderr, productionRunOptions(t, client))
|
||||
code := RunWithOptions([]string{"run", "dnd-session", "--config", path, "--input-file", repositoryPath("examples", "dnd-minimal", "transcript.json"), "--cache", "bypass", "--llm-session-id", "offline-session", "--format", "json"}, &stdout, &stderr, productionRunOptions(t, client))
|
||||
if code != 0 {
|
||||
t.Fatalf("status=%d stdout=%q stderr=%q", code, stdout.String(), stderr.String())
|
||||
}
|
||||
@@ -615,8 +615,8 @@ type maintainedExample struct {
|
||||
func maintainedExampleFiles(t *testing.T) []maintainedExample {
|
||||
t.Helper()
|
||||
return []maintainedExample{
|
||||
{name: "minimal", path: repositoryPath("examples", "dnd-minimal.config.yml"), transcriptPath: repositoryPath("examples", "seriatim-minimal-transcript.json"), pipelineIDs: []string{"dnd-session"}},
|
||||
{name: "complete", path: repositoryPath("examples", "dnd-complete.config.yml"), transcriptPath: repositoryPath("examples", "dnd-complete-transcript.json"), pipelineIDs: []string{"dnd-session", "dnd-session-development"}},
|
||||
{name: "minimal", path: repositoryPath("examples", "dnd-minimal", "config.yml"), transcriptPath: repositoryPath("examples", "dnd-minimal", "transcript.json"), pipelineIDs: []string{"dnd-session"}},
|
||||
{name: "complete", path: repositoryPath("examples", "dnd-complete", "config.yml"), transcriptPath: repositoryPath("examples", "dnd-complete", "transcript.json"), pipelineIDs: []string{"dnd-session", "dnd-session-development"}},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -644,7 +644,7 @@ pipelines:
|
||||
references:
|
||||
spell_catalog:
|
||||
path: %q
|
||||
`, repositoryPath("examples", "dnd-party.txt"), repositoryPath("examples", "dnd-glossary.txt"), repositoryPath("examples", "dnd-spell-catalog.json"), repositoryPath("examples", "dnd-spell-catalog.json"))
|
||||
`, repositoryPath("examples", "dnd-complete", "party.txt"), repositoryPath("examples", "dnd-complete", "glossary.txt"), repositoryPath("examples", "dnd-complete", "spell-catalog.json"), repositoryPath("examples", "dnd-complete", "spell-catalog.json"))
|
||||
}
|
||||
|
||||
func writeProductionSpellCatalogContractConfig(t *testing.T) string {
|
||||
|
||||
Reference in New Issue
Block a user