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

Function TestBuildFromDevcontainerInCustomPath

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

Source from the content-addressed store, hash-verified

898}
899
900func TestBuildFromDevcontainerInCustomPath(t *testing.T) {
901 t.Parallel()
902
903 // Ensures that a Git repository with a devcontainer.json is cloned and built.
904 srv := gittest.CreateGitServer(t, gittest.Options{
905 Files: map[string]string{
906 ".devcontainer/custom/devcontainer.json": `{
907 "name": "Test",
908 "build": {
909 "dockerfile": "Dockerfile"
910 },
911 }`,
912 ".devcontainer/custom/Dockerfile": "FROM " + testImageUbuntu,
913 },
914 })
915 ctr, err := runEnvbuilder(t, runOpts{env: []string{
916 envbuilderEnv("GIT_URL", srv.URL),
917 envbuilderEnv("DEVCONTAINER_DIR", ".devcontainer/custom"),
918 }})
919 require.NoError(t, err)
920
921 output := execContainer(t, ctr, "echo hello")
922 require.Equal(t, "hello", strings.TrimSpace(output))
923}
924
925func TestBuildFromCustomWorkspaceBaseDir(t *testing.T) {
926 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