Skip to content

Commit 61009d6

Browse files
Srihari1192ntkathole
authored andcommitted
test: Add Feast Workbench integration connection tests
Signed-off-by: Srihari <[email protected]>
1 parent 8b642f7 commit 61009d6

File tree

11 files changed

+1068
-155
lines changed

11 files changed

+1068
-155
lines changed

infra/feast-operator/test/e2e_rhoai/feast_preupgrade_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ var _ = Describe("Feast PreUpgrade scenario Testing", Ordered, func() {
6464
ApplyFeastInfraManifestsAndVerify(namespace, testDir)
6565

6666
By("Applying and validating the credit-scoring FeatureStore CR")
67-
ApplyFeastYamlAndVerify(namespace, testDir, feastDeploymentName, feastCRName)
67+
ApplyFeastYamlAndVerify(namespace, testDir, feastDeploymentName, feastCRName, "test/testdata/feast_integration_test_crs/feast.yaml")
6868
}
6969

7070
// This context ensures the Feast CR setup is functional prior to any upgrade
Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
/*
2+
Copyright 2025 Feast Community.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
// Package e2erhoai provides end-to-end (E2E) test coverage for Feast integration with
18+
// Red Hat OpenShift AI (RHOAI) environments.
19+
// This specific test validates the functionality
20+
// of executing a Feast workbench integration connection with kubernetes auth and without auth successfully
21+
package e2erhoai
22+
23+
import (
24+
"fmt"
25+
26+
utils "github.com/feast-dev/feast/infra/feast-operator/test/utils"
27+
. "github.com/onsi/ginkgo/v2"
28+
. "github.com/onsi/gomega"
29+
)
30+
31+
var _ = Describe("Feast Workbench Integration Connection Testing", Ordered, func() {
32+
const (
33+
namespace = "test-ns-feast"
34+
configMapName = "feast-wb-cm"
35+
rolebindingName = "rb-feast-test"
36+
notebookFile = "test/e2e_rhoai/resources/feast-wb-connection-credit-scoring.ipynb"
37+
pvcFile = "test/e2e_rhoai/resources/pvc.yaml"
38+
permissionFile = "test/e2e_rhoai/resources/permissions.py"
39+
notebookPVC = "jupyterhub-nb-kube-3aadmin-pvc"
40+
testDir = "/test/e2e_rhoai"
41+
notebookName = "feast-wb-connection-credit-scoring.ipynb"
42+
feastDeploymentName = utils.FeastPrefix + "credit-scoring"
43+
feastCRName = "credit-scoring"
44+
)
45+
46+
// Create and monitor notebook
47+
createAndMonitorNotebook := func() {
48+
nbParams := utils.GetNotebookParams(namespace, configMapName, notebookPVC, notebookName, testDir)
49+
By("Creating Jupyter Notebook")
50+
Expect(utils.CreateNotebook(nbParams)).To(Succeed(), "Failed to create notebook")
51+
52+
By("Monitoring notebook logs")
53+
Expect(utils.MonitorNotebookPod(namespace, "jupyter-nb-", notebookName)).To(Succeed(), "Notebook execution failed")
54+
}
55+
56+
// Parameterized test function that handles both auth and non-auth scenarios
57+
runFeastWorkbenchIntegration := func(authEnabled bool) {
58+
// Apply permissions only if auth is enabled
59+
if authEnabled {
60+
By("Applying Feast permissions for kubernetes authenticated scenario")
61+
utils.ApplyFeastPermissions(permissionFile, "/feast-data/credit_scoring_local/feature_repo/permissions.py", namespace, feastDeploymentName)
62+
}
63+
64+
By(fmt.Sprintf("Setting namespace context to : %s", namespace))
65+
Expect(utils.SetNamespaceContext(namespace, testDir)).To(Succeed())
66+
fmt.Printf("Successfully set namespace context to: %s\n", namespace)
67+
68+
By(fmt.Sprintf("Creating Config map: %s", configMapName))
69+
Expect(utils.CreateNotebookConfigMap(namespace, configMapName, notebookFile, "test/e2e_rhoai/resources/feature_repo", testDir)).To(Succeed())
70+
fmt.Printf("ConfigMap %s created successfully\n", configMapName)
71+
72+
By(fmt.Sprintf("Creating Persistent volume claim: %s", notebookPVC))
73+
Expect(utils.CreateNotebookPVC(pvcFile, testDir)).To(Succeed())
74+
fmt.Printf("Persistent Volume Claim %s created successfully\n", notebookPVC)
75+
76+
By(fmt.Sprintf("Creating rolebinding %s for the user", rolebindingName))
77+
Expect(utils.CreateNotebookRoleBinding(namespace, rolebindingName, utils.GetOCUser(testDir), testDir)).To(Succeed())
78+
fmt.Printf("Created rolebinding %s successfully\n", rolebindingName)
79+
80+
// Create and monitor notebook for execution status
81+
createAndMonitorNotebook()
82+
}
83+
84+
BeforeAll(func() {
85+
By(fmt.Sprintf("Creating test namespace: %s", namespace))
86+
Expect(utils.CreateNamespace(namespace, testDir)).To(Succeed())
87+
fmt.Printf("Namespace %s created successfully\n", namespace)
88+
89+
By("Applying Feast infra manifests and verifying setup")
90+
utils.ApplyFeastInfraManifestsAndVerify(namespace, testDir)
91+
})
92+
93+
AfterAll(func() {
94+
By(fmt.Sprintf("Deleting test namespace: %s", namespace))
95+
Expect(utils.DeleteNamespace(namespace, testDir)).To(Succeed())
96+
fmt.Printf("Namespace %s deleted successfully\n", namespace)
97+
})
98+
99+
Context("Feast Workbench Integration Tests - Without Auth", func() {
100+
BeforeEach(func() {
101+
By("Applying and validating the credit-scoring FeatureStore CR without auth")
102+
utils.ApplyFeastYamlAndVerify(namespace, testDir, feastDeploymentName, feastCRName, "test/testdata/feast_integration_test_crs/feast.yaml")
103+
104+
By("Verify Feature Store CR is in Ready state")
105+
utils.ValidateFeatureStoreCRStatus(namespace, feastCRName)
106+
107+
By("Running `feast apply` and `feast materialize-incremental` to validate registry definitions")
108+
utils.VerifyApplyFeatureStoreDefinitions(namespace, feastCRName, feastDeploymentName)
109+
})
110+
111+
It("Should create and run a FeastWorkbenchIntegrationWithoutAuth scenario successfully", func() {
112+
runFeastWorkbenchIntegration(false)
113+
})
114+
})
115+
116+
Context("Feast Workbench Integration Tests - With Auth", func() {
117+
BeforeEach(func() {
118+
By("Applying and validating the credit-scoring FeatureStore CR (with auth)")
119+
utils.ApplyFeastYamlAndVerify(namespace, testDir, feastDeploymentName, feastCRName, "test/e2e_rhoai/resources/feast_kube_auth.yaml")
120+
121+
By("Verify Feature Store CR is in Ready state")
122+
utils.ValidateFeatureStoreCRStatus(namespace, feastCRName)
123+
124+
By("Running `feast apply` and `feast materialize-incremental` to validate registry definitions")
125+
utils.VerifyApplyFeatureStoreDefinitions(namespace, feastCRName, feastDeploymentName)
126+
})
127+
128+
It("Should create and run a FeastWorkbenchIntegrationWithAuth scenario successfully", func() {
129+
runFeastWorkbenchIntegration(true)
130+
})
131+
})
132+
})
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
/*
2+
Copyright 2025 Feast Community.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
// Package e2erhoai provides end-to-end (E2E) test coverage for Feast integration with
18+
// Red Hat OpenShift AI (RHOAI) environments. This specific test validates the functionality
19+
// of executing a Feast Jupyter notebook within a fully configured OpenShift namespace
20+
package e2erhoai
21+
22+
import (
23+
"fmt"
24+
25+
utils "github.com/feast-dev/feast/infra/feast-operator/test/utils"
26+
. "github.com/onsi/ginkgo/v2"
27+
. "github.com/onsi/gomega"
28+
)
29+
30+
var _ = Describe("Feast Jupyter Notebook Testing", Ordered, func() {
31+
const (
32+
namespace = "test-ns-feast-wb"
33+
configMapName = "feast-wb-cm"
34+
rolebindingName = "rb-feast-test"
35+
notebookFile = "test/e2e_rhoai/resources/feast-test.ipynb"
36+
pvcFile = "test/e2e_rhoai/resources/pvc.yaml"
37+
notebookPVC = "jupyterhub-nb-kube-3aadmin-pvc"
38+
testDir = "/test/e2e_rhoai"
39+
notebookName = "feast-test.ipynb"
40+
feastMilvusTest = "TestFeastMilvusNotebook"
41+
)
42+
43+
BeforeAll(func() {
44+
By(fmt.Sprintf("Creating test namespace: %s", namespace))
45+
Expect(utils.CreateNamespace(namespace, testDir)).To(Succeed())
46+
fmt.Printf("Namespace %s created successfully\n", namespace)
47+
})
48+
49+
AfterAll(func() {
50+
By(fmt.Sprintf("Deleting test namespace: %s", namespace))
51+
Expect(utils.DeleteNamespace(namespace, testDir)).To(Succeed())
52+
fmt.Printf("Namespace %s deleted successfully\n", namespace)
53+
})
54+
55+
runNotebookTest := func() {
56+
// Execute common setup steps
57+
By(fmt.Sprintf("Setting namespace context to : %s", namespace))
58+
Expect(utils.SetNamespaceContext(namespace, testDir)).To(Succeed())
59+
fmt.Printf("Successfully set namespace context to: %s\n", namespace)
60+
61+
By(fmt.Sprintf("Creating Config map: %s", configMapName))
62+
Expect(utils.CreateNotebookConfigMap(namespace, configMapName, notebookFile, "test/e2e_rhoai/resources/feature_repo", testDir)).To(Succeed())
63+
fmt.Printf("ConfigMap %s created successfully\n", configMapName)
64+
65+
By(fmt.Sprintf("Creating Persistent volume claim: %s", notebookPVC))
66+
Expect(utils.CreateNotebookPVC(pvcFile, testDir)).To(Succeed())
67+
fmt.Printf("Persistent Volume Claim %s created successfully\n", notebookPVC)
68+
69+
By(fmt.Sprintf("Creating rolebinding %s for the user", rolebindingName))
70+
Expect(utils.CreateNotebookRoleBinding(namespace, rolebindingName, utils.GetOCUser(testDir), testDir)).To(Succeed())
71+
fmt.Printf("Created rolebinding %s successfully\n", rolebindingName)
72+
73+
// Build notebook parameters and create notebook
74+
nbParams := utils.GetNotebookParams(namespace, configMapName, notebookPVC, notebookName, testDir)
75+
By("Creating Jupyter Notebook")
76+
Expect(utils.CreateNotebook(nbParams)).To(Succeed(), "Failed to create notebook")
77+
78+
By("Monitoring notebook logs")
79+
Expect(utils.MonitorNotebookPod(namespace, "jupyter-nb-", notebookName)).To(Succeed(), "Notebook execution failed")
80+
}
81+
82+
Context("Feast Jupyter Notebook Test", func() {
83+
It("Should create and run a "+feastMilvusTest+" successfully", runNotebookTest)
84+
})
85+
})

infra/feast-operator/test/e2e_rhoai/feast_wb_test.go

Lines changed: 0 additions & 151 deletions
This file was deleted.

infra/feast-operator/test/e2e_rhoai/resources/custom-nb.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ spec:
5656
value: {{.FeastVerison}}
5757
- name: OPENAI_API_KEY
5858
value: {{.OpenAIAPIKey}}
59+
- name: NAMESPACE
60+
value: {{.Namespace}}
5961
image: {{.NotebookImage}}
6062
command: {{.Command}}
6163
imagePullPolicy: Always

0 commit comments

Comments
 (0)