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

Function workspaceBase

core/integration/workspace_test.go:22–31  ·  view source on GitHub ↗

workspaceBase returns a container with git, the dagger CLI, and an initialized git repo at /work — the starting point for workspace tests.

(t testing.TB, c *dagger.Client)

Source from the content-addressed store, hash-verified

20// workspaceBase returns a container with git, the dagger CLI, and an
21// initialized git repo at /work — the starting point for workspace tests.
22func workspaceBase(t testing.TB, c *dagger.Client) *dagger.Container {
23 t.Helper()
24 return c.Container().From(golangImage).
25 WithExec([]string{"apk", "add", "git"}).
26 WithExec([]string{"git", "config", "--global", "user.email", "dagger@example.com"}).
27 WithExec([]string{"git", "config", "--global", "user.name", "Dagger Tests"}).
28 WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
29 WithWorkdir("/work").
30 WithExec([]string{"git", "init"})
31}
32
33// initDangModule creates a Dang module in the workspace with the given name
34// and source code. Uses "dagger init" and "dagger toolchain install" to

Callers 15

TestLiveModuleCallMethod · 0.85
TestBlueprintMethod · 0.85
TestFindUpMethod · 0.85
TestWorkspaceArgMethod · 0.85
TestWorkspaceFileMethod · 0.85

Calls 6

daggerCliFileFunction · 0.85
WithExecMethod · 0.45
WithWorkdirMethod · 0.45
WithMountedFileMethod · 0.45
FromMethod · 0.45
ContainerMethod · 0.45

Tested by

no test coverage detected