GitHub / postgrespro / testgres
Testing framework for PostgreSQL and its extensions
JSON API: http://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/postgrespro%2Ftestgres
PURL: pkg:github/postgrespro/testgres
Stars: 150
Forks: 37
Open issues: 11
License: other
Language: Python
Size: 1.08 MB
Dependencies parsed at: Pending
Created at: about 9 years ago
Updated at: 5 days ago
Pushed at: 5 days ago
Last synced at: 5 days ago
Commit Stats
Commits: 503
Authors: 36
Mean commits per author: 13.97
Development Distribution Score: 0.557
More commit stats: https://commits.ecosyste.ms/hosts/GitHub/repositories/postgrespro/testgres
Topics: pathman, postgres, postgresql, replication, testgres, testing
1.11.1
1.11.1
What’s Changed
Full Changelog: https://github.com/postgrespro/testgres/compare/1.11.0...1.11.1
Changes in testgres code
- [#240] Using of
node.psqlwith other host and port in #242 - [#249] Fix of port number leak in
NodeBackup::spawn_replicain #250 - [Refactoring] Default port manager functions now use
PortManager__GenericandLocalOperationsin #251 - [#244]
PostgresNodenow usesos_opsonly in #245 LocalOperations::get_single_instanceis added in #252- New
OsOperationsmethods:makedir,rmdirin #253 OsOperations::get_tempdir()is added in #254- [#256] Port number 65535 is valid for using in #268
- [#264] New property
PostgresNode::port_managerin #269 PortManager__Generic sends debugmessages “port is reserved/released” in #270- [#266]
OsOperations::build_pathis added in #273 - A support of
cwdparameter is added toOsOperations::exec_commandin #272 - [#274] Unused
should_rm_dirsis deleted (cleanup) in #275 - [python v3.13]
TestTestgresCommon::test_logginguseslogging._lockin #276 NodeAppis refactored in #278- Testgres is tested on python 3.7 now, too in #280
- Remove usage of not standard function nc in
remote_ops.py is_port_freein #284
Changes in testgres tests
- [FIX] Tests include testgres by right way through import in #241
- Testgres tests create log dir in exact place in #243
- [test]
TestTestgresLocal.test_upgrade_nodeis corrected in #246 - Releasing of reserved port in tests in #248
- [#235]
test_pg_ctl_wait_optiondetects a port conflict in #257 - Incomplete asserts in are fixed (conftest) in #261
- [tests] Creation of “dummy/empty” log file for xdist controller is fixed in #282
- conftest is updated - ExitStatusNames in #283
Our plans
Split testgres’ code
We will move the content of testgres/operations folder into the separated package - testgres.os_ops.
Some exceptions will be moved in separated packages testgres.common, too.
It allows to use these things separately.
This change requires to the internal reorganization of testgres source code - ‘testgres’ folder will be renamed with ‘src’.
Remove testgres.plugins
We will remove testgres.plugins folder with all its content (plugin for pg_probackup2).
Plugin for pg_probackup2 was already moved to the separated package - https://github.com/postgrespro/testgres-pg_probackup2
If you download testgres-pg-probackup2 from github directly, please update your code to avoid any problem in the near future.
Contributors
- @demonolock
- @dmitry-lipetsk
Download
1.11.0
1.11.0
Testgres 1.11.0 Release Notes
1. Important Changes
1.1. Removal of testgres.OsOperations::db_connect method (#237)
The db_connect method has been removed from the OsOperations interface as it was not fitting with the OS-specific functionality it was intended for.
1.2. Replacement of testgres.helpers.port_manager.PortManager (#234)
The old PortManager class has been replaced by the new testgres.port_manager.PortManager interface. The functionalities of the old PortManager are now in the testgres.utils.internal__reserve_port function.
1.3. PostgresNode property changes (#234)
PostgresNode::name,PostgresNode::host,PostgresNode::port,PostgresNode::ssh_key, andPostgresNode::os_opsare now read-only properties. These properties cannot be modified after the creation of aPostgresNodeobject.- Modifying a node’s port now requires recreating the
PostgresNodeobject due to potential complexities in synchronizing configurations across PostgreSQL instances.
1.4. New PostgresNode parameters (#234, ac0a2bbd373b5d5852bfb3b3ff0ff6caec2c6633)
port_managerandos_opsparameters have been added to thePostgresNodeconstructor. These parameters allow explicit control over the port reservation and the OS operations used by the node.
2. New Features
2.1. New testgres.port_manager.PortManager Interface (#234)
A new interface for reserving and releasing ports, used by PostgresNode to manage port assignments correctly on both local and remote systems. Two implementations are available:
PortManager__ThisHost(for local systems)PortManager__Generic(for both local and remote systems)
2.2. PostgresNode::clone_with_new_name_and_base_dir Method (ac0a2bbd373b5d5852bfb3b3ff0ff6caec2c6633)
New method to clone a PostgresNode with a new name and base directory. This method is now used in NodeBackup::spawn_primary for better node cloning.
2.3. OsOperations::is_free_port Method (#234)
A new method added to OsOperations to check if a port is free. This method is used in the new PortManager__Generic class.
2.4. Support for Environment Variables in OsOperations::execute_command (#239)
You can now pass environment variables through the new exec_env parameter when using the execute_command method of OsOperations. This feature has been added to PostgresNode::start and PostgresNode::slow_start.
3. Updates and Changes
3.1. PostgresNode::start Does Not Call logging.error Anymore (b91714142fb77d1af7450bfa58abf2cecf529c4d)
The PostgresNode::start method no longer logs errors before raising exceptions. This change improves the handling of errors and avoids misclassification of errors as they are now left for the client to handle.
3.2. RemoteOperations::exec_command Updates (#185, #187)
- Explicit enumeration of supported
cmdparameter types. - Explicitly transfers language environment variables (
LANG,LC_*, etc.) during SSH command execution.
3.3. PostgresNode::pid Improved (#199)
Now uses pg_ctl to handle pid property more reliably.
3.4. Refactoring of OsOperations::execute_command (#203)
Improved error handling and the way results are processed. The function now only checks the exit code for errors and allows the caller to manage expected errors.
4. Bug Fixes
4.1. OsOperations::cwd Bug Fix (#182)
The implementation of cwd now works correctly with local systems.
4.2. Fixes in OsOperations::write Method (#183)
Bug fixes and data preparation improvements for both local and remote operations.
4.3. Fixes in PostgresNode::start Method (50fc4c5fecc9aa722dbc660762a9d120f12e92fa)
Corrected an issue in the warning message generation when starting a node.
4.4. RemoteOperations::mktemp Fix (#202)
The call to mktemp now correctly uses the -t option to return the full path instead of just a name.
4.5. Fix for RemoteOperations::listdir (#217)
Improved handling of directory listings, especially for paths with spaces.
5. Other Changes
5.1. New CI Verifications
- Support for multiple Python versions (3.8 - 3.12).
- Tests on multiple Linux distributions (Ubuntu 2024.04, AltLinux 10/11).
5.2. Migration to pytest
Tests have been migrated from unittest to pytest for better flexibility and efficiency.
5.3. Global Test Refactoring
New unified tests for LocalOperations and RemoteOperations.
5.4. Experimental Logging Feature
A new conftest.py allows logging test results for further processing of errors and warnings within a single test.
Full Changelog: 1.10.5 → 1.11.0
Contributors
- @dmitry-lipetsk
Download
1.10.5
1.10.5
What’s Changed
- Fixed a problem from 1.10.4 with socket directory by @dmitry-lipetsk in https://github.com/postgrespro/testgres/pull/180
Full Changelog: https://github.com/postgrespro/testgres/compare/1.10.4...1.10.5
Download
1.10.4
1.10.4
Testgres 1.10.4 Release Notes
🚀 Key Improvements
- Better Port Management: Improved handling of port numbers to reduce conflicts and errors. #165 @dmitry-lipetsk
- More Reliable Error Handling:
RemoteOperations::exec_commandno longer raises exceptions whenexpect_error=True. [#160] (https://github.com/postgrespro/testgres/pull/160) @dmitry-lipetsk- Fix for Windows: Improved error handling and port management. #172 @dmitry-lipetsk
🔧 Bug Fixes & Enhancements
- Database Connection Fix:
PSQLnow explicitly passes the database name using-d <dbname>. #168 @dmitry-lipetsk - SSH Command Fix: Corrected SSH command execution in
RemoteOperations::execute. #169 @dmitry-lipetsk - Remote Operations Updates:
- Added new methods:
read_binary,get_file_size. #170 @dmitry-lipetsk
- Added new methods:
- File Operations Enhancements:
- Backup Testing Support: Added
check backup-sourceto help testpg_probackup3. #176 @egarbuz
🛠 Refactoring & Code Cleanup
- Refactored Node Management:
- Command Execution Improvements:
🎉 New Contributors
- @dmitry-lipetsk made their first contribution! 🎉 #157
📌 Full Changelog: 1.10.3 → 1.10.4
Download
1.10.3
1.10.3
What’s Changed
- Fix test test_child_pids for PostgreSql 15 and higher by @demonolock in https://github.com/postgrespro/testgres/pull/146
- Add PG_PROBACKUP_WAL_TREE_ENABLED env param by @dura0ok in https://github.com/postgrespro/testgres/pull/143
- Fix typos by @kianmeng in https://github.com/postgrespro/testgres/pull/152
- Refinement of the run function in app.py by @MakSl in https://github.com/postgrespro/testgres/pull/148
- Fix broken pipe from gdb after killing process by @MetalDream666 in https://github.com/postgrespro/testgres/pull/151
New Contributors
- @kianmeng made their first contribution in https://github.com/postgrespro/testgres/pull/152
Full Changelog: https://github.com/postgrespro/testgres/compare/1.10.2...1.10.3
Download
1.10.2
1.10.2
What’s Changed
- Add an SSH port parameter by @asavchkov in https://github.com/postgrespro/testgres/pull/131
- Pass a DB port to NodeApp by @asavchkov in https://github.com/postgrespro/testgres/pull/132
- Make use of the default SSH user by @asavchkov in https://github.com/postgrespro/testgres/pull/133
- Fix node cleanup by @demonolock in https://github.com/postgrespro/testgres/pull/135
- Update log level TRACE insted of VERBOSE by @egarbuz in https://github.com/postgrespro/testgres/pull/138
- Fix logger by @demonolock in https://github.com/postgrespro/testgres/pull/140
- Add force node stopping using SIGKILL by @demonolock in https://github.com/postgrespro/testgres/pull/139
- fix locale warning by @dura0ok in https://github.com/postgrespro/testgres/pull/141
New Contributors
- @dura0ok made their first contribution in https://github.com/postgrespro/testgres/pull/141
Full Changelog: https://github.com/postgrespro/testgres/compare/1.10.1...1.10.2
Download
1.10.1
1.10.1
What’s Changed
- Adding port and database name into params list for add-instance command by @egarbuz in https://github.com/postgrespro/testgres/pull/118
- Fix error ‘Is another postmaster already running on port XXX’ in node by @MetalDream666 in https://github.com/postgrespro/testgres/pull/120
- Value pg_probackup major_version added to the class Init by @egarbuz in https://github.com/postgrespro/testgres/pull/119
- Add options to command pg_basebackup by @demonolock in https://github.com/postgrespro/testgres/pull/121
- Add pgbench_with_wait function by @demonolock in https://github.com/postgrespro/testgres/pull/122
- Add options to pg_upgrade by @fabriziomello in https://github.com/postgrespro/testgres/pull/125
- Added command execution time measurement in pg_probackup run by @MakSl in https://github.com/postgrespro/testgres/pull/123
- Add parsing backup_id in run app.py by @demonolock in https://github.com/postgrespro/testgres/pull/126
New Contributors
- @egarbuz made their first contribution in https://github.com/postgrespro/testgres/pull/118
- @fabriziomello made their first contribution in https://github.com/postgrespro/testgres/pull/125
- @MakSl made their first contribution in https://github.com/postgrespro/testgres/pull/123
Full Changelog: https://github.com/postgrespro/testgres/compare/1.10.0...1.10.1
Download
1.10.0
1.10.0
What’s Changed
- Add pg_upgrade option by @demonolock (#97)
This function allows upgrade PostgreSQL versions. - Remove unnecessary output by @homper (#88)
- Fix get_pg_version for Linux Mint by @demonolock (#101)
- Set default test locale to en by @Ogurezzz (#107)
This change aims to standardize test outputs. - Fix Error during executing query by @z-kasymalieva (#110)
Resolved an issue related to executing queries within the framework, particularly when executing commands that do not produce row output, which previously resulted in errors. - Run the archive command through exec by @asavchkov (#113)
If the PostgreSQL archive command is run through the dash shell the shell produces a core dump upon receiving a SIGQUIT during the PostgreSQL server shutdown. This change replaces the dash process with pg_probackup to avoid the production of a core dump.
New Contributors
- @homper made their first contribution in https://github.com/postgrespro/testgres/pull/88
- @z-kasymalieva made their first contribution in https://github.com/postgrespro/testgres/pull/105
- @Ogurezzz made their first contribution in https://github.com/postgrespro/testgres/pull/107
Full Changelog: https://github.com/postgrespro/testgres/compare/1.9.3...1.10.0
Download