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

Function TestBuildFromCustomWorkspaceBaseDir

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

Source from the content-addressed store, hash-verified

923}
924
925func TestBuildFromCustomWorkspaceBaseDir(t *testing.T) {
926 t.Parallel()
927
928 // Ensures that a Git repository with a devcontainer.json is cloned and built.
929 srv := gittest.CreateGitServer(t, gittest.Options{
930 Files: map[string]string{
931 "Dockerfile": "FROM " + testImageUbuntu,
932 },
933 })
934 ctr, err := runEnvbuilder(t, runOpts{
935 env: []string{
936 envbuilderEnv("DOCKERFILE_PATH", "Dockerfile"),
937 envbuilderEnv("WORKSPACE_BASE_DIR", "/foo"),
938 envbuilderEnv("GIT_URL", srv.URL),
939 },
940 })
941 require.NoError(t, err)
942
943 output := execContainer(t, ctr, "readlink /proc/1/cwd")
944 require.Contains(t, output, "/foo/")
945}
946
947func TestBuildFromDevcontainerInSubfolder(t *testing.T) {
948 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