Add generic checked starter workflows and isolated lifecycle coverage
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user