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

Allow most unit tests to run outside of a container.

Three major changes were required to get this working:

1) Provide the path to pgbackrest in the build directory when running outside a container.  Tests in a container will continue to install and run against /usr/bin/pgbackrest.

1) Set a per-test lock path so tests don't conflict on the default /tmp/pgbackrest path.  Also set a per-test log-path while we are at it.

2) Use localhost instead of a custom host for TLS test connections.  Tests in containers will continue to update /etc/hosts and use the custom host.

Add infrastructure and update harnessCfgLoad*() to get the correct exe and paths loaded for testing.

Since new tests are required to verify that running outside a container works, also rework the tests in Travis CI to provide coverage within a reasonable amount of time.  Mainly, break up to doc tests by VM and run an abbreviated unit test suite on co6 and co7.
This commit is contained in:
David Steele
2019-10-08 12:06:30 -04:00
parent 77b0c6c993
commit 45881c74ae
48 changed files with 808 additions and 682 deletions

View File

@@ -80,6 +80,9 @@ use constant VM_ARCH_AMD64 => 'amd64';
use constant VM_ALL => 'all';
push @EXPORT, qw(VM_ALL);
use constant VM_NONE => 'none';
push @EXPORT, qw(VM_NONE);
use constant VM_CO6 => 'co6';
push @EXPORT, qw(VM_CO6);
use constant VM_CO7 => 'co7';
@@ -115,12 +118,33 @@ use constant VM3 => VM_CO7;
use constant VM4 => VM_U18;
push @EXPORT, qw(VM4);
# List of default test VMs (in this order: newest, oldest, next newest, next oldest)
use constant VM_LIST => (VM4, VM1, VM3, VM2);
# List of default test VMs
use constant VM_LIST => (VM2, VM1, VM3, VM4);
push @EXPORT, qw(VM_LIST);
my $oyVm =
{
# None
&VM_NONE =>
{
&VM_OS_BASE => VM_OS_BASE_RHEL,
&VM_OS => VM_OS_CENTOS,
&VM_ARCH => VM_ARCH_AMD64,
&VMDEF_COVERAGE_C => true,
&VMDEF_PGSQL_BIN => '/usr/pgsql-{[version]}/bin',
&VMDEF_PERL_ARCH_PATH => '/usr/local/lib64/perl5',
&VM_DB =>
[
PG_VERSION_10,
],
&VM_DB_TEST =>
[
PG_VERSION_10,
],
},
# CentOS 6
&VM_CO6 =>
{