(_ context.Context)
| 57 | } |
| 58 | |
| 59 | func (ms *mockServer) CurrentModule(_ context.Context) (dagql.ObjectResult[*Module], error) { |
| 60 | var zero dagql.ObjectResult[*Module] |
| 61 | if ms.moduleSource == nil { |
| 62 | return zero, nil |
| 63 | } |
| 64 | // This helper only builds test-only module results. Keep using |
| 65 | // context.Background here: passing the caller ctx would not change |
| 66 | // behavior, because dagql.NewServer ignores its context today and this |
| 67 | // path does not use the dagql cache. |
| 68 | dag, err := dagql.NewServer(context.Background(), &Query{}) |
| 69 | if err != nil { |
| 70 | panic(err) |
| 71 | } |
| 72 | dag.InstallObject(dagql.NewClass(dag, dagql.ClassOpts[*ModuleSource]{Typed: &ModuleSource{}})) |
| 73 | dag.InstallObject(dagql.NewClass(dag, dagql.ClassOpts[*Module]{Typed: &Module{}})) |
| 74 | |
| 75 | sourceRes, err := dagql.NewObjectResultForCall(ms.moduleSource, dag, &dagql.ResultCall{ |
| 76 | Kind: dagql.ResultCallKindSynthetic, |
| 77 | SyntheticOp: "mock_module_source", |
| 78 | Type: dagql.NewResultCallType(ms.moduleSource.Type()), |
| 79 | }) |
| 80 | if err != nil { |
| 81 | panic(err) |
| 82 | } |
| 83 | |
| 84 | dn := dagql.Nullable[dagql.ObjectResult[*ModuleSource]]{ |
| 85 | Valid: true, |
| 86 | Value: sourceRes, |
| 87 | } |
| 88 | return dagql.NewObjectResultForCall(&Module{ |
| 89 | Source: dn, |
| 90 | }, dag, &dagql.ResultCall{ |
| 91 | Kind: dagql.ResultCallKindSynthetic, |
| 92 | SyntheticOp: "mock_current_module", |
| 93 | Type: dagql.NewResultCallType((&Module{}).Type()), |
| 94 | }) |
| 95 | } |
| 96 | |
| 97 | func (ms *mockServer) ModuleParent(context.Context) (dagql.ObjectResult[*Module], error) { |
| 98 | return dagql.ObjectResult[*Module]{}, nil |
nothing calls this directly
no test coverage detected