Skip to content

Commit

Permalink
move test_basic_full_backup => test_full_backup
Browse files Browse the repository at this point in the history
run it in separate travis action
+ add same test with stream replication
  • Loading branch information
funny-falcon committed Nov 16, 2022
1 parent 348283b commit 8c670f0
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ env:
- PG_VERSION=10 PG_BRANCH=REL_10_STABLE
- PG_VERSION=9.6 PG_BRANCH=REL9_6_STABLE
- PG_VERSION=9.5 PG_BRANCH=REL9_5_STABLE
# - PG_VERSION=13 PG_BRANCH=REL_13_STABLE PTRACK_PATCH_PG_BRANCH=OFF MODE=archive
- PG_VERSION=15 PG_BRANCH=REL_15_STABLE PTRACK_PATCH_PG_BRANCH=OFF MODE=backup.BackupTest.test_full_backup
- PG_VERSION=15 PG_BRANCH=REL_15_STABLE PTRACK_PATCH_PG_BRANCH=OFF MODE=backup.BackupTest.test_full_backup_stream
# - PG_VERSION=13 PG_BRANCH=REL_13_STABLE PTRACK_PATCH_PG_BRANCH=REL_13_STABLE MODE=backup
# - PG_VERSION=13 PG_BRANCH=REL_13_STABLE PTRACK_PATCH_PG_BRANCH=REL_13_STABLE MODE=catchup
# - PG_VERSION=13 PG_BRANCH=REL_13_STABLE PTRACK_PATCH_PG_BRANCH=REL_13_STABLE MODE=checkdb
Expand Down
34 changes: 33 additions & 1 deletion tests/backup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

class BackupTest(ProbackupTest, unittest.TestCase):

def test_basic_full_backup(self):
def test_full_backup(self):
"""
Just test full backup with at least two segments
"""
Expand Down Expand Up @@ -45,6 +45,38 @@ def test_basic_full_backup(self):
# Clean after yourself
self.del_test_dir(module_name, fname)

def test_full_backup_stream(self):
"""
Just test full backup with at least two segments in stream mode
"""
fname = self.id().split('.')[3]
node = self.make_simple_node(
base_dir=os.path.join(module_name, fname, 'node'),
initdb_params=['--data-checksums'],
# we need to write a lot. Lets speedup a bit.
pg_options={"fsync": "off", "synchronous_commit": "off"})

backup_dir = os.path.join(self.tmp_path, module_name, fname, 'backup')
self.init_pb(backup_dir)
self.add_instance(backup_dir, 'node', node)
node.slow_start()

# Fill with data
# Have to use scale=100 to create second segment.
node.pgbench_init(scale=100, no_vacuum=True)

# FULL
backup_id = self.backup_node(backup_dir, 'node', node,
options=["--stream"])

out = self.validate_pb(backup_dir, 'node', backup_id)
self.assertIn(
"INFO: Backup {0} is valid".format(backup_id),
out)

# Clean after yourself
self.del_test_dir(module_name, fname)

# @unittest.skip("skip")
# @unittest.expectedFailure
# PGPRO-707
Expand Down

0 comments on commit 8c670f0

Please sign in to comment.