testgres-pg-probackup2 0.0.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- testgres_pg_probackup2-0.0.1/PKG-INFO +14 -0
- testgres_pg_probackup2-0.0.1/README.md +65 -0
- testgres_pg_probackup2-0.0.1/pg_probackup2/__init__.py +0 -0
- testgres_pg_probackup2-0.0.1/pg_probackup2/app.py +762 -0
- testgres_pg_probackup2-0.0.1/pg_probackup2/gdb.py +346 -0
- testgres_pg_probackup2-0.0.1/pg_probackup2/init_helpers.py +207 -0
- testgres_pg_probackup2-0.0.1/pg_probackup2/storage/__init__.py +0 -0
- testgres_pg_probackup2-0.0.1/pg_probackup2/storage/fs_backup.py +101 -0
- testgres_pg_probackup2-0.0.1/pg_probackup2/storage/s3_backup.py +134 -0
- testgres_pg_probackup2-0.0.1/setup.cfg +4 -0
- testgres_pg_probackup2-0.0.1/setup.py +18 -0
- testgres_pg_probackup2-0.0.1/testgres_pg_probackup2.egg-info/PKG-INFO +14 -0
- testgres_pg_probackup2-0.0.1/testgres_pg_probackup2.egg-info/SOURCES.txt +14 -0
- testgres_pg_probackup2-0.0.1/testgres_pg_probackup2.egg-info/dependency_links.txt +1 -0
- testgres_pg_probackup2-0.0.1/testgres_pg_probackup2.egg-info/requires.txt +1 -0
- testgres_pg_probackup2-0.0.1/testgres_pg_probackup2.egg-info/top_level.txt +1 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: testgres_pg_probackup2
|
|
3
|
+
Version: 0.0.1
|
|
4
|
+
Summary: Plugin for testgres that manages pg_probackup2
|
|
5
|
+
Home-page: https://github.com/postgrespro/testgres
|
|
6
|
+
Author: Postgres Professional
|
|
7
|
+
Author-email: testgres@postgrespro.ru
|
|
8
|
+
License: PostgreSQL
|
|
9
|
+
Keywords: pg_probackup,testing,testgres
|
|
10
|
+
Platform: UNKNOWN
|
|
11
|
+
Description-Content-Type: text/markdown
|
|
12
|
+
|
|
13
|
+
UNKNOWN
|
|
14
|
+
|
|
@@ -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
|
+
def test_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)
|
|
File without changes
|