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

Commita65da28

Browse files
authored
Add pg_probackup plugin (#92)
1 parent5218b11 commita65da28

File tree

13 files changed

+1722
-1
lines changed

13 files changed

+1722
-1
lines changed

‎setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
readme=f.read()
2828

2929
setup(
30-
version='1.9.3',
30+
version='1.10.0',
3131
name='testgres',
3232
packages=['testgres','testgres.operations','testgres.helpers'],
3333
description='Testing utility for PostgreSQL and its extensions',

‎testgres/plugins/__init__.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
frompg_probackup2.gdbimportGDBobj
2+
frompg_probackup2.appimportProbackupApp,ProbackupException
3+
frompg_probackup2.init_helpersimportinit_params
4+
frompg_probackup2.storage.fs_backupimportFSTestBackupDir
5+
frompg_probackup2.storage.s3_backupimportS3TestBackupDir
6+
7+
__all__= [
8+
"ProbackupApp","ProbackupException","init_params","FSTestBackupDir","S3TestBackupDir","GDBobj"
9+
]
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
#testgres - pg_probackup2
2+
3+
Ccontrol and testing utility for[pg_probackup2](https://github.com/postgrespro/pg_probackup). Python 3.5+ is supported.
4+
5+
6+
##Installation
7+
8+
To install`testgres`, run:
9+
10+
```
11+
pip install testgres-pg_probackup
12+
```
13+
14+
We encourage you to use`virtualenv` for your testing environment.
15+
The package requires testgres~=1.9.3.
16+
17+
##Usage
18+
19+
###Environment
20+
21+
>Note: by default testgres runs`initdb`,`pg_ctl`,`psql` provided by`PATH`.
22+
23+
There are several ways to specify a custom postgres installation:
24+
25+
* export`PG_CONFIG` environment variable pointing to the`pg_config` executable;
26+
* export`PG_BIN` environment variable pointing to the directory with executable files.
27+
28+
Example:
29+
30+
```bash
31+
export PG_BIN=$HOME/pg/bin
32+
python my_tests.py
33+
```
34+
35+
36+
###Examples
37+
38+
Here is an example of what you can do with`testgres-pg_probackup2`:
39+
40+
```python
41+
# You can see full script here plugins/pg_probackup2/pg_probackup2/tests/basic_test.py
42+
deftest_full_backup(self):
43+
# Setting up a simple test node
44+
node=self.pg_node.make_simple('node',pg_options={"fsync":"off","synchronous_commit":"off"})
45+
46+
# Initialize and configure Probackup
47+
self.pb.init()
48+
self.pb.add_instance('node', node)
49+
self.pb.set_archiving('node', node)
50+
51+
# Start the node and initialize pgbench
52+
node.slow_start()
53+
node.pgbench_init(scale=100,no_vacuum=True)
54+
55+
# Perform backup and validation
56+
backup_id=self.pb.backup_node('node', node)
57+
out=self.pb.validate('node', backup_id)
58+
59+
# Check if the backup is valid
60+
self.assertIn(f"INFO: Backup{backup_id} is valid", out)
61+
```
62+
63+
##Authors
64+
65+
[Postgres Professional](https://postgrespro.ru/about)

‎testgres/plugins/pg_probackup2/__init__.py

Whitespace-only changes.

‎testgres/plugins/pg_probackup2/pg_probackup2/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp