|
44 | 44 | create_order_feature_view, |
45 | 45 | create_pushable_feature_view, |
46 | 46 | ) |
| 47 | +from tests.integration.feature_repos.universal.online_store.datastore import ( |
| 48 | + DatastoreOnlineStoreCreator, |
| 49 | +) |
| 50 | +from tests.integration.feature_repos.universal.online_store.redis import ( |
| 51 | + RedisOnlineStoreCreator, |
| 52 | +) |
| 53 | +from tests.integration.feature_repos.universal.online_store_creator import ( |
| 54 | + OnlineStoreCreator, |
| 55 | +) |
47 | 56 |
|
48 | 57 | DYNAMO_CONFIG = {"type": "dynamodb", "region": "us-west-2"} |
49 | 58 | # Port 12345 will chosen as default for redis node configuration because Redis Cluster is started off of nodes |
|
115 | 124 | else: |
116 | 125 | FULL_REPO_CONFIGS = DEFAULT_FULL_REPO_CONFIGS |
117 | 126 |
|
| 127 | +if os.getenv("FEAST_LOCAL_ONLINE_CONTAINER", "False").lower() == "true": |
| 128 | + replacements = {"datastore": DatastoreOnlineStoreCreator} |
| 129 | + replacement_dicts = [(REDIS_CONFIG, RedisOnlineStoreCreator)] |
| 130 | + for c in FULL_REPO_CONFIGS: |
| 131 | + if isinstance(c.online_store, dict): |
| 132 | + for _replacement in replacement_dicts: |
| 133 | + if c.online_store == _replacement[0]: |
| 134 | + c.online_store_creator = _replacement[1] |
| 135 | + elif c.online_store in replacements: |
| 136 | + c.online_store_creator = replacements[c.online_store] |
| 137 | + |
| 138 | + |
118 | 139 | GO_REPO_CONFIGS = [ |
119 | 140 | IntegrationTestRepoConfig(online_store=REDIS_CONFIG, go_feature_server=True,), |
120 | 141 | ] |
@@ -299,6 +320,7 @@ class Environment: |
299 | 320 | data_source_creator: DataSourceCreator |
300 | 321 | python_feature_server: bool |
301 | 322 | worker_id: str |
| 323 | + online_store_creator: Optional[OnlineStoreCreator] = None |
302 | 324 |
|
303 | 325 | def __post_init__(self): |
304 | 326 | self.end_date = datetime.utcnow().replace(microsecond=0, second=0, minute=0) |
@@ -341,9 +363,16 @@ def construct_test_environment( |
341 | 363 | project = f"{test_suite_name}_{run_id}_{run_num}" |
342 | 364 |
|
343 | 365 | offline_creator: DataSourceCreator = test_repo_config.offline_store_creator(project) |
344 | | - |
345 | 366 | offline_store_config = offline_creator.create_offline_store_config() |
346 | | - online_store = test_repo_config.online_store |
| 367 | + |
| 368 | + if test_repo_config.online_store_creator: |
| 369 | + online_creator = test_repo_config.online_store_creator(project) |
| 370 | + online_store = ( |
| 371 | + test_repo_config.online_store |
| 372 | + ) = online_creator.create_online_store() |
| 373 | + else: |
| 374 | + online_creator = None |
| 375 | + online_store = test_repo_config.online_store |
347 | 376 |
|
348 | 377 | repo_dir_name = tempfile.mkdtemp() |
349 | 378 |
|
@@ -392,6 +421,7 @@ def construct_test_environment( |
392 | 421 | data_source_creator=offline_creator, |
393 | 422 | python_feature_server=test_repo_config.python_feature_server, |
394 | 423 | worker_id=worker_id, |
| 424 | + online_store_creator=online_creator, |
395 | 425 | ) |
396 | 426 |
|
397 | 427 | return environment |
|
0 commit comments