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

Function Query

internal/testutil/query.go:17–30  ·  view source on GitHub ↗
(t *testctx.T, query string, opts *QueryOptions, clientOpts ...dagger.ClientOpt)

Source from the content-addressed store, hash-verified

15}
16
17func Query[R any](t *testctx.T, query string, opts *QueryOptions, clientOpts ...dagger.ClientOpt) (*R, error) {
18 t.Helper()
19 ctx := t.Context()
20 clientOpts = append([]dagger.ClientOpt{
21 dagger.WithLogOutput(NewTWriter(t)),
22 }, clientOpts...)
23 client, err := dagger.Connect(ctx, clientOpts...)
24 if err != nil {
25 return nil, err
26 }
27 t.Cleanup(func() { client.Close() })
28
29 return QueryWithClient[R](client, t, query, opts)
30}
31
32func QueryWithClient[R any](c *dagger.Client, t *testctx.T, query string, opts *QueryOptions) (*R, error) {
33 t.Helper()

Callers 15

TestScratchMethod · 0.92
TestFromMethod · 0.92
TestExecSyncMethod · 0.92
TestErrorMethod · 0.92
TestExecStdinMethod · 0.92
TestExecWithWorkdirMethod · 0.92
TestWithDefaultArgsMethod · 0.92
TestVariablesMethod · 0.92
TestWithoutVariableMethod · 0.92
TestWorkdirMethod · 0.92

Calls 5

NewTWriterFunction · 0.85
CleanupMethod · 0.80
ContextMethod · 0.65
ConnectMethod · 0.65
CloseMethod · 0.65

Tested by 15

TestScratchMethod · 0.74
TestFromMethod · 0.74
TestExecSyncMethod · 0.74
TestErrorMethod · 0.74
TestExecStdinMethod · 0.74
TestExecWithWorkdirMethod · 0.74
TestWithDefaultArgsMethod · 0.74
TestVariablesMethod · 0.74
TestWithoutVariableMethod · 0.74
TestWorkdirMethod · 0.74