Consolidates three codebases into a single agent orchestration repo: - agentci (from go-scm): Clotho dual-run verification, agent config, SSH security (sanitisation, secure commands, token masking) - jobrunner (from go-scm): Poll-dispatch-report pipeline with 7 handlers (dispatch, completion, auto-merge, publish draft, dismiss reviews, send fix command, tick parent epic) - plugins marketplace (from agentic/plugins): 27 Claude/Codex/Gemini plugins with shared MCP server All 150+ tests passing across 6 packages. Co-Authored-By: Virgil <virgil@lethean.io>
35 lines
938 B
Go
35 lines
938 B
Go
package main
|
|
|
|
import "testing"
|
|
|
|
func TestNormalizeCoreCommand_Good(t *testing.T) {
|
|
command, args, err := normalizeCoreCommand("go", []string{"test"})
|
|
if err != nil {
|
|
t.Fatalf("expected command to be allowed: %v", err)
|
|
}
|
|
if command != "go" {
|
|
t.Fatalf("expected go command, got %s", command)
|
|
}
|
|
if len(args) != 1 || args[0] != "test" {
|
|
t.Fatalf("unexpected args: %#v", args)
|
|
}
|
|
}
|
|
|
|
func TestNormalizeCoreCommand_Bad(t *testing.T) {
|
|
if _, _, err := normalizeCoreCommand("rm -rf", nil); err == nil {
|
|
t.Fatalf("expected command to be rejected")
|
|
}
|
|
}
|
|
|
|
func TestNormalizeCoreCommand_Ugly(t *testing.T) {
|
|
command, args, err := normalizeCoreCommand("go test", []string{"-v"})
|
|
if err != nil {
|
|
t.Fatalf("expected command to be allowed: %v", err)
|
|
}
|
|
if command != "go" {
|
|
t.Fatalf("expected go command, got %s", command)
|
|
}
|
|
if len(args) != 2 || args[0] != "test" || args[1] != "-v" {
|
|
t.Fatalf("unexpected args: %#v", args)
|
|
}
|
|
}
|