From 35bff7506d490e343fcd9006c1fe4cb584d7687e Mon Sep 17 00:00:00 2001 From: Jean Pierre Date: Tue, 8 Mar 2022 13:04:09 +0000 Subject: [PATCH] Set editor to insiders in ide test --- .../gitpod-protocol/go/gitpod-service.go | 9 +++++++++ test/tests/ide/vscode/python_ws_test.go | 18 ++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/components/gitpod-protocol/go/gitpod-service.go b/components/gitpod-protocol/go/gitpod-service.go index 83eb4fe0505b51..681aea9c4de29b 100644 --- a/components/gitpod-protocol/go/gitpod-service.go +++ b/components/gitpod-protocol/go/gitpod-service.go @@ -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 diff --git a/test/tests/ide/vscode/python_ws_test.go b/test/tests/ide/vscode/python_ws_test.go index 1271aa4885f4dc..b7f07d08f7109b 100644 --- a/test/tests/ide/vscode/python_ws_test.go +++ b/test/tests/ide/vscode/python_ws_test.go @@ -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" ) @@ -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)