Skip to content

Commit

Permalink
fix e2e tests
Browse files Browse the repository at this point in the history
Signed-off-by: Tommy Hughes <[email protected]>
  • Loading branch information
tchughesiv committed Dec 20, 2024
1 parent 953b79e commit c6a4ed9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 15 deletions.
26 changes: 16 additions & 10 deletions infra/feast-operator/test/e2e/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,12 @@ import (
"github.com/feast-dev/feast/infra/feast-operator/test/utils"
)

const feastControllerNamespace = "feast-operator-system"
const timeout = 2 * time.Minute
const controllerDeploymentName = "feast-operator-controller-manager"
const (
feastControllerNamespace = "feast-operator-system"
timeout = 2 * time.Minute
controllerDeploymentName = "feast-operator-controller-manager"
feastPrefix = "feast-"
)

var _ = Describe("controller", Ordered, func() {
BeforeAll(func() {
Expand Down Expand Up @@ -159,15 +162,18 @@ func validateTheFeatureStoreCustomResource(namespace string, featureStoreName st
"Error occurred while checking FeatureStore %s is having remote registry or not. \nError: %v\n",
featureStoreName, err))

k8ResourceNames := []string{fmt.Sprintf("feast-%s-online", featureStoreName),
fmt.Sprintf("feast-%s-offline", featureStoreName),
feastResourceName := feastPrefix + featureStoreName
k8sResourceNames := []string{feastResourceName}
feastK8sResourceNames := []string{
feastResourceName + "-online",
feastResourceName + "-offline",
}

if !hasRemoteRegistry {
k8ResourceNames = append(k8ResourceNames, fmt.Sprintf("feast-%s-registry", featureStoreName))
feastK8sResourceNames = append(feastK8sResourceNames, feastResourceName+"-registry")
}

for _, deploymentName := range k8ResourceNames {
for _, deploymentName := range k8sResourceNames {
By(fmt.Sprintf("validate the feast deployment: %s is up and in availability state.", deploymentName))
err = checkIfDeploymentExistsAndAvailable(namespace, deploymentName, timeout)
Expect(err).To(BeNil(), fmt.Sprintf(
Expand All @@ -178,15 +184,15 @@ func validateTheFeatureStoreCustomResource(namespace string, featureStoreName st
}

By("Check if the feast client - kubernetes config map exists.")
configMapName := fmt.Sprintf("feast-%s-client", featureStoreName)
configMapName := feastResourceName + "-client"
err = checkIfConfigMapExists(namespace, configMapName)
Expect(err).To(BeNil(), fmt.Sprintf(
"config map %s is not available but expected to be available. \nError: %v\n",
configMapName, err,
))
fmt.Printf("Feast Deployment client config map %s is available\n", configMapName)

for _, serviceAccountName := range k8ResourceNames {
for _, serviceAccountName := range k8sResourceNames {
By(fmt.Sprintf("validate the feast service account: %s is available.", serviceAccountName))
err = checkIfServiceAccountExists(namespace, serviceAccountName)
Expect(err).To(BeNil(), fmt.Sprintf(
Expand All @@ -196,7 +202,7 @@ func validateTheFeatureStoreCustomResource(namespace string, featureStoreName st
fmt.Printf("Service account %s exists in namespace %s\n", serviceAccountName, namespace)
}

for _, serviceName := range k8ResourceNames {
for _, serviceName := range feastK8sResourceNames {
By(fmt.Sprintf("validate the kubernetes service name: %s is available.", serviceName))
err = checkIfKubernetesServiceExists(namespace, serviceName)
Expect(err).To(BeNil(), fmt.Sprintf(
Expand Down
6 changes: 1 addition & 5 deletions infra/feast-operator/test/e2e/test_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,5 @@ func isFeatureStoreHavingRemoteRegistry(namespace, featureStoreName string) (boo
hasValidFeastRef := registryConfig.Remote.FeastRef != nil &&
registryConfig.Remote.FeastRef.Name != ""

if hasHostname || hasValidFeastRef {
return true, nil
}

return false, nil
return hasHostname || hasValidFeastRef, nil
}

0 comments on commit c6a4ed9

Please sign in to comment.