Files
Agent-System-Backend/internal/runmgr/entry_test.go
T
weichen f1302ed5b3 Enable canonical versioned Go module consumption
Why: Allow consumers to download an immutable module revision without nested source checkouts or local path replacements.

Evidence: SELF package tests and the prior canonical-path rejection are recorded in the Dev dependency-workspace task card; remote consumption is replayed against the committed candidate.

Impact: Change the module identity and its Go imports while preserving API behavior. Existing historical submodule revisions remain buildable.

Refs: Versioned dependencies U1/U3; feature/dependency-workspace
2026-10-13 15:47:16 +00:00

33 lines
1.3 KiB
Go

package runmgr
import (
"testing"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/runtime"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/workflow"
core "git-ssh.u1680832.nyat.app/weichen/Agent-System-Core.git"
)
type nameRunner struct{ name string }
func (n nameRunner) Name() string { return n.name }
func (n nameRunner) Execute(rc runtime.RunCtx) error { return nil }
func TestSelectConversationRunner(t *testing.T) {
m := &Manager{runner: nameRunner{name: "direct"}, mock: nameRunner{name: "mock"}, squad: nameRunner{name: "squad"}, wfRunner: nameRunner{name: "workflow"}}
if got := selectConversationRunner(m, core.EffectiveSettings{}, nil); got.Name() != "direct" {
t.Fatalf("default = %s", got.Name())
}
squadEff := core.EffectiveSettings{"runtime": map[string]any{"entry": "squad"}}
if got := selectConversationRunner(m, squadEff, nil); got.Name() != "squad" {
t.Fatalf("squad entry = %s", got.Name())
}
mockEff := core.EffectiveSettings{"runtime": map[string]any{"entry": "squad", "mock": true}}
if got := selectConversationRunner(m, mockEff, nil); got.Name() != "mock" {
t.Fatalf("mock wins = %s", got.Name())
}
if got := selectConversationRunner(m, mockEff, &workflow.Launch{}); got.Name() != "workflow" {
t.Fatalf("workflow wins = %s", got.Name())
}
}