Skip to content

Commit 1858daf

Browse files
Srihari1192ntkathole
authored andcommitted
Update Feast Registry Rest Tests run on Openshift Env
Signed-off-by: Srihari <svenkata@redhat.com>
1 parent 4d08ddc commit 1858daf

File tree

2 files changed

+38
-61
lines changed

2 files changed

+38
-61
lines changed

.github/workflows/registry-rest-api-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ jobs:
149149
- name: Setup and Run Registry Rest API tests
150150
run: |
151151
echo "Running Registry REST API tests..."
152-
uv run pytest -c sdk/python/pytest.ini sdk/python/tests/integration/rest_api/test_registry_rest_api.py --integration -s
152+
uv run pytest -c sdk/python/pytest.ini sdk/python/tests/integration/rest_api/test_registry_rest_api.py --integration -s --timeout=600
153153
154154
- name: Clean up docker images
155155
if: always()

sdk/python/tests/integration/rest_api/conftest.py

Lines changed: 37 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
deploy_and_validate_pod,
1616
execPodCommand,
1717
get_pod_name_by_prefix,
18-
run_kubectl_apply_with_sed,
1918
run_kubectl_command,
2019
validate_feature_store_cr_status,
2120
)
@@ -90,38 +89,42 @@ def feast_rest_client():
9089
namespace = "test-ns-feast-rest"
9190
credit_scoring = "credit-scoring"
9291
driver_ranking = "driver-ranking"
93-
service_name = "feast-test-s3-registry-rest"
92+
# Registry REST service name created by the operator for credit-scoring (kind and OpenShift)
93+
registry_rest_service = "feast-credit-scoring-registry-rest"
9494
run_on_openshift = os.getenv("RUN_ON_OPENSHIFT_CI", "false").lower() == "true"
9595

9696
# Create test namespace
9797
create_namespace(api_instance, namespace)
9898

9999
try:
100-
if not run_on_openshift:
101-
# Deploy dependencies
102-
deploy_and_validate_pod(
103-
namespace, str(resource_dir / "redis.yaml"), "app=redis"
104-
)
105-
deploy_and_validate_pod(
106-
namespace, str(resource_dir / "postgres.yaml"), "app=postgres"
107-
)
108-
109-
# Create and validate FeatureStore CRs
110-
create_feast_project(
111-
str(resource_dir / "feast_config_credit_scoring.yaml"),
112-
namespace,
113-
credit_scoring,
114-
)
115-
validate_feature_store_cr_status(namespace, credit_scoring)
116-
117-
create_feast_project(
118-
str(resource_dir / "feast_config_driver_ranking.yaml"),
119-
namespace,
120-
driver_ranking,
121-
)
122-
validate_feature_store_cr_status(namespace, driver_ranking)
123-
124-
# Deploy ingress and get route URL
100+
# Deploy dependencies (same for kind and OpenShift)
101+
deploy_and_validate_pod(
102+
namespace, str(resource_dir / "redis.yaml"), "app=redis"
103+
)
104+
deploy_and_validate_pod(
105+
namespace, str(resource_dir / "postgres.yaml"), "app=postgres"
106+
)
107+
108+
# Create and validate FeatureStore CRs (SQL registry, same as kind)
109+
create_feast_project(
110+
str(resource_dir / "feast_config_credit_scoring.yaml"),
111+
namespace,
112+
credit_scoring,
113+
)
114+
validate_feature_store_cr_status(namespace, credit_scoring)
115+
116+
create_feast_project(
117+
str(resource_dir / "feast_config_driver_ranking.yaml"),
118+
namespace,
119+
driver_ranking,
120+
)
121+
validate_feature_store_cr_status(namespace, driver_ranking)
122+
123+
if run_on_openshift:
124+
# OpenShift: expose registry REST via route (no nginx ingress)
125+
route_url = create_route(namespace, credit_scoring, registry_rest_service)
126+
else:
127+
# Kind: deploy nginx ingress and get route URL
125128
run_kubectl_command(
126129
[
127130
"apply",
@@ -144,40 +147,14 @@ def feast_rest_client():
144147
)
145148
route_url = f"http://{ingress_host}"
146149

147-
# Apply feast projects
150+
# Apply feast projects
151+
applyFeastProject(namespace, credit_scoring)
152+
applyFeastProject(namespace, driver_ranking)
148153

149-
applyFeastProject(namespace, credit_scoring)
150-
151-
applyFeastProject(namespace, driver_ranking)
152-
153-
# Create Saved Datasets and Permissions
154-
pod_name = get_pod_name_by_prefix(namespace, credit_scoring)
155-
156-
# Apply datasets
157-
execPodCommand(
158-
namespace, pod_name, ["python", "create_ui_visible_datasets.py"]
159-
)
160-
161-
# Apply permissions
162-
execPodCommand(namespace, pod_name, ["python", "permissions_apply.py"])
163-
164-
else:
165-
# OpenShift cluster setup using S3-based registry
166-
aws_access_key = os.getenv("AWS_ACCESS_KEY")
167-
aws_secret_key = os.getenv("AWS_SECRET_KEY")
168-
aws_bucket = os.getenv("AWS_BUCKET_NAME")
169-
registry_path = os.getenv("AWS_REGISTRY_FILE_PATH")
170-
171-
run_kubectl_apply_with_sed(
172-
aws_access_key,
173-
aws_secret_key,
174-
aws_bucket,
175-
registry_path,
176-
str(resource_dir / "feast_config_rhoai.yaml"),
177-
namespace,
178-
)
179-
validate_feature_store_cr_status(namespace, "test-s3")
180-
route_url = create_route(namespace, credit_scoring, service_name)
154+
# Create Saved Datasets and Permissions
155+
pod_name = get_pod_name_by_prefix(namespace, credit_scoring)
156+
execPodCommand(namespace, pod_name, ["python", "create_ui_visible_datasets.py"])
157+
execPodCommand(namespace, pod_name, ["python", "permissions_apply.py"])
181158
if not route_url:
182159
raise RuntimeError("Route URL could not be fetched.")
183160

0 commit comments

Comments
 (0)