diff --git a/doc/xml/release.xml b/doc/xml/release.xml index 4e9afd9cb..57e3659a9 100644 --- a/doc/xml/release.xml +++ b/doc/xml/release.xml @@ -86,6 +86,10 @@

Full unit test coverage for gzip filter.

+ + +

Only check expect logs on CentOS 7. Variations in distros cause false negatives in tests but don't add much value.

+
diff --git a/test/lib/pgBackRestTest/Common/RunTest.pm b/test/lib/pgBackRestTest/Common/RunTest.pm index 7d15ab059..5546d53cf 100644 --- a/test/lib/pgBackRestTest/Common/RunTest.pm +++ b/test/lib/pgBackRestTest/Common/RunTest.pm @@ -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, diff --git a/test/lib/pgBackRestTest/Common/VmTest.pm b/test/lib/pgBackRestTest/Common/VmTest.pm index 312a54f87..63f7aaec2 100644 --- a/test/lib/pgBackRestTest/Common/VmTest.pm +++ b/test/lib/pgBackRestTest/Common/VmTest.pm @@ -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); diff --git a/test/lib/pgBackRestTest/Module/Real/RealAllTest.pm b/test/lib/pgBackRestTest/Module/Real/RealAllTest.pm index cff5649df..02847576a 100644 --- a/test/lib/pgBackRestTest/Module/Real/RealAllTest.pm +++ b/test/lib/pgBackRestTest/Module/Real/RealAllTest.pm @@ -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; } diff --git a/test/test.pl b/test/test.pl index c96655b1a..a2ad82f9d 100755 --- a/test/test.pl +++ b/test/test.pl @@ -214,7 +214,7 @@ eval $bNoLint = true; $bSmart = true; $bNoPackage = true; - $strVm = VM_CO7; + $strVm = VM_EXPECT; $strDbVersion = '9.6'; $bLogForce = true; }