1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-03-05 15:05:48 +02:00

Run non version specific real/tests on the expect version.

There are a few non version specific tests that need to be run in integration because we can't get coverage in the unit tests.

To save some time we'll only run those tests against the same version we use for expect testing.
This commit is contained in:
David Steele 2020-07-15 13:19:16 -04:00
parent 574f36c9d2
commit 88b0f6245d

View File

@ -78,12 +78,15 @@ sub run
my $bRepoEncrypt = $rhRun->{encrypt};
my $strCompressType = $rhRun->{compress};
# Use a specific VM and version of PostgreSQL for expect testing. This version will also be used to run tests that are not
# version specific.
my $bExpectVersion = $self->vm() eq VM_EXPECT && $self->pgVersion() eq PG_VERSION_96;
# Increment the run, log, and decide whether this unit test should be run
next if (!$self->begin(
"bkp ${bHostBackup}, sby ${bHostStandby}, dst ${strBackupDestination}, cmp ${strCompressType}" .
", storage ${strStorage}, enc ${bRepoEncrypt}",
# Use the most recent db version on the expect vm for expect testing
$self->vm() eq VM_EXPECT && $self->pgVersion() eq PG_VERSION_96));
$bExpectVersion));
# Create hosts, file object, and config
my ($oHostDbPrimary, $oHostDbStandby, $oHostBackup) = $self->setup(
@ -417,7 +420,10 @@ sub run
{strOptionalParam => ' --buffer-size=16384'});
# Make a new backup with expire-auto disabled then run the expire command and compare backup numbers to ensure that expire
# was really disabled
# was really disabled. This test is not version specific so is run on only the expect version.
#---------------------------------------------------------------------------------------------------------------------------
if ($bExpectVersion)
{
$oBackupInfo = new pgBackRestTest::Env::BackupInfo($oHostBackup->repoBackupPath());
push(my @backupLst1, $oBackupInfo->list());
@ -437,6 +443,7 @@ sub run
{
confess "expire-auto option didn't work as expected";
}
}
# Enabled async archiving
$oHostBackup->configUpdate({&CFGDEF_SECTION_GLOBAL => {'archive-async' => 'y'}});
@ -552,9 +559,10 @@ sub run
# Execute stop and make sure the backup fails
#---------------------------------------------------------------------------------------------------------------------------
# Restart the cluster to check for any errors before continuing since the stop tests will definitely create errors and
# the logs will to be deleted to avoid causing issues further down the line.
if ($strStorage eq POSIX)
# Restart the cluster to check for any errors before continuing since the stop tests will definitely create errors and the
# logs will to be deleted to avoid causing issues further down the line. This test is not version specific so is run on only
# the expect version.
if ($bExpectVersion)
{
$oHostDbPrimary->clusterRestart();
@ -993,11 +1001,14 @@ sub run
CFGOPTVAL_BACKUP_TYPE_INCR, 'succeed on --no-online with --force',
{strOptionalParam => '--no-online --force' . $strBogusReset});
# Stanza-delete --force without access to pgbackrest on database host
# Stanza-delete --force without access to pgbackrest on database host. This test is not version specific so is run on only
# the expect version.
#---------------------------------------------------------------------------------------------------------------------------
# With stanza-delete --force, allow stanza to be deleted regardless of accessibility of database host
if ($bHostBackup)
if ($bExpectVersion)
{
# Make sure this test has a backup host to work with
confess "test must run with backup dst = " . HOST_BACKUP if !$bHostBackup;
$oHostDbPrimary->stop();
$oHostBackup->stop({strStanza => $self->stanza});
$oHostBackup->stanzaDelete(