Skip to content

Commit

Permalink
Add env injection in test suite (#1657)
Browse files Browse the repository at this point in the history
  • Loading branch information
kartik4949 authored Jan 9, 2024
1 parent 31bf879 commit d292d03
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions test/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ def test_db(monkeypatch, request) -> Iterator[Datalayer]:
# mongodb instead of localhost is required for CFG compatibility with docker-host
db_name = "test_db"
data_backend = f'mongodb://superduper:superduper@mongodb:27017/{db_name}'
data_backend = os.environ.get('SUPERDUPER_MONGO_URI', data_backend)

monkeypatch.setattr(CFG, 'data_backend', data_backend)

Expand Down
9 changes: 7 additions & 2 deletions test/integration/conftest.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
import random
from pathlib import Path

Expand Down Expand Up @@ -111,11 +112,14 @@ def dask_client(monkeypatch, request):
db_name = "test_db"
data_backend = f'mongodb://superduper:superduper@localhost:27017/{db_name}'

data_backend = os.environ.get('SUPERDUPER_MONGO_URI', data_backend)
address = os.environ.get('SUPERDUPER_DASK_URI', 'tcp://localhost:8786')

monkeypatch.setenv('SUPERDUPERDB_DATA_BACKEND', data_backend)

# Change the default value
client = DaskComputeBackend(
address='tcp://localhost:8786',
address=address,
local=False,
)

Expand All @@ -130,9 +134,10 @@ def ray_client():
from superduperdb.backends.ray.compute import RayComputeBackend

working_dir = Path(__file__).parents[1]
address = os.environ.get('SUPERDUPER_RAY_URI', 'ray://127.0.0.1:10001')

client = RayComputeBackend(
address='ray://127.0.0.1:10001',
address=address,
runtime_env={"working_dir": working_dir, 'excludes': ['unittest']},
)

Expand Down

0 comments on commit d292d03

Please sign in to comment.