MCPcopy Index your code
hub / github.com/dagger/dagger / TestModuleFunctionCacheImplicitInputs

Function TestModuleFunctionCacheImplicitInputs

core/modfunc_test.go:12–112  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

10)
11
12func TestModuleFunctionCacheImplicitInputs(t *testing.T) {
13 sessionCtx := engine.ContextWithClientMetadata(context.Background(), &engine.ClientMetadata{
14 ClientID: "client-1",
15 SessionID: "session-1",
16 })
17
18 for _, tc := range []struct {
19 name string
20 mod *Module
21 fn *Function
22 expectCallScope bool
23 expectSessionScope bool
24 }{
25 {
26 name: "default policy",
27 mod: &Module{
28 NameField: "test",
29 },
30 fn: &Function{
31 Name: "fn",
32 },
33 expectSessionScope: false,
34 },
35 {
36 name: "explicit per-session policy",
37 mod: &Module{
38 NameField: "test",
39 },
40 fn: &Function{
41 Name: "fn",
42 CachePolicy: FunctionCachePolicyPerSession,
43 },
44 expectSessionScope: true,
45 },
46 {
47 name: "default policy with module disable-default-caching",
48 mod: &Module{
49 NameField: "test",
50 DisableDefaultFunctionCaching: true,
51 },
52 fn: &Function{
53 Name: "fn",
54 },
55 expectSessionScope: true,
56 },
57 {
58 name: "explicit never policy",
59 mod: &Module{
60 NameField: "test",
61 },
62 fn: &Function{
63 Name: "fn",
64 CachePolicy: FunctionCachePolicyNever,
65 },
66 expectCallScope: true,
67 },
68 } {
69 t.Run(tc.name, func(t *testing.T) {

Callers

nothing calls this directly

Calls 13

cacheImplicitInputsMethod · 0.95
NewObjectResultForCallFunction · 0.92
NewClassFunction · 0.92
NewResultCallTypeFunction · 0.92
mapImplicitInputsByNameFunction · 0.85
BackgroundMethod · 0.65
RunMethod · 0.65
InstallObjectMethod · 0.65
TypeMethod · 0.65

Tested by

no test coverage detected