Skip to content

Commit

Permalink
update some more tests missed initially
Browse files Browse the repository at this point in the history
  • Loading branch information
johnstcn committed Apr 24, 2024
1 parent 0f7178b commit 5978e62
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions devcontainer/devcontainer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func TestCompileWithFeatures(t *testing.T) {
"context": ".",
},
// Comments here!
"image": "codercom/code-server:latest",
"image": "localhost:5000/envbuilder-test-codercom-code-server:latest",
"features": {
"` + featureOne + `": {},
"` + featureTwo + `": "potato"
Expand All @@ -96,7 +96,7 @@ func TestCompileWithFeatures(t *testing.T) {
featureTwoMD5 := md5.Sum([]byte(featureTwo))
featureTwoDir := fmt.Sprintf("/.envbuilder/features/two-%x", featureTwoMD5[:4])

require.Equal(t, `FROM codercom/code-server:latest
require.Equal(t, `FROM localhost:5000/envbuilder-test-codercom-code-server:latest
USER root
# Rust tomato - Example description!
Expand All @@ -116,7 +116,7 @@ func TestCompileDevContainer(t *testing.T) {
t.Parallel()
fs := memfs.New()
dc := &devcontainer.Spec{
Image: "codercom/code-server:latest",
Image: "localhost:5000/envbuilder-test-ubuntu:latest",
}
params, err := dc.Compile(fs, "", magicDir, "", "", false)
require.NoError(t, err)
Expand All @@ -141,7 +141,7 @@ func TestCompileDevContainer(t *testing.T) {
require.NoError(t, err)
file, err := fs.OpenFile(filepath.Join(dcDir, "Dockerfile"), os.O_CREATE|os.O_WRONLY, 0644)
require.NoError(t, err)
_, err = io.WriteString(file, "FROM ubuntu")
_, err = io.WriteString(file, "FROM localhost:5000/envbuilder-test-ubuntu:latest")
require.NoError(t, err)
_ = file.Close()
params, err := dc.Compile(fs, dcDir, magicDir, "", "/var/workspace", false)
Expand Down
14 changes: 7 additions & 7 deletions integration/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ func TestBuildFromDevcontainerWithFeatures(t *testing.T) {
}
}
}`,
".devcontainer/Dockerfile": "FROM ubuntu",
".devcontainer/Dockerfile": "FROM " + testImageUbuntu,
".devcontainer/feature3/devcontainer-feature.json": string(feature3Spec),
".devcontainer/feature3/install.sh": "echo $GRAPE > /test3output",
},
Expand Down Expand Up @@ -262,7 +262,7 @@ func TestBuildFromDevcontainerInCustomPath(t *testing.T) {
"dockerfile": "Dockerfile"
},
}`,
".devcontainer/custom/Dockerfile": "FROM ubuntu",
".devcontainer/custom/Dockerfile": "FROM " + testImageUbuntu,
},
})
ctr, err := runEnvbuilder(t, options{env: []string{
Expand All @@ -287,7 +287,7 @@ func TestBuildFromDevcontainerInSubfolder(t *testing.T) {
"dockerfile": "Dockerfile"
},
}`,
".devcontainer/subfolder/Dockerfile": "FROM ubuntu",
".devcontainer/subfolder/Dockerfile": "FROM " + testImageUbuntu,
},
})
ctr, err := runEnvbuilder(t, options{env: []string{
Expand All @@ -310,7 +310,7 @@ func TestBuildFromDevcontainerInRoot(t *testing.T) {
"dockerfile": "Dockerfile"
},
}`,
"Dockerfile": "FROM ubuntu",
"Dockerfile": "FROM " + testImageUbuntu,
},
})
ctr, err := runEnvbuilder(t, options{env: []string{
Expand Down Expand Up @@ -409,7 +409,7 @@ func TestBuildFailsFallback(t *testing.T) {
// Ensures that a Git repository with a Dockerfile is cloned and built.
url := createGitServer(t, gitServerOptions{
files: map[string]string{
"Dockerfile": `FROM alpine
"Dockerfile": `FROM ` + testImageAlpine + `
RUN exit 1`,
},
})
Expand Down Expand Up @@ -525,7 +525,7 @@ func TestLifecycleScripts(t *testing.T) {
"parallel2": ["sh", "-c", "echo parallel2 > /tmp/parallel2"]
}
}`,
".devcontainer/Dockerfile": "FROM alpine:latest\nUSER nobody",
".devcontainer/Dockerfile": "FROM " + testImageAlpine + "\nUSER nobody",
},
})
ctr, err := runEnvbuilder(t, options{env: []string{
Expand Down Expand Up @@ -561,7 +561,7 @@ func TestPostStartScript(t *testing.T) {
".devcontainer/init.sh": `#!/bin/sh
/tmp/post-start.sh
sleep infinity`,
".devcontainer/Dockerfile": `FROM alpine:latest
".devcontainer/Dockerfile": `FROM ` + testImageAlpine + `
COPY init.sh /bin
RUN chmod +x /bin/init.sh
USER nobody`,
Expand Down

0 comments on commit 5978e62

Please sign in to comment.