mirror of
https://github.com/postgrespro/pg_probackup.git
synced 2025-01-20 11:34:51 +02:00
tests: set env for run_binary
This commit is contained in:
parent
1c860ff9bc
commit
23b00b1ddf
@ -2030,7 +2030,9 @@ class ArchiveTest(ProbackupTest, unittest.TestCase):
|
||||
if self.archive_compress and node.major_version >= 10:
|
||||
cmdline += ['-Z', '1']
|
||||
|
||||
pg_receivexlog = self.run_binary(cmdline, asynchronous=True)
|
||||
env = self.test_env
|
||||
env["PGAPPNAME"] = app_name
|
||||
pg_receivexlog = self.run_binary(cmdline, asynchronous=True, env)
|
||||
|
||||
if pg_receivexlog.returncode:
|
||||
self.assertFalse(
|
||||
|
@ -779,7 +779,11 @@ class ProbackupTest(object):
|
||||
except subprocess.CalledProcessError as e:
|
||||
raise ProbackupException(e.output.decode('utf-8'), self.cmd)
|
||||
|
||||
def run_binary(self, command, asynchronous=False):
|
||||
def run_binary(self, command, asynchronous=False, env=None):
|
||||
|
||||
if not env:
|
||||
env = self.test_env
|
||||
|
||||
if self.verbose:
|
||||
print([' '.join(map(str, command))])
|
||||
try:
|
||||
@ -789,13 +793,13 @@ class ProbackupTest(object):
|
||||
stdin=subprocess.PIPE,
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
env=self.test_env
|
||||
env=env
|
||||
)
|
||||
else:
|
||||
self.output = subprocess.check_output(
|
||||
command,
|
||||
stderr=subprocess.STDOUT,
|
||||
env=self.test_env
|
||||
env=env
|
||||
).decode('utf-8')
|
||||
return self.output
|
||||
except subprocess.CalledProcessError as e:
|
||||
|
Loading…
x
Reference in New Issue
Block a user