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

Proposal to fix #154 (v2)#161

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
Merged
Show file tree
Hide file tree
Changes from1 commit
Commits
Show all changes
13 commits
Select commitHold shift + click to select a range
f9ddd04
Proposal to fix #154 (v2)
dmitry-lipetskDec 8, 2024
2bb38dc
[BUG FIX] PostgresNode::safe_psql did not respect "expect_error" para…
dmitry-lipetskDec 9, 2024
45b8dc0
[BUG FIX] A problem in psql/safe_psql and 'input' data was fixed [loc…
dmitry-lipetskDec 9, 2024
f848a63
PostgresNode::safe_psql raises InvalidOperationException
dmitry-lipetskDec 9, 2024
db0744e
A problem with InvalidOperationException and flake8 is fixed
dmitry-lipetskDec 9, 2024
5bb1510
A code style is fixed [flake8]
dmitry-lipetskDec 9, 2024
31c7bce
[BUG FIX] Wrappers for psql use subprocess.PIPE for stdout and stderr
dmitry-lipetskDec 9, 2024
b013801
[BUG FIX] TestgresTests::test_safe_psql__expect_error uses rm_carriag…
dmitry-lipetskDec 9, 2024
c49ee4c
node.py is updated [formatting]
dmitry-lipetskDec 10, 2024
6a0e714
Formatting
dmitry-lipetskDec 10, 2024
3cc19d2
raise_error.py is moved into testgres/operations from testgres/helpers
dmitry-lipetskDec 10, 2024
7b70e9e
Helpers.GetDefaultEncoding is added
dmitry-lipetskDec 10, 2024
cd0b5f8
Code normalization
dmitry-lipetskDec 10, 2024
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
Code normalization
- New debug checks- Normalization
  • Loading branch information
@dmitry-lipetsk
dmitry-lipetsk committedDec 10, 2024
commitcd0b5f8671d61214afb2985adb83cd3efb9b852a
15 changes: 11 additions & 4 deletionstestgres/operations/local_ops.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -86,25 +86,32 @@ def _run_command__generic(self, cmd, shell, input, stdin, stdout, stderr, get_pr
if not get_process:
input_prepared = Helpers.PrepareProcessInput(input, encoding) # throw

assert input_prepared is None or (type(input_prepared) == bytes) # noqa: E721

process = subprocess.Popen(
cmd,
shell=shell,
stdin=stdin or subprocess.PIPE if input is not None else None,
stdout=stdout or subprocess.PIPE,
stderr=stderr or subprocess.PIPE,
)
assert not (process is None)
if get_process:
return process, None, None
try:
output, error = process.communicate(input=input_prepared, timeout=timeout)
if encoding:
output = output.decode(encoding)
error = error.decode(encoding)
return process, output, error
except subprocess.TimeoutExpired:
process.kill()
raise ExecUtilException("Command timed out after {} seconds.".format(timeout))

assert type(output) == bytes # noqa: E721
assert type(error) == bytes # noqa: E721

if encoding:
output = output.decode(encoding)
error = error.decode(encoding)
return process, output, error

def _run_command(self, cmd, shell, input, stdin, stdout, stderr, get_process, timeout, encoding):
"""Execute a command and return the process and its output."""
if os.name == 'nt' and stdout is None: # Windows
Expand Down
3 changes: 3 additions & 0 deletionstestgres/operations/remote_ops.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -75,12 +75,15 @@ def exec_command(self, cmd, wait_exit=False, verbose=False, expect_error=False,
if not get_process:
input_prepared = Helpers.PrepareProcessInput(input, encoding) # throw

assert input_prepared is None or (type(input_prepared) == bytes) # noqa: E721

ssh_cmd = []
if isinstance(cmd, str):
ssh_cmd = ['ssh', self.ssh_dest] + self.ssh_args + [cmd]
elif isinstance(cmd, list):
ssh_cmd = ['ssh', self.ssh_dest] + self.ssh_args + cmd
process = subprocess.Popen(ssh_cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
assert not (process is None)
if get_process:
return process

Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp