1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-06-14 23:44:58 +02:00

Add gcc 9 support.

A number of tests have been updated and Fedora 30 has been added to the test suite so the unit tests can run on gcc 9.

Stop running unit tests on co6/7 since we appear to have ample unit test coverage.
This commit is contained in:
David Steele
2019-10-09 15:03:03 -04:00
parent 528f4c4347
commit 7f369006b5
11 changed files with 67 additions and 11 deletions

View File

@ -14,14 +14,15 @@ services:
matrix:
include:
- env: PGB_CI="--vm=u12 test"
- env: PGB_CI="--vm=f30 test"
- env: PGB_CI="--vm=co6 test"
- env: PGB_CI="--vm=co7 test"
- env: PGB_CI="--vm=u18 test"
- env: PGB_CI="--vm=u18 doc"
- env: PGB_CI="--vm=co7 test"
- dist: bionic
env: PGB_CI="--vm=none test"
- env: PGB_CI="--vm=co7 doc"
- env: PGB_CI="--vm=co6 doc"
- env: PGB_CI="--vm=co7 doc"
install:
- umask 0022

View File

@ -9,10 +9,13 @@
# - if Dockerfile has not changed, comment out vm hash below and use --vm-force when building
#
# To upload a new image:
# - docker login
# - docker login -u pgbackrest
# - docker tag pgbackrest/test:{vm}-base pgbackrest/test:{vm}-base-YYYYMMDDA
# - docker push pgbackrest/test:{vm}-base-YYYYMMDDA
# **********************************************************************************************************************************
20191009A:
f30: 8b21005a76a74f1e34bc86ccb319b7d56ec3586d
20190926A:
u18: 9a6456313490a68de01e5bae6876b1d598a00ef5

View File

@ -99,6 +99,7 @@ sub process
" - env: PGB_CI=\"--vm=u18 doc\"\n" .
" - dist: bionic\n" .
" env: PGB_CI=\"--vm=none test\"\n" .
" env: PGB_CI=\"--vm=f30 test\"\n" .
" - env: PGB_CI=\"--vm=co7 doc\"\n" .
" - env: PGB_CI=\"--vm=co6 doc\"\n";

View File

@ -493,6 +493,13 @@ sub containerBuild
" https://download.postgresql.org/pub/repos/yum/11/redhat/rhel-7-x86_64/" .
"pgdg-redhat-repo-latest.noarch.rpm && \\\n";
}
elsif ($strOS eq VM_F30)
{
$strScript .=
" rpm -ivh \\\n" .
" https://download.postgresql.org/pub/repos/yum/reporpms/F-30-x86_64/" .
"pgdg-fedora-repo-latest.noarch.rpm && \\\n";
}
$strScript .= " yum -y install postgresql-devel";
}

View File

@ -455,7 +455,8 @@ sub run
# Flags used to build test.c
my $strTestFlags =
($self->{bDebug} ? '-DDEBUG_TEST_TRACE ' : '') .
'-O0' . ($self->{oTest}->{&TEST_VM} ne VM_U12 ? ' -ftree-coalesce-vars' : '') .
($self->{oTest}->{&TEST_VM} eq VM_F30 ? '-O2' : '-O0') .
($self->{oTest}->{&TEST_VM} ne VM_U12 ? ' -ftree-coalesce-vars' : '') .
(vmCoverageC($self->{oTest}->{&TEST_VM}) && $self->{bCoverageUnit} ?
' -fprofile-arcs -ftest-coverage' : '') .
($self->{oTest}->{&TEST_CTESTDEF} ? " $self->{oTest}->{&TEST_CTESTDEF}" : '');
@ -466,7 +467,8 @@ sub run
# Flags used to build all other files
my $strBuildFlags =
($self->{bOptimize} ? '-O2' : '-O0' . ($self->{oTest}->{&TEST_VM} ne VM_U12 ? ' -ftree-coalesce-vars' : ''));
($self->{bOptimize} || $self->{oTest}->{&TEST_VM} eq VM_F30 ?
'-O2' : '-O0' . ($self->{oTest}->{&TEST_VM} ne VM_U12 ? ' -ftree-coalesce-vars' : ''));
buildPutDiffers(
$self->{oStorageTest}, "$self->{strGCovPath}/buildflags",

View File

@ -87,6 +87,8 @@ use constant VM_CO6 => 'co6';
push @EXPORT, qw(VM_CO6);
use constant VM_CO7 => 'co7';
push @EXPORT, qw(VM_CO7);
use constant VM_F30 => 'f30';
push @EXPORT, qw(VM_F30);
use constant VM_U12 => 'u12';
push @EXPORT, qw(VM_U12);
use constant VM_U14 => 'u14';
@ -202,6 +204,34 @@ my $oyVm =
],
},
# Fedora 30
&VM_F30 =>
{
&VM_OS_BASE => VM_OS_BASE_RHEL,
&VM_OS => VM_OS_CENTOS,
&VM_IMAGE => 'fedora:30',
&VM_ARCH => VM_ARCH_AMD64,
&VMDEF_PGSQL_BIN => '/usr/pgsql-{[version]}/bin',
&VMDEF_PERL_ARCH_PATH => '/usr/local/lib64/perl5',
&VMDEF_DEBUG_INTEGRATION => false,
&VM_DB =>
[
PG_VERSION_94,
PG_VERSION_95,
PG_VERSION_96,
PG_VERSION_10,
PG_VERSION_11,
PG_VERSION_12,
],
&VM_DB_TEST =>
[
PG_VERSION_11,
],
},
# Debian 8
&VM_D8 =>
{

View File

@ -106,7 +106,7 @@ sub run
# Attempt to reconstruct from an encypted archived WAL for an unencrypted repo
#---------------------------------------------------------------------------------------------------------------------------
# Prepend encryption Magic signature to simulate encryption
executeTest('echo "' . CIPHER_MAGIC . '$(cat ' . $strArchiveFile . ')" > ' . $strArchiveFile);
executeTest('echo "' . CIPHER_MAGIC . '" > ' . $strArchiveFile);
$self->testException(sub {$oArchiveInfo->reconstruct(PG_VERSION_94, $self->dbSysId(PG_VERSION_94))}, ERROR_CRYPTO,
"encryption incompatible for '$strArchiveFile'" .

View File

@ -522,7 +522,7 @@ hrnDiff(const char *actual, const char *expected)
hrnFileWrite(expectedFile, (unsigned char *)expected, strlen(expected));
// Perform diff
char command[2048];
char command[2560];
snprintf(command, sizeof(command), "diff -u %s %s > %s/diff.result", actualFile, expectedFile, testDataPath());
if (system(command) == 2)

View File

@ -241,7 +241,7 @@ testRun(void)
", 123456781234567812345678-bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb.gz"
"\nHINT: are multiple primaries archiving to this stanza?");
TEST_RESULT_STR(
TEST_RESULT_PTR(
walSegmentFind(storageRepo(), strNew("9.6-2"), strNew("123456781234567812345678.partial"), 0), NULL,
"did not find partial segment");
}

View File

@ -12,8 +12,17 @@ testRun(void)
// *****************************************************************************************************************************
if (testBegin("regExpNew(), regExpMatch(), and regExpFree()"))
{
// Error message varies based on the libc version
TRY_BEGIN()
{
TEST_ERROR(regExpNew(strNew("[[[")), FormatError, "Unmatched [ or [^");
}
CATCH(AssertError)
{
TEST_ERROR(regExpNew(strNew("[[[")), FormatError, "Unmatched [, [^, [:, [., or [=");
}
TRY_END();
RegExp *regExp = NULL;
TEST_ASSIGN(regExp, regExpNew(strNew("^abc")), "new regexp");
@ -50,7 +59,6 @@ testRun(void)
// *****************************************************************************************************************************
if (testBegin("regExpMatchOne()"))
{
TEST_ERROR(regExpMatchOne(strNew("[[["), strNew("")), FormatError, "Unmatched [ or [^");
TEST_RESULT_BOOL(regExpMatchOne(strNew("^abc"), strNew("abcdef")), true, "match regexp");
TEST_RESULT_BOOL(regExpMatchOne(strNew("^abc"), strNew("bcdef")), false, "no match regexp");
}

View File

@ -203,9 +203,13 @@ eval
{
$strParam .= " --container-only";
}
elsif ($strVm eq VM_F30)
{
$strParam .= " --no-package --c-only";
}
elsif ($strVm ne VM_U12)
{
$strParam .= " --module=command --module=mock --module=real --module=storage --module=performance";
$strParam .= " --module=real";
}
}