@@ -18,6 +18,7 @@ package e2e
18
18
19
19
import (
20
20
"fmt"
21
+ "os"
21
22
"os/exec"
22
23
"time"
23
24
@@ -36,70 +37,79 @@ const (
36
37
37
38
var _ = Describe ("controller" , Ordered , func () {
38
39
BeforeAll (func () {
39
- By ("creating manager namespace" )
40
- cmd := exec .Command ("kubectl" , "create" , "ns" , feastControllerNamespace )
41
- _ , _ = utils .Run (cmd )
42
- var err error
43
- // projectimage stores the name of the image used in the example
44
- var projectimage = "localhost/feast-operator:v0.0.1"
45
-
46
- By ("building the manager(Operator) image" )
47
- cmd = exec .Command ("make" , "docker-build" , fmt .Sprintf ("IMG=%s" , projectimage ))
48
- _ , err = utils .Run (cmd )
49
- ExpectWithOffset (1 , err ).NotTo (HaveOccurred ())
50
-
51
- By ("loading the the manager(Operator) image on Kind" )
52
- err = utils .LoadImageToKindClusterWithName (projectimage )
53
- ExpectWithOffset (1 , err ).NotTo (HaveOccurred ())
54
-
55
- By ("building the feast image" )
56
- cmd = exec .Command ("make" , "feast-ci-dev-docker-img" )
57
- _ , err = utils .Run (cmd )
58
- ExpectWithOffset (1 , err ).NotTo (HaveOccurred ())
59
- // this image will be built in above make target.
60
- var feastImage = "feastdev/feature-server:dev"
61
- var feastLocalImage = "localhost/feastdev/feature-server:dev"
62
-
63
- By ("Tag the local feast image for the integration tests" )
64
- cmd = exec .Command ("docker" , "image" , "tag" , feastImage , feastLocalImage )
65
- _ , err = utils .Run (cmd )
66
- ExpectWithOffset (1 , err ).NotTo (HaveOccurred ())
67
-
68
- By ("loading the the feast image on Kind cluster" )
69
- err = utils .LoadImageToKindClusterWithName (feastLocalImage )
70
- ExpectWithOffset (1 , err ).NotTo (HaveOccurred ())
71
-
72
- By ("installing CRDs" )
73
- cmd = exec .Command ("make" , "install" )
74
- _ , err = utils .Run (cmd )
75
- ExpectWithOffset (1 , err ).NotTo (HaveOccurred ())
76
-
77
- By ("deploying the controller-manager" )
78
- cmd = exec .Command ("make" , "deploy" , fmt .Sprintf ("IMG=%s" , projectimage ), fmt .Sprintf ("FS_IMG=%s" , feastLocalImage ))
79
- _ , err = utils .Run (cmd )
80
- ExpectWithOffset (1 , err ).NotTo (HaveOccurred ())
81
-
82
- By ("Validating that the controller-manager deployment is in available state" )
83
- err = checkIfDeploymentExistsAndAvailable (feastControllerNamespace , controllerDeploymentName , timeout )
84
- Expect (err ).ToNot (HaveOccurred (), fmt .Sprintf (
85
- "Deployment %s is not available but expected to be available. \n Error: %v\n " ,
86
- controllerDeploymentName , err ,
87
- ))
88
- fmt .Printf ("Feast Control Manager Deployment %s is available\n " , controllerDeploymentName )
40
+ isRunOnOpenShiftCI := os .Getenv ("RUN_ON_OPENSHIFT_CI" )
41
+ if isRunOnOpenShiftCI == "" {
42
+ By ("creating manager namespace" )
43
+ cmd := exec .Command ("kubectl" , "create" , "ns" , feastControllerNamespace )
44
+ _ , _ = utils .Run (cmd )
45
+
46
+ var err error
47
+ // projectimage stores the name of the image used in the example
48
+ var projectimage = "localhost/feast-operator:v0.0.1"
49
+
50
+ By ("building the manager(Operator) image" )
51
+ cmd = exec .Command ("make" , "docker-build" , fmt .Sprintf ("IMG=%s" , projectimage ))
52
+ _ , err = utils .Run (cmd )
53
+ ExpectWithOffset (1 , err ).NotTo (HaveOccurred ())
54
+
55
+ By ("loading the the manager(Operator) image on Kind" )
56
+ err = utils .LoadImageToKindClusterWithName (projectimage )
57
+ ExpectWithOffset (1 , err ).NotTo (HaveOccurred ())
58
+
59
+ // this image will be built in above make target.
60
+ var feastImage = "feastdev/feature-server:dev"
61
+ var feastLocalImage = "localhost/feastdev/feature-server:dev"
62
+
63
+ By ("building the feast image" )
64
+ cmd = exec .Command ("make" , "feast-ci-dev-docker-img" )
65
+ _ , err = utils .Run (cmd )
66
+ ExpectWithOffset (1 , err ).NotTo (HaveOccurred ())
67
+
68
+ By ("Tag the local feast image for the integration tests" )
69
+ cmd = exec .Command ("docker" , "image" , "tag" , feastImage , feastLocalImage )
70
+ _ , err = utils .Run (cmd )
71
+ ExpectWithOffset (1 , err ).NotTo (HaveOccurred ())
72
+
73
+ By ("loading the the feast image on Kind cluster" )
74
+ err = utils .LoadImageToKindClusterWithName (feastLocalImage )
75
+ ExpectWithOffset (1 , err ).NotTo (HaveOccurred ())
76
+
77
+ By ("installing CRDs" )
78
+ cmd = exec .Command ("make" , "install" )
79
+ _ , err = utils .Run (cmd )
80
+ ExpectWithOffset (1 , err ).NotTo (HaveOccurred ())
81
+
82
+ By ("deploying the controller-manager" )
83
+ cmd = exec .Command ("make" , "deploy" , fmt .Sprintf ("IMG=%s" , projectimage ), fmt .Sprintf ("FS_IMG=%s" , feastLocalImage ))
84
+ _ , err = utils .Run (cmd )
85
+ ExpectWithOffset (1 , err ).NotTo (HaveOccurred ())
86
+
87
+ By ("Validating that the controller-manager deployment is in available state" )
88
+ err = checkIfDeploymentExistsAndAvailable (feastControllerNamespace , controllerDeploymentName , timeout )
89
+ Expect (err ).ToNot (HaveOccurred (), fmt .Sprintf (
90
+ "Deployment %s is not available but expected to be available. \n Error: %v\n " ,
91
+ controllerDeploymentName , err ,
92
+ ))
93
+ fmt .Printf ("Feast Control Manager Deployment %s is available\n " , controllerDeploymentName )
94
+ }
89
95
})
90
96
91
97
AfterAll (func () {
92
98
// Add any post clean up code here.
93
- By ("Uninstalling the feast CRD" )
94
- cmd := exec .Command ("kubectl" , "delete" , "deployment" , controllerDeploymentName , "-n" , feastControllerNamespace )
95
- _ , err := utils .Run (cmd )
96
- ExpectWithOffset (1 , err ).NotTo (HaveOccurred ())
99
+ isRunOnOpenShiftCI := os .Getenv ("RUN_ON_OPENSHIFT_CI" )
100
+ if isRunOnOpenShiftCI == "" {
101
+ By ("Uninstalling the feast CRD" )
102
+ cmd := exec .Command ("kubectl" , "delete" , "deployment" , controllerDeploymentName , "-n" , feastControllerNamespace )
103
+ _ , err := utils .Run (cmd )
104
+ ExpectWithOffset (1 , err ).NotTo (HaveOccurred ())
105
+ }
97
106
})
98
107
99
108
Context ("Operator E2E Tests" , func () {
100
109
It ("Should be able to deploy and run a default feature store CR successfully" , func () {
101
110
By ("deploying the Simple Feast Custom Resource to Kubernetes" )
102
111
namespace := "default"
112
+
103
113
cmd := exec .Command ("kubectl" , "apply" , "-f" ,
104
114
"test/testdata/feast_integration_test_crs/v1alpha1_default_featurestore.yaml" , "-n" , namespace )
105
115
_ , cmdOutputerr := utils .Run (cmd )
@@ -120,8 +130,8 @@ var _ = Describe("controller", Ordered, func() {
120
130
namespace := "default"
121
131
cmd := exec .Command ("kubectl" , "apply" , "-f" ,
122
132
"test/testdata/feast_integration_test_crs/v1alpha1_default_featurestore.yaml" , "-n" , namespace )
123
- _ , cmdOutputerr := utils .Run (cmd )
124
- ExpectWithOffset (1 , cmdOutputerr ).NotTo (HaveOccurred ())
133
+ _ , cmdOutputErr := utils .Run (cmd )
134
+ ExpectWithOffset (1 , cmdOutputErr ).NotTo (HaveOccurred ())
125
135
126
136
featureStoreName := "simple-feast-setup"
127
137
validateTheFeatureStoreCustomResource (namespace , featureStoreName , timeout )
@@ -134,8 +144,8 @@ var _ = Describe("controller", Ordered, func() {
134
144
By ("deploying the Simple Feast remote registry Custom Resource on Kubernetes" )
135
145
cmd = exec .Command ("kubectl" , "apply" , "-f" ,
136
146
"test/testdata/feast_integration_test_crs/v1alpha1_remote_registry_featurestore.yaml" , "-n" , remoteRegistryNs )
137
- _ , cmdOutputerr = utils .Run (cmd )
138
- ExpectWithOffset (1 , cmdOutputerr ).NotTo (HaveOccurred ())
147
+ _ , cmdOutputErr = utils .Run (cmd )
148
+ ExpectWithOffset (1 , cmdOutputErr ).NotTo (HaveOccurred ())
139
149
140
150
remoteFeatureStoreName := "simple-feast-remote-setup"
141
151
@@ -144,14 +154,14 @@ var _ = Describe("controller", Ordered, func() {
144
154
By ("deleting the feast remote registry deployment" )
145
155
cmd = exec .Command ("kubectl" , "delete" , "-f" ,
146
156
"test/testdata/feast_integration_test_crs/v1alpha1_remote_registry_featurestore.yaml" , "-n" , remoteRegistryNs )
147
- _ , cmdOutputerr = utils .Run (cmd )
148
- ExpectWithOffset (1 , cmdOutputerr ).NotTo (HaveOccurred ())
157
+ _ , cmdOutputErr = utils .Run (cmd )
158
+ ExpectWithOffset (1 , cmdOutputErr ).NotTo (HaveOccurred ())
149
159
150
160
By ("deleting the feast deployment" )
151
161
cmd = exec .Command ("kubectl" , "delete" , "-f" ,
152
162
"test/testdata/feast_integration_test_crs/v1alpha1_default_featurestore.yaml" , "-n" , namespace )
153
- _ , cmdOutputerr = utils .Run (cmd )
154
- ExpectWithOffset (1 , cmdOutputerr ).NotTo (HaveOccurred ())
163
+ _ , cmdOutputErr = utils .Run (cmd )
164
+ ExpectWithOffset (1 , cmdOutputErr ).NotTo (HaveOccurred ())
155
165
})
156
166
})
157
167
})
0 commit comments