MCPcopy Create free account
hub / github.com/dagger/dagger / TestIsIntrospectionPreservesClassification

Function TestIsIntrospectionPreservesClassification

core/telemetry_test.go:260–305  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

258}
259
260func TestIsIntrospectionPreservesClassification(t *testing.T) {
261 cache, err := dagql.NewCache(t.Context(), "", nil, nil)
262 require.NoError(t, err)
263 ctx := dagql.ContextWithCache(t.Context(), cache)
264
265 functionFrame := testResultCall("function", dagql.String(""), nil)
266 functionFrame.Type = dagql.NewResultCallType((&Function{}).Type())
267
268 tests := []struct {
269 name string
270 frame *dagql.ResultCall
271 want bool
272 }{
273 {
274 name: "root currentTypeDefs",
275 frame: testResultCall("currentTypeDefs", dagql.String(""), nil),
276 want: true,
277 },
278 {
279 name: "root plain field",
280 frame: testResultCall("plain", dagql.String(""), nil),
281 want: false,
282 },
283 {
284 name: "function builder field",
285 frame: testResultCall("withArg", dagql.String(""), functionFrame),
286 want: true,
287 },
288 {
289 name: "descendant of introspection root",
290 frame: testResultCall("name", dagql.String(""), testResultCall("currentTypeDefs", dagql.String(""), nil)),
291 want: true,
292 },
293 {
294 name: "descendant of plain root",
295 frame: testResultCall("name", dagql.String(""), testResultCall("plain", dagql.String(""), nil)),
296 want: false,
297 },
298 }
299
300 for _, tc := range tests {
301 t.Run(tc.name, func(t *testing.T) {
302 require.Equal(t, tc.want, isIntrospection(ctx, tc.frame))
303 })
304 }
305}
306
307type telemetryTestNoopResolver struct{}
308

Callers

nothing calls this directly

Calls 10

NewCacheFunction · 0.92
ContextWithCacheFunction · 0.92
StringTypeAlias · 0.92
NewResultCallTypeFunction · 0.92
testResultCallFunction · 0.85
isIntrospectionFunction · 0.85
ContextMethod · 0.65
TypeMethod · 0.65
RunMethod · 0.65
EqualMethod · 0.65

Tested by

no test coverage detected