Skip to content

Commit 7691bfd

Browse files
committed
run only cloud registries in cloud it tests
Signed-off-by: tokoko <togurg14@freeuni.edu.ge>
1 parent 325e71f commit 7691bfd

File tree

3 files changed

+28
-211
lines changed

3 files changed

+28
-211
lines changed

Makefile

+2-4
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,8 @@ test-python-integration-local:
8686
@(docker info > /dev/null 2>&1 && \
8787
FEAST_IS_LOCAL_TEST=True \
8888
FEAST_LOCAL_ONLINE_CONTAINER=True \
89-
python -m pytest -n 8 --color=yes --integration \
90-
-k "not gcs_registry and \
91-
not s3_registry and \
92-
not test_lambda_materialization and \
89+
python -m pytest -n 8 --durations=5 --color=yes --integration \
90+
-k "not test_lambda_materialization and \
9391
not test_snowflake_materialization" \
9492
sdk/python/tests \
9593
) || echo "This script uses Docker, and it isn't running - please start the Docker Daemon and try again!";

sdk/python/tests/integration/registration/test_feature_store.py

-157
Original file line numberDiff line numberDiff line change
@@ -33,46 +33,6 @@
3333
from tests.utils.data_source_test_creator import prep_file_source
3434

3535

36-
@pytest.mark.integration
37-
@pytest.mark.parametrize(
38-
"test_feature_store",
39-
[
40-
lazy_fixture("feature_store_with_gcs_registry"),
41-
lazy_fixture("feature_store_with_s3_registry"),
42-
],
43-
)
44-
def test_apply_entity_integration(test_feature_store):
45-
entity = Entity(
46-
name="driver_car_id",
47-
description="Car driver id",
48-
tags={"team": "matchmaking"},
49-
)
50-
51-
# Register Entity
52-
test_feature_store.apply([entity])
53-
54-
entities = test_feature_store.list_entities()
55-
56-
entity = entities[0]
57-
assert (
58-
len(entities) == 1
59-
and entity.name == "driver_car_id"
60-
and entity.description == "Car driver id"
61-
and "team" in entity.tags
62-
and entity.tags["team"] == "matchmaking"
63-
)
64-
65-
entity = test_feature_store.get_entity("driver_car_id")
66-
assert (
67-
entity.name == "driver_car_id"
68-
and entity.description == "Car driver id"
69-
and "team" in entity.tags
70-
and entity.tags["team"] == "matchmaking"
71-
)
72-
73-
test_feature_store.teardown()
74-
75-
7636
@pytest.mark.integration
7737
@pytest.mark.parametrize(
7838
"test_feature_store",
@@ -108,82 +68,6 @@ def test_feature_view_inference_success(test_feature_store, dataframe_source):
10868

10969
test_feature_store.teardown()
11070

111-
112-
@pytest.mark.integration
113-
@pytest.mark.parametrize(
114-
"test_feature_store",
115-
[
116-
lazy_fixture("feature_store_with_gcs_registry"),
117-
lazy_fixture("feature_store_with_s3_registry"),
118-
],
119-
)
120-
def test_apply_feature_view_integration(test_feature_store):
121-
# Create Feature Views
122-
batch_source = FileSource(
123-
file_format=ParquetFormat(),
124-
path="file://feast/*",
125-
timestamp_field="ts_col",
126-
created_timestamp_column="timestamp",
127-
)
128-
129-
entity = Entity(name="fs1_my_entity_1", join_keys=["test"])
130-
131-
fv1 = FeatureView(
132-
name="my_feature_view_1",
133-
schema=[
134-
Field(name="fs1_my_feature_1", dtype=Int64),
135-
Field(name="fs1_my_feature_2", dtype=String),
136-
Field(name="fs1_my_feature_3", dtype=Array(String)),
137-
Field(name="fs1_my_feature_4", dtype=Array(Bytes)),
138-
Field(name="test", dtype=Int64),
139-
],
140-
entities=[entity],
141-
tags={"team": "matchmaking"},
142-
source=batch_source,
143-
ttl=timedelta(minutes=5),
144-
)
145-
146-
# Register Feature View
147-
test_feature_store.apply([fv1, entity])
148-
149-
feature_views = test_feature_store.list_feature_views()
150-
151-
# List Feature Views
152-
assert (
153-
len(feature_views) == 1
154-
and feature_views[0].name == "my_feature_view_1"
155-
and feature_views[0].features[0].name == "fs1_my_feature_1"
156-
and feature_views[0].features[0].dtype == Int64
157-
and feature_views[0].features[1].name == "fs1_my_feature_2"
158-
and feature_views[0].features[1].dtype == String
159-
and feature_views[0].features[2].name == "fs1_my_feature_3"
160-
and feature_views[0].features[2].dtype == Array(String)
161-
and feature_views[0].features[3].name == "fs1_my_feature_4"
162-
and feature_views[0].features[3].dtype == Array(Bytes)
163-
and feature_views[0].entities[0] == "fs1_my_entity_1"
164-
)
165-
166-
feature_view = test_feature_store.get_feature_view("my_feature_view_1")
167-
assert (
168-
feature_view.name == "my_feature_view_1"
169-
and feature_view.features[0].name == "fs1_my_feature_1"
170-
and feature_view.features[0].dtype == Int64
171-
and feature_view.features[1].name == "fs1_my_feature_2"
172-
and feature_view.features[1].dtype == String
173-
and feature_view.features[2].name == "fs1_my_feature_3"
174-
and feature_view.features[2].dtype == Array(String)
175-
and feature_view.features[3].name == "fs1_my_feature_4"
176-
and feature_view.features[3].dtype == Array(Bytes)
177-
and feature_view.entities[0] == "fs1_my_entity_1"
178-
)
179-
180-
test_feature_store.delete_feature_view("my_feature_view_1")
181-
feature_views = test_feature_store.list_feature_views()
182-
assert len(feature_views) == 0
183-
184-
test_feature_store.teardown()
185-
186-
18771
@pytest.fixture
18872
def feature_store_with_local_registry():
18973
fd, registry_path = mkstemp()
@@ -199,44 +83,3 @@ def feature_store_with_local_registry():
19983
)
20084

20185

202-
@pytest.fixture
203-
def feature_store_with_gcs_registry():
204-
from google.cloud import storage
205-
206-
storage_client = storage.Client()
207-
bucket_name = f"feast-registry-test-{int(time.time() * 1000)}"
208-
bucket = storage_client.bucket(bucket_name)
209-
bucket = storage_client.create_bucket(bucket)
210-
bucket.add_lifecycle_delete_rule(
211-
age=14
212-
) # delete buckets automatically after 14 days
213-
bucket.patch()
214-
bucket.blob("registry.db")
215-
216-
return FeatureStore(
217-
config=RepoConfig(
218-
registry=f"gs://{bucket_name}/registry.db",
219-
project="default",
220-
provider="gcp",
221-
entity_key_serialization_version=2,
222-
)
223-
)
224-
225-
226-
@pytest.fixture
227-
def feature_store_with_s3_registry():
228-
aws_registry_path = os.getenv(
229-
"AWS_REGISTRY_PATH", "s3://feast-int-bucket/registries"
230-
)
231-
return FeatureStore(
232-
config=RepoConfig(
233-
registry=f"{aws_registry_path}/{int(time.time() * 1000)}/registry.db",
234-
project="default",
235-
provider="aws",
236-
online_store=DynamoDBOnlineStoreConfig(
237-
region=os.getenv("AWS_REGION", "us-west-2")
238-
),
239-
offline_store=FileOfflineStoreConfig(),
240-
entity_key_serialization_version=2,
241-
)
242-
)

sdk/python/tests/integration/registration/test_universal_registry.py

+26-50
Original file line numberDiff line numberDiff line change
@@ -232,20 +232,32 @@ def mock_remote_registry():
232232
registry.stub = RegistryServer_pb2_grpc.RegistryServerStub(mock_channel)
233233
yield registry
234234

235+
if os.getenv("FEAST_IS_LOCAL_TEST", "False") == "False":
236+
all_fixtures=[
237+
"s3_registry",
238+
"gcs_registry"
239+
]
240+
else:
241+
all_fixtures = [
242+
"local_registry",
243+
"minio_registry",
244+
"pg_registry",
245+
"mysql_registry",
246+
"sqlite_registry",
247+
"mock_remote_registry"
248+
]
249+
250+
251+
# sql_fixtures = [
252+
# "pg_registry",
253+
# "mysql_registry",
254+
# "sqlite_registry",
255+
# ]
235256

236257
@pytest.mark.integration
237258
@pytest.mark.parametrize(
238259
"test_registry",
239-
[
240-
lazy_fixture("local_registry"),
241-
lazy_fixture("gcs_registry"),
242-
lazy_fixture("s3_registry"),
243-
lazy_fixture("minio_registry"),
244-
lazy_fixture("pg_registry"),
245-
lazy_fixture("mysql_registry"),
246-
lazy_fixture("sqlite_registry"),
247-
lazy_fixture("mock_remote_registry"),
248-
],
260+
[lazy_fixture(f) for f in all_fixtures]
249261
)
250262
def test_apply_entity_success(test_registry):
251263
entity = Entity(
@@ -305,16 +317,7 @@ def assert_project_uuid(project, project_uuid, test_registry):
305317
@pytest.mark.integration
306318
@pytest.mark.parametrize(
307319
"test_registry",
308-
[
309-
lazy_fixture("local_registry"),
310-
lazy_fixture("gcs_registry"),
311-
lazy_fixture("s3_registry"),
312-
lazy_fixture("minio_registry"),
313-
lazy_fixture("pg_registry"),
314-
lazy_fixture("mysql_registry"),
315-
lazy_fixture("sqlite_registry"),
316-
lazy_fixture("mock_remote_registry"),
317-
],
320+
[lazy_fixture(f) for f in all_fixtures],
318321
)
319322
def test_apply_feature_view_success(test_registry):
320323
# Create Feature Views
@@ -492,16 +495,7 @@ def location_features_from_push(inputs: pd.DataFrame) -> pd.DataFrame:
492495
@pytest.mark.integration
493496
@pytest.mark.parametrize(
494497
"test_registry",
495-
[
496-
lazy_fixture("local_registry"),
497-
lazy_fixture("gcs_registry"),
498-
lazy_fixture("s3_registry"),
499-
lazy_fixture("minio_registry"),
500-
lazy_fixture("pg_registry"),
501-
lazy_fixture("mysql_registry"),
502-
lazy_fixture("sqlite_registry"),
503-
lazy_fixture("mock_remote_registry"),
504-
],
498+
[lazy_fixture(f) for f in all_fixtures],
505499
)
506500
def test_apply_data_source(test_registry):
507501
# Create Feature Views
@@ -564,16 +558,7 @@ def test_apply_data_source(test_registry):
564558
@pytest.mark.integration
565559
@pytest.mark.parametrize(
566560
"test_registry",
567-
[
568-
lazy_fixture("local_registry"),
569-
lazy_fixture("gcs_registry"),
570-
lazy_fixture("s3_registry"),
571-
lazy_fixture("minio_registry"),
572-
lazy_fixture("pg_registry"),
573-
lazy_fixture("mysql_registry"),
574-
lazy_fixture("sqlite_registry"),
575-
lazy_fixture("mock_remote_registry"),
576-
],
561+
[lazy_fixture(f) for f in all_fixtures],
577562
)
578563
def test_modify_feature_views_success(test_registry):
579564
# Create Feature Views
@@ -809,16 +794,7 @@ def test_registry_cache(test_registry):
809794
@pytest.mark.integration
810795
@pytest.mark.parametrize(
811796
"test_registry",
812-
[
813-
lazy_fixture("local_registry"),
814-
lazy_fixture("gcs_registry"),
815-
lazy_fixture("s3_registry"),
816-
lazy_fixture("minio_registry"),
817-
lazy_fixture("pg_registry"),
818-
lazy_fixture("mysql_registry"),
819-
lazy_fixture("sqlite_registry"),
820-
lazy_fixture("mock_remote_registry"),
821-
],
797+
[lazy_fixture(f) for f in all_fixtures],
822798
)
823799
def test_apply_stream_feature_view_success(test_registry):
824800
# Create Feature Views

0 commit comments

Comments
 (0)