Skip to content

feat(cli): support opening devcontainers in vscode #17189

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Apr 3, 2025
Prev Previous commit
Next Next commit
chore: fix oopsie on test
  • Loading branch information
DanielleMaywood committed Apr 3, 2025
commit a1e95e80cbd7b9000c15ba98615804bb966c089e
16 changes: 8 additions & 8 deletions cli/open_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,11 @@ func TestOpenVSCode_NoAgentDirectory(t *testing.T) {
wd, err := os.Getwd()
require.NoError(t, err)

absPath := "/home/coder"
if runtime.GOOS == "windows" {
absPath = "C:\\home\\coder"
}

tests := []struct {
name string
args []string
Expand All @@ -205,7 +210,7 @@ func TestOpenVSCode_NoAgentDirectory(t *testing.T) {
},
{
name: "ok with absolute path",
args: []string{"--test.open-error", workspace.Name, "/home/coder"},
args: []string{"--test.open-error", workspace.Name, absPath},
wantDir: "/home/coder",
},
{
Expand Down Expand Up @@ -508,11 +513,6 @@ func TestOpenVSCodeDevContainer_NoAgentDirectory(t *testing.T) {
wd, err := os.Getwd()
require.NoError(t, err)

absPath := "/home/coder"
if runtime.GOOS == "windows" {
absPath = "C:\\home\\coder"
}

tests := []struct {
name string
env map[string]string
Expand All @@ -533,8 +533,8 @@ func TestOpenVSCodeDevContainer_NoAgentDirectory(t *testing.T) {
},
{
name: "ok with absolute path",
args: []string{"--test.open-error", workspace.Name, "--container", containerName, absPath},
wantDir: absPath,
args: []string{"--test.open-error", workspace.Name, "--container", containerName, "/home/coder"},
wantDir: "/home/coder",
},
{
name: "ok with token",
Expand Down