1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-09-16 09:06:18 +02:00

Only check expect logs on CentOS 7.

Variations in distros cause false negatives in tests but don't add much value.
This commit is contained in:
David Steele
2017-11-14 17:16:39 -05:00
parent 3ee269c099
commit 22fe684b1f
5 changed files with 31 additions and 17 deletions

View File

@@ -86,6 +86,10 @@
<release-item>
<p>Full unit test coverage for gzip filter.</p>
</release-item>
<release-item>
<p>Only check expect logs on CentOS 7. Variations in distros cause false negatives in tests but don't add much value.</p>
</release-item>
</release-refactor-list>
</release-test-list>
</release>

View File

@@ -201,14 +201,19 @@ sub begin
$self->end();
# If bExpect is defined then it is an override of the default
if (defined($bExpect))
$self->{bExpect} = false;
if ($self->vm() eq VM_EXPECT)
{
$self->{bExpect} = $bExpect;
}
# Else get the default expect setting
else
{
$self->{bExpect} = (testDefModuleTest($self->{strModule}, $self->{strModuleTest}))->{&TESTDEF_EXPECT};
if (defined($bExpect))
{
$self->{bExpect} = $bExpect;
}
# Else get the default expect setting
else
{
$self->{bExpect} = (testDefModuleTest($self->{strModule}, $self->{strModuleTest}))->{&TESTDEF_EXPECT};
}
}
# Increment the run counter;
@@ -237,8 +242,9 @@ sub begin
$strExe, dirname($self->testPath()), $self->basePath(), $self->module(), $self->moduleTest(), $self->runCurrent(),
true);
}
# Else if the module is defined then create a ExpectTest object
elsif ($self->doExpect())
# Create an ExpectTest object
if ($self->doExpect())
{
$self->{oExpect} = new pgBackRestTest::Common::LogTest(
$self->module(), $self->moduleTest(), $self->runCurrent(), $self->doLogForce(), $strDescription, $strExe,

View File

@@ -79,6 +79,10 @@ use constant VM_D8 => 'd8';
use constant VM_D9 => 'd9';
push @EXPORT, qw(VM_D9);
# Defines the vm that will be used for expect testing
use constant VM_EXPECT => VM_CO7;
push @EXPORT, qw(VM_EXPECT);
# Defines the host VM (the VM that the containers run in)
use constant VM_HOST_DEFAULT => VM_U16;
push @EXPORT, qw(VM_HOST_DEFAULT);

View File

@@ -59,19 +59,19 @@ sub run
my $bRepoEncrypt = ($bCompress && !$bS3) ? true : false;
# Increment the run, log, and decide whether this unit test should be run
my $hyVm = vmGet();
my $strDbVersionMostRecent = ${$hyVm->{$self->vm()}{&VM_DB_TEST}}[-1];
next if (!$self->begin(
"bkp ${bHostBackup}, sby ${bHostStandby}, dst ${strBackupDestination}, cmp ${bCompress}, s3 ${bS3}, " .
"enc ${bRepoEncrypt}",
$self->pgVersion() eq PG_VERSION_96));
# Use the most recent db version on the expect vm for expect testing
$self->vm() eq VM_EXPECT && $self->pgVersion() eq $strDbVersionMostRecent));
# Skip when s3 and host backup tests when there is more than one version of pg being tested and this is not the last one
my $hyVm = vmGet();
if (($bS3 || $bHostBackup) &&
(@{$hyVm->{$self->vm()}{&VM_DB_TEST}} > 1 && ${$hyVm->{$self->vm()}{&VM_DB_TEST}}[-1] ne $self->pgVersion()))
if (($bS3 || $bHostBackup) && (@{$hyVm->{$self->vm()}{&VM_DB_TEST}} > 1 && $strDbVersionMostRecent ne $self->pgVersion()))
{
&log(INFO,
'skipped - this test is run this OS using PG ' . ${$hyVm->{$self->vm()}{&VM_DB_TEST}}[-1]);
&log(INFO, "skipped - this test is run this OS using PG ${strDbVersionMostRecent}");
next;
}

View File

@@ -214,7 +214,7 @@ eval
$bNoLint = true;
$bSmart = true;
$bNoPackage = true;
$strVm = VM_CO7;
$strVm = VM_EXPECT;
$strDbVersion = '9.6';
$bLogForce = true;
}