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

Conversation

dmitry-lipetsk
Copy link
Collaborator

This patch is normalizing an usage of ExecUtilException in exec_command methods - ExecUtilException::message now contains an only string data.

I also added ExecUtilException::error property to transfer an original error data to client.

PostgresNode::psql uses only OsOperations::exec_command. Usage of subprocess.Popen is deleted.

Failed tests those wait an binary error message in ExecUtilException::message are corrected.

This patch was tested with internal tests for probackup v2 - all is OK. Change of this tests is not required.

Summary of changes

  • The one way to generate ExecUtilException - RaiseError.UtilityExitedWithNonZeroCode
  • RaiseError is added
  • ExecUtilException::error is added (it contains the error data)
  • ExecUtilException::str is updated
  • PostgresNode::psql and PostgresNode::safe_psql are updated
  • TestLocalOperations::test_exec_command_failure is updated
  • TestRemoteOperations::test_exec_command_failure is updated
  • TestRemoteOperations::test_makedirs_and_rmdirs_failure is updated

- The one way to generate ExecUtilException - RaiseError.UtilityExitedWithNonZeroCode- RaiseError is added- ExecUtilException::error is added (it contains the error data)- ExecUtilException::__str__ is updated- PostgresNode::psql and PostgresNode::safe_psql are updated- TestLocalOperations::test_exec_command_failure is updated- TestRemoteOperations::test_exec_command_failure is updated- TestRemoteOperations::test_makedirs_and_rmdirs_failure is updated
…al_op]Both LocalOperations::exec_command and RemoteOperations::exec_command were updated.
If expect_error is True and no error is detected, safe_psql raises InvalidOperationException exception.Tests (local, remote) are added.
…e_returnsIt fixes a problem with this test on Windows.
The previous order of imports is restored for minimization number of changes.
Let's store our things on one place.We use RaiseError only in testgres/operations structures currently.
This function is equal to os_ops.get_default_encoding and is used in: - Helpers.PrepareProcessInput - RaiseError._TranslateDataIntoString__FromBinary
- New debug checks- Normalization
Copy link
CollaboratorAuthor

@dmitry-lipetskdmitry-lipetsk left a comment

Choose a reason for hiding this comment

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

I hope this new code make testgres better :)

@dmitry-lipetskdmitry-lipetsk merged commitb949eb8 intopostgrespro:masterDec 10, 2024
1 check passed
@dmitry-lipetskdmitry-lipetsk mentioned this pull requestDec 10, 2024
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@demonolockdemonolockdemonolock approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@dmitry-lipetsk@demonolock

[8]ページ先頭

©2009-2025 Movatter.jp