Skip to content

Commit 3d836b2

Browse files
committed
add probackup_version attribute to tests
1 parent 510c947 commit 3d836b2

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/helpers/ptrack_helpers.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,18 @@ def __init__(self, *args, **kwargs):
246246
print('pg_probackup binary is not found')
247247
exit(1)
248248

249+
self.probackup_version = None
250+
251+
try:
252+
self.probackup_version_output = subprocess.check_output(
253+
[self.probackup_path, "--version"],
254+
stderr=subprocess.STDOUT,
255+
).decode('utf-8')
256+
except subprocess.CalledProcessError as e:
257+
raise ProbackupException(e.output.decode('utf-8'))
258+
259+
self.probackup_version = re.search(r"\d+\.\d+\.\d+", self.probackup_version_output).group(0)
260+
249261
if os.name == 'posix':
250262
self.EXTERNAL_DIRECTORY_DELIMITER = ':'
251263
os.environ['PATH'] = os.path.dirname(

0 commit comments

Comments
 (0)