- Notifications
You must be signed in to change notification settings - Fork0
postgrespro/testgres-pg_probackup2
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Control and testing utility forpg_probackup2. Python 3.5+ is supported.
To installtestgres
, run:
pip install testgres-pg_probackup
We encourage you to usevirtualenv
for your testing environment.The package requires testgres~=1.9.3.
Variable | Required | Default value | Description |
---|---|---|---|
PGPROBACKUP_TMP_DIR | No | tests/tmp_dirs | The root of the temporary directory hierarchy where tests store data and logs. Relative paths start from the current working directory. |
PG_PROBACKUP_TEST_BACKUP_DIR_PREFIX | No | Temporary test hierarchy | Prefix of the test backup directories. Must be an absolute path. Use this variable to store test backups in a location other than the temporary test hierarchy. |
PG_PROBACKUP_VALGRIND | No | Not set | Run pg_probackup through valgrind if the variable is set to 'y'. Setting PG_PROBACKUP_VALGRIND_SUP (see below) to any value enables valgrind just like settingPG_PROBACKUP_VALGRIND=y would do. |
PG_PROBACKUP_VALGRIND_SUP | No | Not set | Specify the path to a valgrind suppression file. If the variable is not set then a file named "valgrind.supp" is searched for in the current working directory (normally the root of pg_probackup repository). Setting PG_PROBACKUP_VALGRIND_SUP to any value enables valgrind just like settingPG_PROBACKUP_VALGRIND=y (see above) would do. |
SeeTestgres on how to configure a custom Postgres installation usingPG_CONFIG
andPG_BIN
environment variables.
Here is an example of what you can do withtestgres-pg_probackup2
:
# You can see full script here plugins/pg_probackup2/pg_probackup2/tests/basic_test.pydeftest_full_backup(self):# Setting up a simple test nodenode=self.pg_node.make_simple('node',pg_options={"fsync":"off","synchronous_commit":"off"})# Initialize and configure Probackupself.pb.init()self.pb.add_instance('node',node)self.pb.set_archiving('node',node)# Start the node and initialize pgbenchnode.slow_start()node.pgbench_init(scale=100,no_vacuum=True)# Perform backup and validationbackup_id=self.pb.backup_node('node',node)out=self.pb.validate('node',backup_id)# Check if the backup is validself.assertIn(f"INFO: Backup{backup_id} is valid",out)
About
No description, website, or topics provided.
Resources
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
No packages published
Contributors3
Uh oh!
There was an error while loading.Please reload this page.