(t *testing.T)
| 979 | } |
| 980 | |
| 981 | func 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 | |
| 1023 | func TestBootTasksBuildsRuntimeWhenDependenciesAreAvailable(t *testing.T) { |
| 1024 | t.Parallel() |
nothing calls this directly
no test coverage detected