Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
test user as well
  • Loading branch information
mafredri committed Sep 27, 2024
commit ccafa76d4139a0533a9d6e459e619da40d335e6a
10 changes: 8 additions & 2 deletions integration/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1320,7 +1320,8 @@ RUN date --utc > /root/date.txt`, testImageAlpine),
ctx, cancel := context.WithCancel(context.Background())
t.Cleanup(cancel)

wantOverrides := []string{
wantOutput := []string{
"containeruser",
"FROM_CONTAINER_ENV=containerEnv",
"FROM_REMOTE_ENV=remoteEnv",
"CONTAINER_OVERRIDE_C=containerEnv",
Expand All @@ -1336,15 +1337,20 @@ RUN date --utc > /root/date.txt`, testImageAlpine),
ENV CONTAINER_OVERRIDE_C=container
ENV CONTAINER_OVERRIDE_CR=container
ENV CONTAINER_OVERRIDE_R=container
RUN adduser -D containeruser
RUN adduser -D remoteuser
USER root
`, testImageAlpine),
".devcontainer/devcontainer.json": `
{
"dockerFile": "Dockerfile",
"containerUser": "containeruser",
"containerEnv": {
"CONTAINER_OVERRIDE_C": "containerEnv",
"CONTAINER_OVERRIDE_CR": "containerEnv",
"FROM_CONTAINER_ENV": "containerEnv",
},
"remoteUser": "remoteuser",
"remoteEnv": {
"CONTAINER_OVERRIDE_CR": "remoteEnv",
"CONTAINER_OVERRIDE_R": "remoteEnv",
Expand Down Expand Up @@ -1429,7 +1435,7 @@ RUN date --utc > /root/date.txt`, testImageAlpine),
t.Fatalf("unexpected output (-want +got):\n%s", diff)
}

for _, want := range wantOverrides {
for _, want := range wantOutput {
assert.Contains(t, gotEnv, want, "expected env var %q to be present", want)
}
})
Expand Down
Loading