Skip to content

Commit 0618378

Browse files
committed
fix postgres integration test
1 parent 82fe5f1 commit 0618378

2 files changed

Lines changed: 11 additions & 9 deletions

File tree

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
from feast.infra.offline_stores.contrib.postgres_offline_store.tests.data_source import (
2-
PostgreSQLDataSourceCreator,
1+
from tests.integration.feature_repos.universal.online_store.postgres import (
2+
PostgresOnlieStoreCreator,
33
)
44
from tests.integration.feature_repos.integration_test_repo_config import (
55
IntegrationTestRepoConfig,
66
)
77

88
FULL_REPO_CONFIGS = [
99
IntegrationTestRepoConfig(
10-
online_store="postgres", online_store_creator=PostgreSQLDataSourceCreator
10+
online_store="postgres", online_store_creator=PostgresOnlieStoreCreator
1111
),
1212
]

sdk/python/tests/integration/feature_repos/universal/online_store/postgres.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,24 @@ class PostgresOnlieStoreCreator(OnlineStoreCreator):
1111
def __init__(self, project_name: str, **kwargs):
1212
super().__init__(project_name)
1313
self.container = (
14-
PostgresContainer("postgres:16", platform="linux/amd64")
14+
PostgresContainer(
15+
"postgres:16",
16+
username="root",
17+
password="test",
18+
dbname="test",
19+
)
1520
.with_exposed_ports(5432)
16-
.with_env("POSTGRES_USER", "root")
17-
.with_env("POSTGRES_PASSWORD", "test")
18-
.with_env("POSTGRES_DB", "test")
1921
)
2022

2123
def create_online_store(self) -> Dict[str, str]:
2224
self.container.start()
23-
exposed_port = self.container.get_exposed_port(5432)
2425
return {
26+
"host": "localhost",
2527
"type": "postgres",
2628
"user": "root",
2729
"password": "test",
2830
"database": "test",
29-
"port": exposed_port,
31+
"port": self.container.get_exposed_port(5432),
3032
}
3133

3234
def teardown(self):

0 commit comments

Comments
 (0)