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)
| 20 | // workspaceBase returns a container with git, the dagger CLI, and an |
| 21 | // initialized git repo at /work — the starting point for workspace tests. |
| 22 | func 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 |
no test coverage detected