mirror of
https://github.com/neondatabase/neon.git
synced 2026-01-17 02:12:56 +00:00
Capture LD_LIBRARY_PATH from pytest env
This commit is contained in:
@@ -226,6 +226,7 @@ pub(crate) async fn main() -> anyhow::Result<()> {
|
||||
),
|
||||
])
|
||||
.env_clear()
|
||||
.env("LD_LIBRARY_PATH", &pg_lib_dir)
|
||||
.stdout(std::process::Stdio::piped())
|
||||
.stderr(std::process::Stdio::piped())
|
||||
.spawn()
|
||||
@@ -302,6 +303,7 @@ pub(crate) async fn main() -> anyhow::Result<()> {
|
||||
.arg(&source_connection_string)
|
||||
// how we run it
|
||||
.env_clear()
|
||||
.env("LD_LIBRARY_PATH", &pg_lib_dir)
|
||||
.kill_on_drop(true)
|
||||
.stdout(std::process::Stdio::piped())
|
||||
.stderr(std::process::Stdio::piped())
|
||||
@@ -335,6 +337,7 @@ pub(crate) async fn main() -> anyhow::Result<()> {
|
||||
.arg(&dumpdir)
|
||||
// how we run it
|
||||
.env_clear()
|
||||
.env("LD_LIBRARY_PATH", &pg_lib_dir)
|
||||
.kill_on_drop(true)
|
||||
.stdout(std::process::Stdio::piped())
|
||||
.stderr(std::process::Stdio::piped())
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import os
|
||||
import shutil
|
||||
import subprocess
|
||||
import tempfile
|
||||
@@ -39,7 +40,10 @@ class FastImport(AbstractNeonCli):
|
||||
if not (self.pg_bin / "postgres").exists():
|
||||
raise Exception(f"postgres binary was not found at '{self.pg_bin}'")
|
||||
self.pg_lib = pg_dir / "lib"
|
||||
|
||||
if env_vars.get("LD_LIBRARY_PATH") is not None:
|
||||
self.pg_lib = Path(env_vars["LD_LIBRARY_PATH"])
|
||||
elif os.getenv("LD_LIBRARY_PATH") is not None:
|
||||
self.pg_lib = Path(str(os.getenv("LD_LIBRARY_PATH")))
|
||||
if not workdir.exists():
|
||||
raise Exception(f"Working directory '{workdir}' does not exist")
|
||||
self.workdir = workdir
|
||||
|
||||
Reference in New Issue
Block a user