Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
gitpod-io
GitHub Repository: gitpod-io/gitpod
Path: blob/main/test/tests/components/ws-daemon/storage_test.go
2501 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 wsdaemon
6
7
import (
8
"context"
9
"fmt"
10
"testing"
11
"time"
12
13
"sigs.k8s.io/e2e-framework/pkg/envconf"
14
"sigs.k8s.io/e2e-framework/pkg/features"
15
16
agent "github.com/gitpod-io/gitpod/test/pkg/agent/daemon/api"
17
"github.com/gitpod-io/gitpod/test/pkg/integration"
18
)
19
20
func TestCreateBucket(t *testing.T) {
21
f := features.New("DaemonAgent.CreateBucket").
22
WithLabel("component", "ws-daemon").
23
Assess("it should create a bucket", func(testCtx context.Context, t *testing.T, cfg *envconf.Config) context.Context {
24
t.Parallel()
25
26
rsa, closer, err := integration.Instrument(integration.ComponentWorkspaceDaemon, "daemon", cfg.Namespace(), kubeconfig, cfg.Client(),
27
integration.WithWorkspacekitLift(false),
28
integration.WithContainer("ws-daemon"),
29
)
30
if err != nil {
31
t.Fatal(err)
32
}
33
integration.DeferCloser(t, closer)
34
35
var resp agent.CreateBucketResponse
36
err = rsa.Call("DaemonAgent.CreateBucket", agent.CreateBucketRequest{
37
Owner: fmt.Sprintf("integration-test-%d", time.Now().UnixNano()),
38
Workspace: "test-ws",
39
}, &resp)
40
if err != nil {
41
t.Fatalf("cannot create bucket: %q", err)
42
}
43
44
return testCtx
45
}).
46
Feature()
47
48
testEnv.Test(t, f)
49
}
50
51