MCPcopy Create free account
hub / github.com/coder/envbuilder / TestDanglingBuildStage

Function TestDanglingBuildStage

integration/integration_test.go:216–239  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

214}
215
216func 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
229RUN 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
241func TestUserFromMultistage(t *testing.T) {
242 t.Parallel()

Callers

nothing calls this directly

Calls 4

CreateGitServerFunction · 0.92
runEnvbuilderFunction · 0.85
envbuilderEnvFunction · 0.85
execContainerFunction · 0.85

Tested by

no test coverage detected