Skip to content

Commit 4529733

Browse files
committed
Static config
Signed-off-by: Achal Shah <achals@gmail.com>
1 parent edfea8b commit 4529733

1 file changed

Lines changed: 26 additions & 35 deletions

File tree

‎sdk/python/tests/integration/feature_repos/test_repo_configuration.py‎

Lines changed: 26 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,37 @@ class TestRepoConfig:
3636
infer_event_timestamp_col: bool = True
3737

3838

39+
def ds_creator_path(cls: str):
40+
return f"tests.integration.feature_repos.universal.data_sources.{cls}"
41+
42+
43+
DYNAMO_CONFIG = {"type": "dynamodb", "region": "us-west-2"}
44+
REDIS_CONFIG = {"type": "redis", "connection_string": "localhost:6379,db=0"}
3945
FULL_REPO_CONFIGS: List[TestRepoConfig] = [
40-
TestRepoConfig(), # Local
46+
# Local configurations
47+
TestRepoConfig(),
48+
TestRepoConfig(online_store=REDIS_CONFIG),
49+
# GCP configurations
4150
TestRepoConfig(
4251
provider="gcp",
43-
offline_store_creator="tests.integration.feature_repos.universal.data_sources.bigquery.BigQueryDataSourceCreator",
52+
offline_store_creator=ds_creator_path("bigquery.BigQueryDataSourceCreator"),
4453
online_store="datastore",
4554
),
55+
TestRepoConfig(
56+
provider="gcp",
57+
offline_store_creator=ds_creator_path("bigquery.BigQueryDataSourceCreator"),
58+
online_store=REDIS_CONFIG,
59+
),
60+
# AWS configurations
4661
TestRepoConfig(
4762
provider="aws",
48-
offline_store_creator="tests.integration.feature_repos.universal.data_sources.redshift.RedshiftDataSourceCreator",
49-
online_store={"type": "dynamodb", "region": "us-west-2"},
63+
offline_store_creator=ds_creator_path("redshift.RedshiftDataSourceCreator"),
64+
online_store=DYNAMO_CONFIG,
65+
),
66+
TestRepoConfig(
67+
provider="aws",
68+
offline_store_creator=ds_creator_path("redshift.RedshiftDataSourceCreator"),
69+
online_store=REDIS_CONFIG,
5070
),
5171
]
5272

@@ -158,32 +178,6 @@ def vary_infer_event_timestamp_col(
158178
return new_configs
159179

160180

161-
def vary_redis_online_store(configs: List[TestRepoConfig],) -> List[TestRepoConfig]:
162-
new_configs = []
163-
redis_config = {"type": "redis", "connection_string": "localhost:6379,db=0"}
164-
for c in configs:
165-
if (
166-
"FileDataSourceCreator" in c.offline_store_creator
167-
and "sqlite" in c.online_store
168-
):
169-
new_configs.append(c)
170-
new_configs.append(replace(c, online_store=redis_config))
171-
elif (
172-
"RedshiftDataSourceCreator" in c.offline_store_creator
173-
and isinstance(c.online_store, Dict)
174-
and c.online_store["type"] == "dynamodb"
175-
):
176-
new_configs.append(c)
177-
new_configs.append(replace(c, online_store=redis_config))
178-
elif (
179-
"BigQueryDataSourceCreator" in c.offline_store_creator
180-
and c.online_store == "datastore"
181-
):
182-
new_configs.append(c)
183-
new_configs.append(replace(c, online_store=redis_config))
184-
return new_configs
185-
186-
187181
def vary_providers_for_offline_stores(
188182
configs: List[TestRepoConfig],
189183
) -> List[TestRepoConfig]:
@@ -282,9 +276,7 @@ def parametrize_e2e_test(e2e_test):
282276
"""
283277

284278
@pytest.mark.integration
285-
@pytest.mark.parametrize(
286-
"config", vary_redis_online_store(FULL_REPO_CONFIGS), ids=lambda v: str(v)
287-
)
279+
@pytest.mark.parametrize("config", FULL_REPO_CONFIGS, ids=lambda v: str(v))
288280
def inner_test(config):
289281
with construct_test_environment(config) as environment:
290282
e2e_test(environment)
@@ -305,8 +297,7 @@ def parametrize_offline_retrieval_test(offline_retrieval_test):
305297
The decorator takes care of tearing down the feature store, as well as the sample data.
306298
"""
307299

308-
configs = vary_redis_online_store(FULL_REPO_CONFIGS)
309-
configs = vary_providers_for_offline_stores(configs)
300+
configs = vary_providers_for_offline_stores(FULL_REPO_CONFIGS)
310301
configs = vary_full_feature_names(configs)
311302
configs = vary_infer_event_timestamp_col(configs)
312303

0 commit comments

Comments
 (0)