Add generic checked starter workflows and isolated lifecycle coverage

This commit is contained in:
2026-10-20 21:31:05 +01:00
parent ae6ba6ae10
commit d58b3f49fc
15 changed files with 475 additions and 109 deletions
+14
View File
@@ -15,6 +15,9 @@ import (
)
func TestTemplatesDoNotSeedDatabaseAndCreateOnlyPreservesExisting(t *testing.T) {
t.Setenv("PIPELINES_HARNESS_CONFIG", filepath.Join(t.TempDir(), "harnesses.json"))
t.Setenv("PIPELINES_DEFAULT_MODEL", "test-provider/test-model")
t.Setenv("PIPELINES_DEFAULT_HARNESS", "opencode")
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
defer cancel()
store, err := pipeline.Open(filepath.Join(t.TempDir(), "empty.db"))
@@ -48,6 +51,17 @@ func TestTemplatesDoNotSeedDatabaseAndCreateOnlyPreservesExisting(t *testing.T)
if response.Type != protocol.Templates || len(response.Templates) != len(examples.Catalog()) {
t.Fatal("missing catalog", response.Type, len(response.Templates))
}
for _, item := range response.Templates {
graph, err := pipeline.Parse(item.Source)
if err != nil {
t.Fatal("invalid template returned to web/CLI", item.Key, err)
}
for _, s := range graph.Stages {
if s.Configs["provider"] != "test-provider" || s.Configs["model"] != "test-model" || s.Configs["harness"] != "opencode" {
t.Fatal("template did not inherit configured defaults", item.Key, s.Configs)
}
}
}
items, err := store.List(ctx)
if err != nil || len(items) != 0 {
t.Fatal("browsing created pipelines", err)