Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8985eb7

Browse files
author
vshepard
committed
For demo
1 parent356cd52 commit8985eb7

File tree

4 files changed

+18
-14
lines changed

4 files changed

+18
-14
lines changed

‎setup.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
readme=f.read()
2828

2929
setup(
30-
version='1.10.0',
30+
version='1.10.3',
3131
name='testgres',
3232
packages=['testgres','testgres.operations','testgres.helpers'],
3333
description='Testing utility for PostgreSQL and its extensions',

‎testgres/node.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -751,7 +751,7 @@ def stop(self, params=[], wait=True):
751751
"""
752752
ifnotself.is_started:
753753
returnself
754-
754+
print("Остановка ноды\n")
755755
_params= [
756756
self._get_bin_path("pg_ctl"),
757757
"-D",self.data_dir,
@@ -1155,7 +1155,7 @@ def poll_query_until(self,
11551155
assertsleep_time>0
11561156
attempts=0
11571157
whilemax_attempts==0orattempts<max_attempts:
1158-
print(f"Pooling{attempts}")
1158+
print(f"Запуск ноды. Попытка{attempts+1}\n")
11591159
try:
11601160
res=self.execute(dbname=dbname,
11611161
query=query,

‎testgres/plugins/pg_probackup2/pg_probackup2/app.py‎

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
importcontextlib
22
importimportlib
33
importjson
4+
importlogging
45
importos
56
importre
67
importsubprocess
@@ -43,22 +44,22 @@ def __str__(self):
4344
classProbackupApp:
4445

4546
def__init__(self,test_class:unittest.TestCase,
46-
pg_node,pb_log_path,test_env,auto_compress_alg,backup_dir):
47+
pg_node,pb_log_path,test_env,auto_compress_alg,backup_dir,probackup_path=None):
4748
self.test_class=test_class
4849
self.pg_node=pg_node
4950
self.pb_log_path=pb_log_path
5051
self.test_env=test_env
5152
self.auto_compress_alg=auto_compress_alg
5253
self.backup_dir=backup_dir
53-
self.probackup_path=init_params.probackup_path
54+
self.probackup_path=probackup_pathorinit_params.probackup_path
5455
self.probackup_old_path=init_params.probackup_old_path
5556
self.remote=init_params.remote
5657
self.verbose=init_params.verbose
5758
self.archive_compress=init_params.archive_compress
5859
self.test_class.output=None
5960

6061
defrun(self,command,gdb=False,old_binary=False,return_id=True,env=None,
61-
skip_log_directory=False,expect_error=False,use_backup_dir=True):
62+
skip_log_directory=False,expect_error=False,use_backup_dir=True,silent=False):
6263
"""
6364
Run pg_probackup
6465
backup_dir: target directory for making backup
@@ -97,8 +98,9 @@ def run(self, command, gdb=False, old_binary=False, return_id=True, env=None,
9798
strcommand+=' -j 1'
9899

99100
self.test_class.cmd=binary_path+' '+strcommand
100-
ifself.verbose:
101-
print(self.test_class.cmd)
101+
ifnotsilent:
102+
logging.info(self.test_class.cmd.replace(self.probackup_path,self.probackup_path.split('/')[-1])
103+
.replace('/'.join(self.backup_dir.path.split('/')[0:-2]),'..'))
102104

103105
cmdline= [binary_path,*command]
104106
ifgdbisTrue:
@@ -207,7 +209,8 @@ def backup_node(
207209
old_binary=False,return_id=True,no_remote=False,
208210
env=None,
209211
expect_error=False,
210-
sync=False
212+
sync=False,
213+
silent=False
211214
):
212215
ifoptionsisNone:
213216
options= []
@@ -247,7 +250,7 @@ def backup_node(
247250
cmd_list+= ['--no-sync']
248251

249252
returnself.run(cmd_list+options,gdb,old_binary,return_id,env=env,
250-
expect_error=expect_error)
253+
expect_error=expect_error,silent=silent)
251254

252255
defbackup_replica_node(self,instance,node,data_dir=False,*,
253256
master,backup_type='full',datname=False,
@@ -394,7 +397,8 @@ def show(
394397
options=None,as_text=False,as_json=True,old_binary=False,
395398
env=None,
396399
expect_error=False,
397-
gdb=False
400+
gdb=False,
401+
silent=False
398402
):
399403

400404
ifoptionsisNone:
@@ -417,12 +421,12 @@ def show(
417421
ifas_text:
418422
# You should print it when calling as_text=true
419423
returnself.run(cmd_list+options,old_binary=old_binary,env=env,
420-
expect_error=expect_error,gdb=gdb)
424+
expect_error=expect_error,gdb=gdb,silent=silent)
421425

422426
# get show result as list of lines
423427
ifas_json:
424428
text_json=str(self.run(cmd_list+options,old_binary=old_binary,env=env,
425-
expect_error=expect_error,gdb=gdb))
429+
expect_error=expect_error,gdb=gdb,silent=silent))
426430
try:
427431
ifexpect_error:
428432
returntext_json

‎testgres/plugins/pg_probackup2/setup.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
fromdistutils.coreimportsetup
55

66
setup(
7-
version='0.0.2',
7+
version='0.0.3',
88
name='testgres_pg_probackup2',
99
packages=['pg_probackup2','pg_probackup2.storage'],
1010
description='Plugin for testgres that manages pg_probackup2',

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp