Skip to content
Merged
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
15 changes: 13 additions & 2 deletions test/tests/components/ws-manager/dotfiles_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,14 @@ func TestDotfiles(t *testing.T) {
t.Fatal(err)
}

// Scopes should larger than https://github.com/gitpod-io/gitpod/blob/main/components/supervisor/pkg/serverapi/publicapi.go#L99-L109
tokenId, err := api.CreateOAuth2Token(username, []string{
"function:getToken",
"function:openPort",
"function:getOpenPorts",
"function:guessGitTokenScopes",
"function:getWorkspace",
"function:sendHeartBeat",
"function:trackEvent",
"resource:token::*::get",
})
Expand All @@ -70,8 +72,8 @@ func TestDotfiles(t *testing.T) {
"token": "%v",
"kind": "gitpod",
"host": "%v",
"scope": ["function:getToken", "function:openPort", "function:getOpenPorts", "function:guessGitTokenScopes", "function:getWorkspace", "function:trackEvent", "resource:token::*::get"],
"expiryDate": "2022-10-26T10:38:05.232Z",
"scope": ["function:getToken", "function:openPort", "function:sendHeartBeat", "function:getOpenPorts", "function:guessGitTokenScopes", "function:getWorkspace", "function:trackEvent", "resource:token::*::get"],
"expiryDate": "2026-10-26T10:38:05.232Z",
"reuse": 4
}]`, tokenId, getHostUrl(ctx, t, cfg.Client(), cfg.Namespace())),
},
Expand Down Expand Up @@ -174,6 +176,15 @@ func assertDotfiles(t *testing.T, rsa *integration.RpcClient) error {
}

if len(dotfiles) > 0 {
var cat agent.ExecResponse
err := rsa.Call("WorkspaceAgent.Exec", &agent.ExecRequest{
Dir: "/",
Command: "cat",
Args: []string{"/home/gitpod/.dotfiles.log"},
}, &cat)
if err == nil {
t.Fatalf("dotfiles were not installed successfully: %+v, .dotfiles.log: %s", dotfiles, cat.Stdout)
}
t.Fatalf("dotfiles were not installed successfully: %+v", dotfiles)
}

Expand Down
Loading