(t *testing.T)
| 214 | } |
| 215 | |
| 216 | func TestDanglingBuildStage(t *testing.T) { |
| 217 | t.Parallel() |
| 218 | |
| 219 | // Ensures that a Git repository with a devcontainer.json is cloned and built. |
| 220 | srv := gittest.CreateGitServer(t, gittest.Options{ |
| 221 | Files: map[string]string{ |
| 222 | "devcontainer.json": `{ |
| 223 | "name": "Test", |
| 224 | "build": { |
| 225 | "dockerfile": "Dockerfile" |
| 226 | }, |
| 227 | }`, |
| 228 | "Dockerfile": fmt.Sprintf(`FROM %s as a |
| 229 | RUN date > /root/date.txt`, testImageUbuntu), |
| 230 | }, |
| 231 | }) |
| 232 | ctr, err := runEnvbuilder(t, runOpts{env: []string{ |
| 233 | envbuilderEnv("GIT_URL", srv.URL), |
| 234 | }}) |
| 235 | require.NoError(t, err) |
| 236 | |
| 237 | output := execContainer(t, ctr, "cat /date.txt") |
| 238 | require.NotEmpty(t, strings.TrimSpace(output)) |
| 239 | } |
| 240 | |
| 241 | func TestUserFromMultistage(t *testing.T) { |
| 242 | t.Parallel() |
nothing calls this directly
no test coverage detected