- Notifications
You must be signed in to change notification settings - Fork35
Add pg_probackup plugin#92
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
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes fromall commits
Commits
Show all changes
9 commits Select commitHold shift + click to select a range
eca4c48
Add pg_probackup plugin
a5fec7f
fix flake8 problems
1321a8f
Add testgres.plugins to setup
a917ba2
Add testgres.plugins to plugin
a6f88fd
Merge master
de4c84e
Change tmp_path
a388f23
Move s3_backup.py
719daaf
Add readme and basic test for pg_probackup2
c35ecc6
Code style fixes
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
2 changes: 1 addition & 1 deletionsetup.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletionstestgres/plugins/__init__.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
from pg_probackup2.gdb import GDBobj | ||
from pg_probackup2.app import ProbackupApp, ProbackupException | ||
from pg_probackup2.init_helpers import init_params | ||
from pg_probackup2.storage.fs_backup import FSTestBackupDir | ||
from pg_probackup2.storage.s3_backup import S3TestBackupDir | ||
__all__ = [ | ||
"ProbackupApp", "ProbackupException", "init_params", "FSTestBackupDir", "S3TestBackupDir", "GDBobj" | ||
] |
65 changes: 65 additions & 0 deletionstestgres/plugins/pg_probackup2/README.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
# testgres - pg_probackup2 | ||
Ccontrol and testing utility for [pg_probackup2](https://github.com/postgrespro/pg_probackup). Python 3.5+ is supported. | ||
## Installation | ||
To install `testgres`, run: | ||
``` | ||
pip install testgres-pg_probackup | ||
``` | ||
We encourage you to use `virtualenv` for your testing environment. | ||
The package requires testgres~=1.9.3. | ||
## Usage | ||
### Environment | ||
> Note: by default testgres runs `initdb`, `pg_ctl`, `psql` provided by `PATH`. | ||
There are several ways to specify a custom postgres installation: | ||
* export `PG_CONFIG` environment variable pointing to the `pg_config` executable; | ||
* export `PG_BIN` environment variable pointing to the directory with executable files. | ||
Example: | ||
```bash | ||
export PG_BIN=$HOME/pg/bin | ||
python my_tests.py | ||
``` | ||
### Examples | ||
Here is an example of what you can do with `testgres-pg_probackup2`: | ||
```python | ||
# You can see full script here plugins/pg_probackup2/pg_probackup2/tests/basic_test.py | ||
def test_full_backup(self): | ||
# Setting up a simple test node | ||
node = self.pg_node.make_simple('node', pg_options={"fsync": "off", "synchronous_commit": "off"}) | ||
# Initialize and configure Probackup | ||
self.pb.init() | ||
self.pb.add_instance('node', node) | ||
self.pb.set_archiving('node', node) | ||
# Start the node and initialize pgbench | ||
node.slow_start() | ||
node.pgbench_init(scale=100, no_vacuum=True) | ||
# Perform backup and validation | ||
backup_id = self.pb.backup_node('node', node) | ||
out = self.pb.validate('node', backup_id) | ||
# Check if the backup is valid | ||
self.assertIn(f"INFO: Backup {backup_id} is valid", out) | ||
``` | ||
## Authors | ||
[Postgres Professional](https://postgrespro.ru/about) |
Empty file addedtestgres/plugins/pg_probackup2/__init__.py
Empty file.
Empty file.
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.