(t *testing.T)
| 898 | } |
| 899 | |
| 900 | func TestBuildFromDevcontainerInCustomPath(t *testing.T) { |
| 901 | t.Parallel() |
| 902 | |
| 903 | // Ensures that a Git repository with a devcontainer.json is cloned and built. |
| 904 | srv := gittest.CreateGitServer(t, gittest.Options{ |
| 905 | Files: map[string]string{ |
| 906 | ".devcontainer/custom/devcontainer.json": `{ |
| 907 | "name": "Test", |
| 908 | "build": { |
| 909 | "dockerfile": "Dockerfile" |
| 910 | }, |
| 911 | }`, |
| 912 | ".devcontainer/custom/Dockerfile": "FROM " + testImageUbuntu, |
| 913 | }, |
| 914 | }) |
| 915 | ctr, err := runEnvbuilder(t, runOpts{env: []string{ |
| 916 | envbuilderEnv("GIT_URL", srv.URL), |
| 917 | envbuilderEnv("DEVCONTAINER_DIR", ".devcontainer/custom"), |
| 918 | }}) |
| 919 | require.NoError(t, err) |
| 920 | |
| 921 | output := execContainer(t, ctr, "echo hello") |
| 922 | require.Equal(t, "hello", strings.TrimSpace(output)) |
| 923 | } |
| 924 | |
| 925 | func TestBuildFromCustomWorkspaceBaseDir(t *testing.T) { |
| 926 | t.Parallel() |
nothing calls this directly
no test coverage detected