Skip to content

Commit 6818439

Browse files
committed
Update failing relative paths.
1 parent 743fc7b commit 6818439

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

apps/bfd-pipeline/bfd-pipeline-idr/test_pipeline.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,16 @@ def _run_migrator(postgres: PostgresContainer) -> None:
2828
# Python recommends using an absolute path when running an executable
2929
# to avoid any ambiguity
3030
mvn = shutil.which("mvn") or "mvn"
31+
test_dir = Path(__file__).parent
32+
migrator_dir = test_dir.parent.parent / "bfd-db-migrator-ng"
3133
try:
3234
subprocess.run(
3335
f"{mvn} flyway:migrate "
3436
"-Dflyway.url="
3537
f"jdbc:postgresql://localhost:{postgres.get_exposed_port(5432)}/{postgres.dbname} "
3638
f"-Dflyway.user={postgres.username} "
3739
f"-Dflyway.password={postgres.password}",
38-
cwd="../../bfd-db-migrator-ng",
40+
cwd=str(migrator_dir),
3941
shell=True,
4042
capture_output=True,
4143
check=True,
@@ -47,14 +49,15 @@ def _run_migrator(postgres: PostgresContainer) -> None:
4749

4850
@pytest.fixture(scope="module")
4951
def setup_db() -> Generator[PostgresContainer]:
52+
test_dir = Path(__file__).parent
5053
with PostgresContainer("postgres:16", driver="") as postgres:
5154
with psycopg.connect(postgres.get_connection_url()) as conn:
52-
with Path("./mock-idr.sql").open() as f:
55+
with (test_dir / "mock-idr.sql").open() as f:
5356
conn.execute(f.read()) # type: ignore
5457
conn.commit()
5558

5659
_run_migrator(postgres)
57-
load_from_csv(conn, "./test_samples1") # type: ignore
60+
load_from_csv(conn, str(test_dir / "test_samples1")) # type: ignore
5861

5962
info = conn.info
6063
os.environ["BFD_DB_ENDPOINT"] = info.host

0 commit comments

Comments
 (0)