Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Change test_entity_ttl test
Signed-off-by: Kevin Zhang <kzhang@tecton.ai>
  • Loading branch information
kevjumba committed Mar 2, 2022
commit f4160ade756fc012bbcb3bfdb768a80a95c03d7d
17 changes: 17 additions & 0 deletions sdk/python/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,23 @@ def cleanup():
request.addfinalizer(cleanup)
return construct_universal_test_data(environment)

@pytest.fixture(scope="session")
def redis_universal_data_sources(request, local_redis_environment):
entities = construct_universal_entities()
datasets = construct_universal_datasets(
entities, local_redis_environment.start_date, local_redis_environment.end_date
)
datasources = construct_universal_data_sources(
datasets, local_redis_environment.data_source_creator
)

def cleanup():
# logger.info("Running cleanup in %s, Request: %s", worker_id, request.param)
local_redis_environment.data_source_creator.teardown()

request.addfinalizer(cleanup)
return entities, datasets, datasources


@pytest.fixture(scope="session")
def e2e_data_sources(environment: Environment, request):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,16 @@


@pytest.mark.integration
def test_entity_ttl_online_store(local_redis_environment, universal_data_sources):
def test_entity_ttl_online_store(local_redis_environment, redis_universal_data_sources):
if os.getenv("FEAST_IS_LOCAL_TEST", "False") == "True":
return
fs = local_redis_environment.feature_store
# setting ttl setting in online store to 1 second
fs.config.online_store.key_ttl_seconds = 1
entities, datasets, data_sources = universal_data_sources
driver_hourly_stats = create_driver_hourly_stats_feature_view(data_sources.driver)
entities, datasets, data_sources = redis_universal_data_sources
driver_hourly_stats = create_driver_hourly_stats_feature_view(
data_sources["driver"]
)
driver_entity = driver()

# Register Feature View and Entity
Expand Down Expand Up @@ -94,6 +96,7 @@ def test_entity_ttl_online_store(local_redis_environment, universal_data_sources
assertpy.assert_that(df["conv_rate"].iloc[0]).is_none()



# TODO: make this work with all universal (all online store types)
@pytest.mark.integration
def test_write_to_online_store_event_check(local_redis_environment):
Expand Down