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

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
demonolock merged 9 commits intomasterfromadd-pg-probackup-plugin
Jan 18, 2024
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
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
2 changes: 1 addition & 1 deletionsetup.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -27,7 +27,7 @@
readme = f.read()

setup(
version='1.9.3',
version='1.10.0',
name='testgres',
packages=['testgres', 'testgres.operations', 'testgres.helpers'],
description='Testing utility for PostgreSQL and its extensions',
Expand Down
9 changes: 9 additions & 0 deletionstestgres/plugins/__init__.py
View file
Open in desktop
Original file line numberDiff line numberDiff 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
View file
Open in desktop
Original file line numberDiff line numberDiff 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)
View file
Open in desktop
Empty file.
Empty file.
Loading

[8]ページ先頭

©2009-2025 Movatter.jp