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

Function TestBuildFromDevcontainerInSubfolder

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

Source from the content-addressed store, hash-verified

945}
946
947func TestBuildFromDevcontainerInSubfolder(t *testing.T) {
948 t.Parallel()
949
950 // Ensures that a Git repository with a devcontainer.json is cloned and built.
951 srv := gittest.CreateGitServer(t, gittest.Options{
952 Files: map[string]string{
953 ".devcontainer/subfolder/devcontainer.json": `{
954 "name": "Test",
955 "build": {
956 "dockerfile": "Dockerfile"
957 },
958 }`,
959 ".devcontainer/subfolder/Dockerfile": "FROM " + testImageUbuntu,
960 },
961 })
962 ctr, err := runEnvbuilder(t, runOpts{env: []string{
963 envbuilderEnv("GIT_URL", srv.URL),
964 }})
965 require.NoError(t, err)
966
967 output := execContainer(t, ctr, "echo hello")
968 require.Equal(t, "hello", strings.TrimSpace(output))
969}
970
971func TestBuildFromDevcontainerInRoot(t *testing.T) {
972 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