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_ops
are now read-only properties. These properties cannot be modified after the creation of aPostgresNode
object.- Modifying a node's port now requires recreating the
PostgresNode
object due to potential complexities in synchronizing configurations across PostgreSQL instances.
1.4. New PostgresNode
parameters (#234, ac0a2bb)
port_manager
andos_ops
parameters have been added to thePostgresNode
constructor. 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 (ac0a2bb)
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 (b917141)
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
cmd
parameter 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 (50fc4c5)
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