Skip to content

Enable changing default editor in integration tests #8666

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 1 commit into from
Mar 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
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
9 changes: 9 additions & 0 deletions components/gitpod-protocol/go/gitpod-service.go
Original file line number Diff line number Diff line change
Expand Up @@ -2056,6 +2056,15 @@ type UpdateUserStorageResourceOptions struct {
type AdditionalUserData struct {
EmailNotificationSettings *EmailNotificationSettings `json:"emailNotificationSettings,omitempty"`
Platforms []*UserPlatform `json:"platforms,omitempty"`
IdeSettings *IDESettings `json:"ideSettings,omitempty"`
}

// IDESettings is the IDESettings message type
type IDESettings struct {
DefaultIde string `json:"defaultIde,omitempty"`
UseDesktopIde bool `json:"useDesktopIde,omitempty"`
DefaultDesktopIde string `json:"defaultDesktopIde,omitempty"`
UseLatestVersion bool `json:"useLatestVersion,omitempty"`
}

// EmailNotificationSettings is the EmailNotificationSettings message type
Expand Down
18 changes: 18 additions & 0 deletions test/tests/ide/vscode/python_ws_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
"sigs.k8s.io/e2e-framework/pkg/envconf"
"sigs.k8s.io/e2e-framework/pkg/features"

protocol "github.com/gitpod-io/gitpod/gitpod-protocol"
agent "github.com/gitpod-io/gitpod/test/pkg/agent/workspace/api"
"github.com/gitpod-io/gitpod/test/pkg/integration"
)
Expand Down Expand Up @@ -60,6 +61,23 @@ func TestPythonExtWorkspace(t *testing.T) {
t.Fatal(err)
}

serverOpts := []integration.GitpodServerOpt{integration.WithGitpodUser(username)}
server, err := api.GitpodServer(serverOpts...)
if err != nil {
t.Fatal(err)
}

_, err = server.UpdateLoggedInUser(ctx, &protocol.User{
AdditionalData: &protocol.AdditionalUserData{
IdeSettings: &protocol.IDESettings{
DefaultIde: "code-latest",
},
},
})
if err != nil {
t.Fatalf("cannot set ide to vscode insiders: %q", err)
}

nfo, stopWs, err := integration.LaunchWorkspaceFromContextURL(ctx, "github.com/jeanp413/python-test-workspace", username, api)
if err != nil {
t.Fatal(err)
Expand Down