-
Notifications
You must be signed in to change notification settings - Fork 60
/
kuttl_test.go
44 lines (39 loc) · 1 KB
/
kuttl_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
//go:build e2e
// +build e2e
package e2e
import (
"context"
"os"
"testing"
"github.com/kube-green/kuttl/pkg/apis/testharness/v1beta1"
"github.com/kube-green/kuttl/pkg/test"
"github.com/stretchr/testify/require"
"sigs.k8s.io/e2e-framework/pkg/envconf"
"sigs.k8s.io/e2e-framework/pkg/features"
)
func TestSleepInfoE2E(t *testing.T) {
e2eTests := features.New("kuttl").
Assess("run e2e tests", func(ctx context.Context, t *testing.T, c *envconf.Config) context.Context {
harness := test.Harness{
TestSuite: v1beta1.TestSuite{
TestDirs: []string{"../e2e/"},
Timeout: 180,
Config: &v1beta1.RestConfig{
RC: c.Client().RESTConfig(),
},
SkipDelete: true,
SkipClusterDelete: true,
},
T: t,
}
harness.Setup()
harness.RunTests()
return ctx
}).
Teardown(func(ctx context.Context, t *testing.T, c *envconf.Config) context.Context {
err := os.Remove("kubeconfig")
require.NoError(t, err)
return ctx
}).Feature()
testenv.Test(t, e2eTests)
}