Clean up pipeline test naming

This commit is contained in:
2026-07-03 15:51:24 +00:00
parent d7881d7936
commit 25fbd791c8
2 changed files with 44 additions and 44 deletions

View File

@@ -129,8 +129,8 @@ func TestRunManifestIncludesPipelineAndArtifactLaneFields(t *testing.T) {
PipelineDigest: "sha256:abc123", PipelineDigest: "sha256:abc123",
ArtifactLanes: []ArtifactLaneManifest{ ArtifactLanes: []ArtifactLaneManifest{
{ {
ID: "spells", ID: "events",
Extractor: "spell-extractor", Extractor: "event-extractor",
Merger: "appendorder", Merger: "appendorder",
Normalizer: "noop", Normalizer: "noop",
Validators: []string{"grounded"}, Validators: []string{"grounded"},

View File

@@ -15,7 +15,7 @@ func TestResolvePipelineWithExplicitModules(t *testing.T) {
catalog := newProfileCatalog(t) catalog := newProfileCatalog(t)
registerProfileSpecs(t, catalog, registerProfileSpecs(t, catalog,
ModuleSpec{Key: "window", Stage: StageChunk, Requires: []string{"source"}, Provides: []string{"chunk"}}, ModuleSpec{Key: "window", Stage: StageChunk, Requires: []string{"source"}, Provides: []string{"chunk"}},
ModuleSpec{Key: "npc-extractor", Stage: StageExtract, Requires: []string{"chunk"}, Provides: []string{"candidate"}}, ModuleSpec{Key: "record-extractor", Stage: StageExtract, Requires: []string{"chunk"}, Provides: []string{"candidate"}},
ModuleSpec{Key: "dedupe", Stage: StageMerge, Requires: []string{"candidate"}, Provides: []string{"merged"}}, ModuleSpec{Key: "dedupe", Stage: StageMerge, Requires: []string{"candidate"}, Provides: []string{"merged"}},
ModuleSpec{Key: "canonical", Stage: StageNormalize, Requires: []string{"merged"}, Provides: []string{"normalized"}}, ModuleSpec{Key: "canonical", Stage: StageNormalize, Requires: []string{"merged"}, Provides: []string{"normalized"}},
ModuleSpec{Key: "schema-check", Stage: StageValidate, Requires: []string{"normalized"}, Provides: []string{"validated"}}, ModuleSpec{Key: "schema-check", Stage: StageValidate, Requires: []string{"normalized"}, Provides: []string{"validated"}},
@@ -29,8 +29,8 @@ func TestResolvePipelineWithExplicitModules(t *testing.T) {
"size": 10, "size": 10,
}}, }},
Artifacts: map[string]ArtifactLaneProfile{ Artifacts: map[string]ArtifactLaneProfile{
" npcs ": { " records ": {
Extract: ModuleBinding{Module: " npc-extractor ", LLMProfile: " careful "}, Extract: ModuleBinding{Module: " record-extractor ", LLMProfile: " careful "},
Merge: Binding(" dedupe "), Merge: Binding(" dedupe "),
Normalize: Binding(" canonical "), Normalize: Binding(" canonical "),
Validators: []ModuleBinding{Binding(" schema-check ")}, Validators: []ModuleBinding{Binding(" schema-check ")},
@@ -58,10 +58,10 @@ func TestResolvePipelineWithExplicitModules(t *testing.T) {
t.Fatalf("len(ArtifactLanes) = %d, want 1", len(resolved.ArtifactLanes)) t.Fatalf("len(ArtifactLanes) = %d, want 1", len(resolved.ArtifactLanes))
} }
lane := resolved.ArtifactLanes[0] lane := resolved.ArtifactLanes[0]
if lane.ID != "npcs" { if lane.ID != "records" {
t.Fatalf("lane.ID = %q, want npcs", lane.ID) t.Fatalf("lane.ID = %q, want records", lane.ID)
} }
if !reflect.DeepEqual(lane.Extract, ModuleBinding{Module: "npc-extractor", LLMProfile: "careful"}) { if !reflect.DeepEqual(lane.Extract, ModuleBinding{Module: "record-extractor", LLMProfile: "careful"}) {
t.Fatalf("lane.Extract = %#v, want explicit extractor", lane.Extract) t.Fatalf("lane.Extract = %#v, want explicit extractor", lane.Extract)
} }
if lane.Merge.Module != "dedupe" || lane.Normalize.Module != "canonical" { if lane.Merge.Module != "dedupe" || lane.Normalize.Module != "canonical" {
@@ -83,7 +83,7 @@ func TestResolvePipelineAppliesDefaults(t *testing.T) {
ID: "defaulted", ID: "defaulted",
Input: Binding("text"), Input: Binding("text"),
Artifacts: map[string]ArtifactLaneProfile{ Artifacts: map[string]ArtifactLaneProfile{
"spells": {Extract: Binding("spell-extractor")}, "events": {Extract: Binding("event-extractor")},
}, },
}, ResolveOptions{}, newProfileCatalog(t)) }, ResolveOptions{}, newProfileCatalog(t))
if err != nil { if err != nil {
@@ -113,13 +113,13 @@ func TestResolvePipelineAppliesDefaults(t *testing.T) {
func TestResolvePipelineSelectsOnlyRequestedLanes(t *testing.T) { func TestResolvePipelineSelectsOnlyRequestedLanes(t *testing.T) {
profile := multiLaneProfile() profile := multiLaneProfile()
resolved, err := ResolvePipeline(profile, ResolveOptions{Only: []string{" treasure ", "spells", "treasure"}}, newProfileCatalog(t)) resolved, err := ResolvePipeline(profile, ResolveOptions{Only: []string{" summaries ", "events", "summaries"}}, newProfileCatalog(t))
if err != nil { if err != nil {
t.Fatalf("ResolvePipeline() error = %v, want nil", err) t.Fatalf("ResolvePipeline() error = %v, want nil", err)
} }
got := laneIDs(resolved.ArtifactLanes) got := laneIDs(resolved.ArtifactLanes)
want := []string{"spells", "treasure"} want := []string{"events", "summaries"}
if !reflect.DeepEqual(got, want) { if !reflect.DeepEqual(got, want) {
t.Fatalf("lane IDs = %#v, want %#v", got, want) t.Fatalf("lane IDs = %#v, want %#v", got, want)
} }
@@ -158,7 +158,7 @@ func TestResolvePipelineRejectsEmptyPipelineID(t *testing.T) {
ID: " ", ID: " ",
Input: Binding("text"), Input: Binding("text"),
Artifacts: map[string]ArtifactLaneProfile{ Artifacts: map[string]ArtifactLaneProfile{
"spells": {Extract: Binding("spell-extractor")}, "events": {Extract: Binding("event-extractor")},
}, },
}, ResolveOptions{}, newProfileCatalog(t)) }, ResolveOptions{}, newProfileCatalog(t))
if err == nil { if err == nil {
@@ -171,7 +171,7 @@ func TestResolvePipelineRejectsMissingInput(t *testing.T) {
_, err := ResolvePipeline(PipelineProfile{ _, err := ResolvePipeline(PipelineProfile{
ID: "missing-input", ID: "missing-input",
Artifacts: map[string]ArtifactLaneProfile{ Artifacts: map[string]ArtifactLaneProfile{
"spells": {Extract: Binding("spell-extractor")}, "events": {Extract: Binding("event-extractor")},
}, },
}, ResolveOptions{}, newProfileCatalog(t)) }, ResolveOptions{}, newProfileCatalog(t))
if err == nil { if err == nil {
@@ -192,7 +192,7 @@ func TestResolvePipelineRejectsUnknownModuleKeys(t *testing.T) {
ID: "unknown-input", ID: "unknown-input",
Input: Binding("missing-input"), Input: Binding("missing-input"),
Artifacts: map[string]ArtifactLaneProfile{ Artifacts: map[string]ArtifactLaneProfile{
"spells": {Extract: Binding("spell-extractor")}, "events": {Extract: Binding("event-extractor")},
}, },
}, },
want: []string{"unknown-input", "input", "missing-input"}, want: []string{"unknown-input", "input", "missing-input"},
@@ -208,42 +208,42 @@ func TestResolvePipelineRejectsUnknownModuleKeys(t *testing.T) {
{ {
name: "extract", name: "extract",
profile: withProfileChange(func(profile PipelineProfile) PipelineProfile { profile: withProfileChange(func(profile PipelineProfile) PipelineProfile {
lane := profile.Artifacts["spells"] lane := profile.Artifacts["events"]
lane.Extract = Binding("missing-extractor") lane.Extract = Binding("missing-extractor")
profile.Artifacts["spells"] = lane profile.Artifacts["events"] = lane
return profile return profile
}), }),
want: []string{"baseline", "spells", "extract", "missing-extractor"}, want: []string{"baseline", "events", "extract", "missing-extractor"},
}, },
{ {
name: "merge", name: "merge",
profile: withProfileChange(func(profile PipelineProfile) PipelineProfile { profile: withProfileChange(func(profile PipelineProfile) PipelineProfile {
lane := profile.Artifacts["spells"] lane := profile.Artifacts["events"]
lane.Merge = Binding("missing-merge") lane.Merge = Binding("missing-merge")
profile.Artifacts["spells"] = lane profile.Artifacts["events"] = lane
return profile return profile
}), }),
want: []string{"baseline", "spells", "merge", "missing-merge"}, want: []string{"baseline", "events", "merge", "missing-merge"},
}, },
{ {
name: "normalize", name: "normalize",
profile: withProfileChange(func(profile PipelineProfile) PipelineProfile { profile: withProfileChange(func(profile PipelineProfile) PipelineProfile {
lane := profile.Artifacts["spells"] lane := profile.Artifacts["events"]
lane.Normalize = Binding("missing-normalize") lane.Normalize = Binding("missing-normalize")
profile.Artifacts["spells"] = lane profile.Artifacts["events"] = lane
return profile return profile
}), }),
want: []string{"baseline", "spells", "normalize", "missing-normalize"}, want: []string{"baseline", "events", "normalize", "missing-normalize"},
}, },
{ {
name: "validate", name: "validate",
profile: withProfileChange(func(profile PipelineProfile) PipelineProfile { profile: withProfileChange(func(profile PipelineProfile) PipelineProfile {
lane := profile.Artifacts["spells"] lane := profile.Artifacts["events"]
lane.Validators = []ModuleBinding{Binding("missing-validator")} lane.Validators = []ModuleBinding{Binding("missing-validator")}
profile.Artifacts["spells"] = lane profile.Artifacts["events"] = lane
return profile return profile
}), }),
want: []string{"baseline", "spells", "validate", "missing-validator"}, want: []string{"baseline", "events", "validate", "missing-validator"},
}, },
{ {
name: "output", name: "output",
@@ -284,23 +284,23 @@ func TestResolvePipelineRejectsMissingCapabilities(t *testing.T) {
}, },
{ {
name: "extract", name: "extract",
spec: ModuleSpec{Key: "spell-extractor", Stage: StageExtract, Requires: []string{"missing"}}, spec: ModuleSpec{Key: "event-extractor", Stage: StageExtract, Requires: []string{"missing"}},
want: []string{"baseline", "spells", "extract", "spell-extractor", "missing"}, want: []string{"baseline", "events", "extract", "event-extractor", "missing"},
}, },
{ {
name: "merge", name: "merge",
spec: ModuleSpec{Key: "appendorder", Stage: StageMerge, Requires: []string{"missing"}}, spec: ModuleSpec{Key: "appendorder", Stage: StageMerge, Requires: []string{"missing"}},
want: []string{"baseline", "spells", "merge", "appendorder", "missing"}, want: []string{"baseline", "events", "merge", "appendorder", "missing"},
}, },
{ {
name: "normalize", name: "normalize",
spec: ModuleSpec{Key: "noop", Stage: StageNormalize, Requires: []string{"missing"}}, spec: ModuleSpec{Key: "noop", Stage: StageNormalize, Requires: []string{"missing"}},
want: []string{"baseline", "spells", "normalize", "noop", "missing"}, want: []string{"baseline", "events", "normalize", "noop", "missing"},
}, },
{ {
name: "validate", name: "validate",
spec: ModuleSpec{Key: "grounded", Stage: StageValidate, Requires: []string{"missing"}}, spec: ModuleSpec{Key: "grounded", Stage: StageValidate, Requires: []string{"missing"}},
want: []string{"baseline", "spells", "validate", "grounded", "missing"}, want: []string{"baseline", "events", "validate", "grounded", "missing"},
}, },
{ {
name: "output", name: "output",
@@ -313,9 +313,9 @@ func TestResolvePipelineRejectsMissingCapabilities(t *testing.T) {
t.Run(test.name, func(t *testing.T) { t.Run(test.name, func(t *testing.T) {
catalog := newProfileCatalogWithOverride(t, test.spec) catalog := newProfileCatalogWithOverride(t, test.spec)
profile := baselineProfile() profile := baselineProfile()
lane := profile.Artifacts["spells"] lane := profile.Artifacts["events"]
lane.Validators = []ModuleBinding{Binding("grounded")} lane.Validators = []ModuleBinding{Binding("grounded")}
profile.Artifacts["spells"] = lane profile.Artifacts["events"] = lane
_, err := ResolvePipeline(profile, ResolveOptions{}, catalog) _, err := ResolvePipeline(profile, ResolveOptions{}, catalog)
if err == nil { if err == nil {
@@ -333,7 +333,7 @@ func TestResolvePipelineOrdersLanesDeterministically(t *testing.T) {
} }
got := laneIDs(resolved.ArtifactLanes) got := laneIDs(resolved.ArtifactLanes)
want := []string{"items", "spells", "treasure"} want := []string{"events", "notes", "summaries"}
if !reflect.DeepEqual(got, want) { if !reflect.DeepEqual(got, want) {
t.Fatalf("lane IDs = %#v, want %#v", got, want) t.Fatalf("lane IDs = %#v, want %#v", got, want)
} }
@@ -346,8 +346,8 @@ func TestResolvePipelineDigestIsDeterministicForEquivalentMaps(t *testing.T) {
Output: Binding("json"), Output: Binding("json"),
Chunk: ModuleBinding{Module: "generic", Options: map[string]any{"b": 2, "a": 1}}, Chunk: ModuleBinding{Module: "generic", Options: map[string]any{"b": 2, "a": 1}},
Artifacts: map[string]ArtifactLaneProfile{ Artifacts: map[string]ArtifactLaneProfile{
"spells": {Extract: Binding("spell-extractor")}, "events": {Extract: Binding("event-extractor")},
"items": {Extract: Binding("item-extractor")}, "notes": {Extract: Binding("note-extractor")},
}, },
} }
right := PipelineProfile{ right := PipelineProfile{
@@ -356,8 +356,8 @@ func TestResolvePipelineDigestIsDeterministicForEquivalentMaps(t *testing.T) {
Output: Binding("json"), Output: Binding("json"),
Chunk: ModuleBinding{Module: "generic", Options: map[string]any{"a": 1, "b": 2}}, Chunk: ModuleBinding{Module: "generic", Options: map[string]any{"a": 1, "b": 2}},
Artifacts: map[string]ArtifactLaneProfile{ Artifacts: map[string]ArtifactLaneProfile{
"items": {Extract: Binding("item-extractor")}, "notes": {Extract: Binding("note-extractor")},
"spells": {Extract: Binding("spell-extractor")}, "events": {Extract: Binding("event-extractor")},
}, },
} }
@@ -435,7 +435,7 @@ func baselineProfile() PipelineProfile {
ID: "baseline", ID: "baseline",
Input: Binding("text"), Input: Binding("text"),
Artifacts: map[string]ArtifactLaneProfile{ Artifacts: map[string]ArtifactLaneProfile{
"spells": {Extract: Binding("spell-extractor")}, "events": {Extract: Binding("event-extractor")},
}, },
} }
} }
@@ -444,9 +444,9 @@ func multiLaneProfile() PipelineProfile {
profile := baselineProfile() profile := baselineProfile()
profile.ID = "multi" profile.ID = "multi"
profile.Artifacts = map[string]ArtifactLaneProfile{ profile.Artifacts = map[string]ArtifactLaneProfile{
"treasure": {Extract: Binding("item-extractor")}, "summaries": {Extract: Binding("note-extractor")},
"spells": {Extract: Binding("spell-extractor")}, "events": {Extract: Binding("event-extractor")},
"items": {Extract: Binding("item-extractor")}, "notes": {Extract: Binding("note-extractor")},
} }
return profile return profile
} }
@@ -517,8 +517,8 @@ func defaultProfileSpecs() []ModuleSpec {
return []ModuleSpec{ return []ModuleSpec{
ModuleSpec{Key: "text", Stage: StageInput, Provides: []string{"source"}}, ModuleSpec{Key: "text", Stage: StageInput, Provides: []string{"source"}},
ModuleSpec{Key: "generic", Stage: StageChunk, Requires: []string{"source"}, Provides: []string{"chunk"}}, ModuleSpec{Key: "generic", Stage: StageChunk, Requires: []string{"source"}, Provides: []string{"chunk"}},
ModuleSpec{Key: "spell-extractor", Stage: StageExtract, Requires: []string{"chunk"}, Provides: []string{"candidate"}}, ModuleSpec{Key: "event-extractor", Stage: StageExtract, Requires: []string{"chunk"}, Provides: []string{"candidate"}},
ModuleSpec{Key: "item-extractor", Stage: StageExtract, Requires: []string{"chunk"}, Provides: []string{"candidate"}}, ModuleSpec{Key: "note-extractor", Stage: StageExtract, Requires: []string{"chunk"}, Provides: []string{"candidate"}},
ModuleSpec{Key: "appendorder", Stage: StageMerge, Requires: []string{"candidate"}, Provides: []string{"merged"}}, ModuleSpec{Key: "appendorder", Stage: StageMerge, Requires: []string{"candidate"}, Provides: []string{"merged"}},
ModuleSpec{Key: "noop", Stage: StageNormalize, Requires: []string{"merged"}, Provides: []string{"normalized"}}, ModuleSpec{Key: "noop", Stage: StageNormalize, Requires: []string{"merged"}, Provides: []string{"normalized"}},
ModuleSpec{Key: "grounded", Stage: StageValidate, Requires: []string{"normalized"}, Provides: []string{"validated"}}, ModuleSpec{Key: "grounded", Stage: StageValidate, Requires: []string{"normalized"}, Provides: []string{"validated"}},