@@ -2,17 +2,15 @@ package e2e
2
2
3
3
import (
4
4
"context"
5
+ "os"
5
6
"testing"
6
- "time"
7
7
8
- . "github.com/onsi/ginkgo/v2"
9
- . "github.com/onsi/gomega"
10
8
appsv1 "k8s.io/api/apps/v1"
11
9
corev1 "k8s.io/api/core/v1"
12
- "k8s.io/utils/env"
13
10
14
11
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
15
12
"k8s.io/apimachinery/pkg/runtime"
13
+ utilruntime "k8s.io/apimachinery/pkg/util/runtime"
16
14
"k8s.io/client-go/rest"
17
15
ctrl "sigs.k8s.io/controller-runtime"
18
16
"sigs.k8s.io/controller-runtime/pkg/client"
@@ -33,41 +31,23 @@ const (
33
31
testCatalogName = "test-catalog"
34
32
)
35
33
36
- func TestE2E (t * testing.T ) {
37
- RegisterFailHandler (Fail )
38
- SetDefaultEventuallyTimeout (1 * time .Minute )
39
- SetDefaultEventuallyPollingInterval (1 * time .Second )
40
- RunSpecs (t , "E2E Suite" )
41
- }
42
-
43
- var _ = BeforeSuite (func () {
34
+ func TestMain (m * testing.M ) {
44
35
cfg = ctrl .GetConfigOrDie ()
45
36
46
37
scheme := runtime .NewScheme ()
47
38
48
- Expect (operatorv1alpha1 .AddToScheme (scheme )).To (Succeed ())
49
- Expect (rukpakv1alpha1 .AddToScheme (scheme )).To (Succeed ())
50
- Expect (catalogd .AddToScheme (scheme )).To (Succeed ())
39
+ utilruntime .Must (operatorv1alpha1 .AddToScheme (scheme ))
40
+ utilruntime .Must (rukpakv1alpha1 .AddToScheme (scheme ))
41
+ utilruntime .Must (catalogd .AddToScheme (scheme ))
42
+ utilruntime .Must (appsv1 .AddToScheme (scheme ))
43
+ utilruntime .Must (corev1 .AddToScheme (scheme ))
51
44
52
45
var err error
53
-
54
- err = appsv1 .AddToScheme (scheme )
55
- Expect (err ).ToNot (HaveOccurred ())
56
-
57
- err = corev1 .AddToScheme (scheme )
58
- Expect (err ).ToNot (HaveOccurred ())
59
-
60
46
c , err = client .New (cfg , client.Options {Scheme : scheme })
61
- Expect (err ).To (Not (HaveOccurred ()))
62
- })
47
+ utilruntime .Must (err )
63
48
64
- var _ = AfterSuite (func () {
65
- ctx := context .Background ()
66
- if basePath := env .GetString ("ARTIFACT_PATH" , "" ); basePath != "" {
67
- // get all the artifacts from the test run and save them to the artifact path
68
- getArtifactsOutput (ctx , basePath )
69
- }
70
- })
49
+ os .Exit (m .Run ())
50
+ }
71
51
72
52
// createTestCatalog will create a new catalog on the test cluster, provided
73
53
// the context, catalog name, and the image reference. It returns the created catalog
0 commit comments