(t *testing.T)
| 945 | } |
| 946 | |
| 947 | func TestBuildFromDevcontainerInSubfolder(t *testing.T) { |
| 948 | t.Parallel() |
| 949 | |
| 950 | // Ensures that a Git repository with a devcontainer.json is cloned and built. |
| 951 | srv := gittest.CreateGitServer(t, gittest.Options{ |
| 952 | Files: map[string]string{ |
| 953 | ".devcontainer/subfolder/devcontainer.json": `{ |
| 954 | "name": "Test", |
| 955 | "build": { |
| 956 | "dockerfile": "Dockerfile" |
| 957 | }, |
| 958 | }`, |
| 959 | ".devcontainer/subfolder/Dockerfile": "FROM " + testImageUbuntu, |
| 960 | }, |
| 961 | }) |
| 962 | ctr, err := runEnvbuilder(t, runOpts{env: []string{ |
| 963 | envbuilderEnv("GIT_URL", srv.URL), |
| 964 | }}) |
| 965 | require.NoError(t, err) |
| 966 | |
| 967 | output := execContainer(t, ctr, "echo hello") |
| 968 | require.Equal(t, "hello", strings.TrimSpace(output)) |
| 969 | } |
| 970 | |
| 971 | func TestBuildFromDevcontainerInRoot(t *testing.T) { |
| 972 | t.Parallel() |
nothing calls this directly
no test coverage detected