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

Function TestBuildWithSetupScript

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

Source from the content-addressed store, hash-verified

878}
879
880func TestBuildWithSetupScript(t *testing.T) {
881 t.Parallel()
882
883 // Ensures that a Git repository with a Dockerfile is cloned and built.
884 srv := gittest.CreateGitServer(t, gittest.Options{
885 Files: map[string]string{
886 "Dockerfile": "FROM " + testImageAlpine,
887 },
888 })
889 ctr, err := runEnvbuilder(t, runOpts{env: []string{
890 envbuilderEnv("GIT_URL", srv.URL),
891 envbuilderEnv("DOCKERFILE_PATH", "Dockerfile"),
892 envbuilderEnv("SETUP_SCRIPT", "echo \"INIT_ARGS=-c 'echo hi > /wow && sleep infinity'\" >> $ENVBUILDER_ENV"),
893 }})
894 require.NoError(t, err)
895
896 output := execContainer(t, ctr, "cat /wow")
897 require.Equal(t, "hi", strings.TrimSpace(output))
898}
899
900func TestBuildFromDevcontainerInCustomPath(t *testing.T) {
901 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