Skip to content

Commit 4dca67c

Browse files
committed
update test db url
1 parent 2e77577 commit 4dca67c

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

server/config.py

+1
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ def _get_config_option(name: str, default_value: str | None = None) -> str:
4848
SQLALCHEMY_DATABASE_URI = _get_config_option(
4949
"DATABASE_URL", "postgresql://postgres:password@database/pigeondb"
5050
)
51+
print("initializing redis host", _get_config_option("REDIS_HOST", "redis"))
5152
REDIS_HOST = _get_config_option("REDIS_HOST", "redis")
5253

5354
FLASK_RUN_PORT = 2010

server/nlp/embeddings.py

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
VECTOR_DIMENSION = 1536
2525

2626
# load redis client
27+
print("what is redis host", REDIS_HOST)
2728
client = redis.Redis(host=REDIS_HOST, port=6379, decode_responses=True)
2829

2930
# load corpus

server_tests/conftest.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ def db_url(db_name="pigeondb_test"):
4040

4141
conn.close()
4242

43-
yield "postgresql://postgres:password@database/pigeondb_test"
43+
yield f"postgresql://postgres:password@{host}/{db_name}"
4444

4545

4646
@pytest.fixture(scope="session")
47-
def redis_db_index():
47+
def redis_host():
4848
"""Yields test redis db host.
4949
5050
Flushes test db if it already exists.
@@ -58,9 +58,9 @@ def redis_db_index():
5858

5959

6060
@pytest.fixture(scope="session")
61-
def app(db_url: str, redis_db_index: str):
61+
def app(db_url: str, redis_host: str):
6262
os.environ["DATABASE_URL"] = db_url
63-
os.environ["REDIS_HOST"] = redis_db_index
63+
os.environ["REDIS_HOST"] = redis_host
6464

6565
app = create_app()
6666
app.config.update(

0 commit comments

Comments
 (0)