Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
gitpod-io
GitHub Repository: gitpod-io/gitpod
Path: blob/main/test/tests/components/ws-manager/wsmanager_test.go
2500 views
1
// Copyright (c) 2020 Gitpod GmbH. All rights reserved.
2
// Licensed under the GNU Affero General Public License (AGPL).
3
// See License.AGPL.txt in the project root for license information.
4
5
package wsmanager
6
7
import (
8
"context"
9
"testing"
10
"time"
11
12
"sigs.k8s.io/e2e-framework/pkg/envconf"
13
"sigs.k8s.io/e2e-framework/pkg/features"
14
15
"github.com/gitpod-io/gitpod/test/pkg/integration"
16
wsmanager_api "github.com/gitpod-io/gitpod/ws-manager/api"
17
)
18
19
func TestGetWorkspaces(t *testing.T) {
20
f := features.New("workspaces").
21
WithLabel("component", "ws-manager").
22
Assess("it should get workspaces", func(testCtx context.Context, t *testing.T, cfg *envconf.Config) context.Context {
23
t.Parallel()
24
25
ctx, cancel := context.WithTimeout(testCtx, 5*time.Minute)
26
defer cancel()
27
28
api := integration.NewComponentAPI(ctx, cfg.Namespace(), kubeconfig, cfg.Client())
29
t.Cleanup(func() {
30
api.Done(t)
31
})
32
33
wsman, err := api.WorkspaceManager()
34
if err != nil {
35
t.Fatal(err)
36
}
37
38
_, err = wsman.GetWorkspaces(ctx, &wsmanager_api.GetWorkspacesRequest{})
39
if err != nil {
40
t.Fatal(err)
41
}
42
43
return testCtx
44
}).
45
Feature()
46
47
testEnv.Test(t, f)
48
}
49
50