Release v4.0.0 (#3141)

- bump version
- update release notes
- adjust docs
- bump pyright version
- improve unit-test coverage
This commit is contained in:
Polina Bungina
2024-08-29 14:37:13 +02:00
committed by GitHub
parent c9322df095
commit 3ecdf01b50
7 changed files with 128 additions and 23 deletions
+7 -3
View File
@@ -175,7 +175,7 @@ class TestBootstrap(BaseTestPostgresql):
with patch('subprocess.call', Mock(return_value=1)):
self.assertFalse(self.b.bootstrap({}))
config = {'users': {'replicator': {'password': 'rep-pass', 'options': ['replication']}}}
config = {}
with patch.object(Postgresql, 'is_running', Mock(return_value=False)), \
patch.object(Postgresql, 'get_major_version', Mock(return_value=140000)), \
@@ -253,8 +253,12 @@ class TestBootstrap(BaseTestPostgresql):
self.assertFalse(task.result)
self.p.config._config.pop('pg_hba')
self.b.post_bootstrap({}, task)
self.assertTrue(task.result)
with patch('patroni.postgresql.bootstrap.logger.error', new_callable=Mock()) as mock_logger:
self.b.post_bootstrap({'users': 1}, task)
self.assertEqual(mock_logger.call_args_list[0][0][0],
'User creation is not be supported starting from v4.0.0. '
'Please use "boostrap.post_bootstrap" script to create users.')
self.assertTrue(task.result)
self.b.bootstrap(config)
with patch.object(Postgresql, 'pending_restart_reason',
+1 -1
View File
@@ -22,7 +22,7 @@ class TestCitus(BaseTestPostgresql):
self.cluster = get_cluster_initialized_with_leader()
self.cluster.workers[1] = self.cluster
@patch('time.time', Mock(side_effect=[100, 130, 160, 190, 220, 250, 280, 310, 340, 370]))
@patch('time.time', Mock(side_effect=[100, 130, 160, 190, 220, 250, 280, 310, 340, 370, 400, 430, 460, 490]))
@patch('patroni.postgresql.mpp.citus.logger.exception', Mock(side_effect=SleepException))
@patch('patroni.postgresql.mpp.citus.logger.warning')
@patch('patroni.postgresql.mpp.citus.PgDistTask.wait', Mock())