Validate providers and retain complete run debugging context
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
package pipeline
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestStarterUsesConfiguredProviderAndModel(t *testing.T) {
|
||||
original := Template([]string{"worker"}, true)
|
||||
source := WithDefaultModel(original, "openai/gpt-test")
|
||||
graph, err := Parse(source)
|
||||
if err != nil || graph.Stages[0].Configs["provider"] != "openai" || graph.Stages[0].Configs["model"] != "gpt-test" {
|
||||
t.Fatal(err, graph)
|
||||
}
|
||||
if !strings.Contains(original, "provider=opencode-go") || WithDefaultModel(original, "bad\nvalue/model") != original {
|
||||
t.Fatal("modified original or accepted invalid default")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user