MCPcopy Create free account
hub / github.com/compozy/agh / TestBootTasksSkipsMissingPrerequisites

Function TestBootTasksSkipsMissingPrerequisites

internal/daemon/task_runtime_test.go:981–1021  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

979}
980
981func TestBootTasksSkipsMissingPrerequisites(t *testing.T) {
982 t.Parallel()
983
984 daemon := &Daemon{
985 homePaths: aghconfig.HomePaths{HomeDir: t.TempDir()},
986 }
987
988 testCases := []struct {
989 name string
990 state *bootState
991 }{
992 {
993 name: "Should skip when the boot state is nil",
994 state: nil,
995 },
996 {
997 name: "Should skip when the registry is missing",
998 state: &bootState{
999 logger: discardLogger(),
1000 sessions: &fakeSessionManager{},
1001 },
1002 },
1003 {
1004 name: "Should skip when the session manager is missing",
1005 state: &bootState{
1006 logger: discardLogger(),
1007 registry: openDaemonTestGlobalDB(t),
1008 },
1009 },
1010 }
1011
1012 for _, tc := range testCases {
1013 t.Run(tc.name, func(t *testing.T) {
1014 t.Parallel()
1015
1016 if err := daemon.bootTasks(context.Background(), tc.state); err != nil {
1017 t.Fatalf("bootTasks() error = %v, want nil", err)
1018 }
1019 })
1020 }
1021}
1022
1023func TestBootTasksBuildsRuntimeWhenDependenciesAreAvailable(t *testing.T) {
1024 t.Parallel()

Callers

nothing calls this directly

Calls 4

bootTasksMethod · 0.95
openDaemonTestGlobalDBFunction · 0.85
discardLoggerFunction · 0.70
RunMethod · 0.65

Tested by

no test coverage detected