Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd48477d

Browse files
[#258] Problems in ProbackupTest and TestBasic(ProbackupTest) are fixed (#259)
* [#258] Declaration of ProbackupTest::pg_node is correctedProbackupTest::pg_node is testgres.NodeApp, not testgres.PostgresNode.Asserts are added.* [#258] TestBasic::test_full_backup cleans node objectNode cleanup is added.TODO: we should to stop node only and cleanup his data in conftest.
1 parent354de69 commitd48477d

File tree

1 file changed

+22
-13
lines changed

1 file changed

+22
-13
lines changed

‎testgres/plugins/pg_probackup2/pg_probackup2/tests/test_basic.py

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212

1313
classProbackupTest:
14-
pg_node:testgres.PostgresNode
14+
pg_node:testgres.NodeApp
1515

1616
@staticmethod
1717
defprobackup_is_available()->bool:
@@ -75,21 +75,30 @@ def helper__build_backup_dir(self, backup='backup'):
7575
@pytest.mark.skipif(notProbackupTest.probackup_is_available(),reason="Check that PGPROBACKUPBIN is defined and is valid.")
7676
classTestBasic(ProbackupTest):
7777
deftest_full_backup(self):
78+
assertself.pg_nodeisnotNone
79+
asserttype(self.pg_node)==testgres.NodeApp# noqa: E721
80+
assertself.pbisnotNone
81+
asserttype(self.pb)==ProbackupApp# noqa: E721
82+
7883
# Setting up a simple test node
7984
node=self.pg_node.make_simple('node',pg_options={"fsync":"off","synchronous_commit":"off"})
8085

81-
# Initialize and configure Probackup
82-
self.pb.init()
83-
self.pb.add_instance('node',node)
84-
self.pb.set_archiving('node',node)
86+
assertnodeisnotNone
87+
asserttype(node)==testgres.PostgresNode# noqa: E721
88+
89+
withnode:
90+
# Initialize and configure Probackup
91+
self.pb.init()
92+
self.pb.add_instance('node',node)
93+
self.pb.set_archiving('node',node)
8594

86-
# Start the node and initialize pgbench
87-
node.slow_start()
88-
node.pgbench_init(scale=100,no_vacuum=True)
95+
# Start the node and initialize pgbench
96+
node.slow_start()
97+
node.pgbench_init(scale=100,no_vacuum=True)
8998

90-
# Perform backup and validation
91-
backup_id=self.pb.backup_node('node',node)
92-
out=self.pb.validate('node',backup_id)
99+
# Perform backup and validation
100+
backup_id=self.pb.backup_node('node',node)
101+
out=self.pb.validate('node',backup_id)
93102

94-
# Check if the backup is valid
95-
assertf"INFO: Backup{backup_id} is valid"inout
103+
# Check if the backup is valid
104+
assertf"INFO: Backup{backup_id} is valid"inout

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp