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

Pbckp 152 multihost#78

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
demonolock merged 27 commits intomasterfromPBCKP-152-multihost
Aug 4, 2023
Merged
Show file tree
Hide file tree
Changes from1 commit
Commits
Show all changes
27 commits
Select commitHold shift + click to select a range
02c3375
PBCKP-137 update node.py
Apr 10, 2023
1512afd
PBCKP-137 up version 1.8.6
Apr 11, 2023
0d62e0e
PBCKP-137 update node.py
Apr 11, 2023
8be1b3a
PBCKP-137 update node
Apr 17, 2023
51f05de
PBCKP-152 change local function on execution by ssh
May 2, 2023
f131088
PBCKP-152 merge master
May 2, 2023
4f38bd5
PBCKP-152 multihost
May 3, 2023
0da2ee2
merge master
Jun 6, 2023
2bc17f0
testgres from PBCKP-152-multihost
Jun 6, 2023
f9b6bdb
PBCKP-152
Jun 10, 2023
ac77ef7
PBCKP-152 use black for formatting
Jun 11, 2023
b048041
PBCKP-152 fix failed tests
Jun 12, 2023
e098b97
PBCKP-152 fix failed tests
Jun 13, 2023
1c405ef
PBCKP-152 add tests for remote_ops.py
Jun 14, 2023
8c373e6
PBCKP-152 add testgres tests for remote node
Jun 14, 2023
72e6d5d
PBCKP-152 fixed test_simple and test_remote
Jun 17, 2023
2c2d2c5
PBCKP-588 test fix test_restore_after_failover
Jun 22, 2023
1b4f74a
PBCKP-588 test partially fixed test_simple_remote.py 41/43
Jun 22, 2023
2e916df
PBCKP-588 fixes after review
Jun 25, 2023
0528541
PBCKP-588 fixes after review - add ConnectionParams
Jun 26, 2023
089ab9b
PBCKP-588 fixes after review - remove f-strings
Jun 26, 2023
190d084
PBCKP-588 fixes after review - replace subprocess.run on subprocess.P…
Jun 27, 2023
0c26f77
PBCKP-588 fix failed tests - psql, set_auto_conf
Jun 28, 2023
0796bc4
PBCKP-152 - test_restore_target_time cut
Jul 26, 2023
0f14034
PBCKP-152 - node set listen address
Jul 28, 2023
12aa7ba
Add info about remote mode in README.md
Aug 1, 2023
4e7f4b0
merge master
Aug 4, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
NextNext commit
PBCKP-152 fixed test_simple and test_remote
  • Loading branch information
v.shepard committedJun 21, 2023
commit72e6d5d466bb76473b376c9bc4b9f36fa4afbda0
3 changes: 2 additions & 1 deletionsetup.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -13,7 +13,8 @@
"psutil",
"packaging",
"paramiko",
"fabric"
"fabric",
"sshtunnel"
]

# Add compatibility enum class
Expand Down
4 changes: 2 additions & 2 deletionstestgres/backup.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -77,7 +77,7 @@ def __init__(self,
"-D", data_dir,
"-X", xlog_method.value
] # yapf: disable
execute_utility(_params, self.log_file, self.os_ops)
execute_utility(_params, self.log_file)

def __enter__(self):
return self
Expand DownExpand Up@@ -139,7 +139,7 @@ def spawn_primary(self, name=None, destroy=True):

# Build a new PostgresNode
NodeClass = self.original_node.__class__
with clean_on_error(NodeClass(name=name, base_dir=base_dir)) as node:
with clean_on_error(NodeClass(name=name, base_dir=base_dir, os_ops=self.original_node.os_ops)) as node:

# New nodes should always remove dir tree
node._should_rm_dirs = True
Expand Down
7 changes: 3 additions & 4 deletionstestgres/cache.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -26,12 +26,11 @@ def cached_initdb(data_dir, logfile=None, params=None, os_ops: OsOperations = Lo
"""
Perform initdb or use cached node files.
"""
testgres_config.os_ops = os_ops

def call_initdb(initdb_dir, log=None):
def call_initdb(initdb_dir, log=logfile):
try:
_params = [get_bin_path("initdb"), "-D", initdb_dir, "-N"]
execute_utility(_params + (params or []), log, os_ops)
execute_utility(_params + (params or []), log)
except ExecUtilException as e:
raise_from(InitNodeException("Failed to run initdb"), e)

Expand DownExpand Up@@ -62,7 +61,7 @@ def call_initdb(initdb_dir, log=None):

# XXX: build new WAL segment with our system id
_params = [get_bin_path("pg_resetwal"), "-D", data_dir, "-f"]
execute_utility(_params, logfile, os_ops=os_ops)
execute_utility(_params, logfile)

except ExecUtilException as e:
msg = "Failed to reset WAL for system id"
Expand Down
6 changes: 6 additions & 0 deletionstestgres/config.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -7,6 +7,7 @@
from contextlib import contextmanager

from .consts import TMP_CACHE
from .operations.os_ops import OsOperations
from .operations.local_ops import LocalOperations


Expand DownExpand Up@@ -121,6 +122,11 @@ def copy(self):

return copy.copy(self)

@staticmethod
def set_os_ops(os_ops: OsOperations):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Didn't found calls to test_os_ops() with RemoteOperations. Is it as expected?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

It is in test_simple_remote.py:59

testgres_config.os_ops = os_ops
testgres_config.cached_initdb_dir = os_ops.mkdtemp(prefix=TMP_CACHE)


# cached dirs to be removed
cached_initdb_dirs = set()
Expand Down
2 changes: 1 addition & 1 deletiontestgres/connection.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -37,7 +37,7 @@ def __init__(self,

# Set default arguments
dbname = dbname or default_dbname()
username = username or default_username(node.os_ops)
username = username or default_username()

self._node = node

Expand Down
10 changes: 5 additions & 5 deletionstestgres/defaults.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,7 +2,7 @@
import struct
import uuid

from .operations.local_ops importLocalOperations
from .config importtestgres_config as tconf


def default_dbname():
Expand All@@ -13,11 +13,11 @@ def default_dbname():
return 'postgres'


def default_username(os_ops=LocalOperations()):
def default_username():
"""
Return default username (current user).
"""
return os_ops.get_user()
returntconf.os_ops.get_user()


def generate_app_name():
Expand All@@ -28,7 +28,7 @@ def generate_app_name():
return 'testgres-{}'.format(str(uuid.uuid4()))


def generate_system_id(os_ops=LocalOperations()):
def generate_system_id():
"""
Generate a new 64-bit unique system identifier for node.
"""
Expand All@@ -43,7 +43,7 @@ def generate_system_id(os_ops=LocalOperations()):
system_id = 0
system_id |= (secs << 32)
system_id |= (usecs << 12)
system_id |= (os_ops.get_pid() & 0xFFF)
system_id |= (tconf.os_ops.get_pid() & 0xFFF)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

no override tconf.os_ops for RemoteOperations. is it as expected?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

It's setting up in testgres_config.set_os_ops(os_ops=os_ops) and inside PostgresNode testgres_config.os_ops = self.os_ops


# pack ULL in native byte order
return struct.pack('=Q', system_id)
23 changes: 12 additions & 11 deletionstestgres/logger.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,19 +5,20 @@
import threading
import time


# create logger
log = logging.getLogger('Testgres')
log.setLevel(logging.DEBUG)
# create console handler and set level to debug
ch = logging.StreamHandler()
ch.setLevel(logging.DEBUG)
# create formatter
formatter = logging.Formatter('\n%(asctime)s - %(name)s[%(levelname)s]: %(message)s')
# add formatter to ch
ch.setFormatter(formatter)
# add ch to logger
log.addHandler(ch)

if not log.handlers:
log.setLevel(logging.WARN)
# create console handler and set level to debug
ch = logging.StreamHandler()
ch.setLevel(logging.WARN)
# create formatter
formatter = logging.Formatter('\n%(asctime)s - %(name)s[%(levelname)s]: %(message)s')
# add formatter to ch
ch.setFormatter(formatter)
# add ch to logger
log.addHandler(ch)


class TestgresLogger(threading.Thread):
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp