MCPcopy
hub / github.com/dagger/container-use / initializeDaggerOnce

Function initializeDaggerOnce

environment/integration/helpers.go:155–174  ·  view source on GitHub ↗

initializeDaggerOnce initializes Dagger client once for all tests

(t *testing.T)

Source from the content-addressed store, hash-verified

153
154// initializeDaggerOnce initializes Dagger client once for all tests
155func initializeDaggerOnce(t *testing.T) {
156 daggerOnce.Do(func() {
157 if testDaggerClient != nil {
158 return
159 }
160
161 ctx := context.Background()
162 client, err := dagger.Connect(ctx)
163 if err != nil {
164 daggerErr = err
165 return
166 }
167
168 testDaggerClient = client
169 })
170
171 if daggerErr != nil {
172 t.Skipf("Skipping test - Dagger not available: %v", daggerErr)
173 }
174}
175
176// UserActions provides test helpers that mirror MCP tool behavior exactly
177// These represent what a user would experience when using the MCP tools

Callers 2

WithRepositoryFunction · 0.85
TestWeirdUserScenariosFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestWeirdUserScenariosFunction · 0.68