1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2024-12-12 10:04:14 +02:00

Update CI to use Ubuntu 22.04 and Fedora 36.

Both have newer gcc and OpenSSL 3.

Fedora 36 runs horribly slow with valgrind enabled so run the valgrind tests on Ubuntu 22.04. Fedora 36 has a newer gcc so it is still worth testing on.
This commit is contained in:
David Steele 2022-06-06 16:32:20 -04:00
parent 08242ee6ac
commit a16cf5eac7
8 changed files with 83 additions and 49 deletions

View File

@ -38,10 +38,13 @@ jobs:
- param: doc --vm=u18
# All integration tests
- param: test --vm=u20 --param=build-package --param=module=mock --param=module=real
- param: test --vm=u22 --param=build-package --param=module=mock --param=module=real
# All unit tests (with coverage) on the newest gcc available
- param: test --vm=f33 --param=c-only --param=tz=America/New_York
# All unit tests with coverage and alternate timezone
- param: test --vm=u22 --param=c-only --param=tz=America/New_York
# All unit tests on the newest gcc available
- param: test --vm=f36 --param=c-only --param=no-valgrind --param=no-coverage --param=no-performance
# RHEL documentation
- param: doc --vm=rh8

View File

@ -1,7 +1,7 @@
# export PGB=pgbackrest;export PGB_IMAGE=$PGB/test:u20-main;PGB_REPO=~/Documents/Code/$PGB
# export PGB=pgbackrest;export PGB_IMAGE=$PGB/test:u22-main;PGB_REPO=~/Documents/Code/$PGB
# docker build --squash -f $PGB_REPO/test/Dockerfile -t $PGB_IMAGE .
# docker run --privileged -itd --name $PGB-test -h $PGB-test -v $PGB_REPO:/home/vagrant/$PGB $PGB_IMAGE
FROM ubuntu:focal
FROM ubuntu:jammy
# Install packages
RUN apt-get update
@ -19,14 +19,6 @@ RUN curl -fsSL https://get.docker.com | sh
# Create vagrant user
RUN adduser --ingroup=docker -uid=5000 --disabled-password --gecos \"\" vagrant
# Build valgrind
RUN export VALGRIND=valgrind-3.17.0 && \
wget -q -O - https://sourceware.org/pub/valgrind/${VALGRIND?}.tar.bz2 | tar jx -C /root && \
cd /root/${VALGRIND?} && \
./configure --silent && \
make -s -j8 install && \
rm -rf /root/${VALGRIND?}
# Configure sudo
RUN echo '%docker ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers

15
test/Vagrantfile vendored
View File

@ -14,8 +14,8 @@ Vagrant.configure(2) do |config|
# Full development and test environment which should be used by default.
#-------------------------------------------------------------------------------------------------------------------------------
config.vm.define "default", primary: true do |default|
default.vm.box = "ubuntu/focal64"
default.vm.box_version = "20211007.0.0"
default.vm.box = "ubuntu/jammy64"
default.vm.box_version = "20220423.0.0"
default.vm.provider :virtualbox do |vb|
vb.name = "pgbackrest-test"
@ -76,7 +76,7 @@ Vagrant.configure(2) do |config|
echo 'Install Build Tools' && date
apt-get install -y devscripts build-essential lintian git cloc txt2man debhelper libssl-dev zlib1g-dev libperl-dev \
libxml2-dev liblz4-dev liblz4-tool libpq-dev lcov autoconf-archive zstd libzstd-dev bzip2 libbz2-dev pkg-config \
libyaml-dev libc6-dbg meson ccache
libyaml-dev libc6-dbg valgrind meson ccache
#-----------------------------------------------------------------------------------------------------------------------
echo 'Install Docker' && date
@ -87,15 +87,6 @@ Vagrant.configure(2) do |config|
echo 'Install Dev Utilities' && date
apt-get install -y vim htop jq
#-----------------------------------------------------------------------------------------------------------------------
echo 'Build valgrind' && date
export VALGRIND=valgrind-3.17.0
wget -q -O - https://sourceware.org/pub/valgrind/${VALGRIND?}.tar.bz2 | tar jx -C /root
cd /root/${VALGRIND?}
./configure
make -j8 install
rm -rf /root/${VALGRIND?}
#-----------------------------------------------------------------------------------------------------------------------
# echo 'Install TeX Live' && date
# Not installed by default since latex is only needed for releases and PDF development/testing

View File

@ -12,12 +12,13 @@
# - docker login -u pgbackrest
# - VM=XXX;DATE=YYYYMMDDX;BASE=pgbackrest/test:${VM?}-base;docker tag ${BASE?} ${BASE?}-${DATE?} && docker push ${BASE?}-${DATE?}
# **********************************************************************************************************************************
20220606A:
x86_64:
f36: 876069489d2b58e505cbd46366076447fd56aa5a
u22: 592b61a9db5f0418b027318548f9af1480ada7e1
20220519A:
x86_64:
u18: 36f27a31ed9af97fcbfaba09794c719c225f885d
u20: 17c74ed3fd3d76119f672740d77caf873fc57bac
rh7: 31d4a6c10534e69bc0251e11d86ee9b00971d823
20210902A:
x86_64:
f33: 04b3353c5fcc859c9df528e2fa78e6ed73c6390b

View File

@ -403,6 +403,11 @@ sub containerBuild
{
$strScript .= " g++-multilib";
}
if ($strOS eq VM_U22)
{
$strScript .= " valgrind";
}
}
# Add zst command-line tool and development libs when available
@ -442,15 +447,18 @@ sub containerBuild
}
#---------------------------------------------------------------------------------------------------------------------------
my $strValgrind = 'valgrind-3.17.0';
if ($strOS ne VM_U22 && $strOS ne VM_F36)
{
my $strValgrind = 'valgrind-3.17.0';
$strScript .= sectionHeader() .
"# Build valgrind\n" .
" wget -q -O - https://sourceware.org/pub/valgrind/${strValgrind}.tar.bz2 | tar jx -C /root && \\\n" .
" cd /root/${strValgrind} && \\\n" .
" ./configure --silent && \\\n" .
" make -s -j8 install && \\\n" .
" rm -rf /root/${strValgrind}";
$strScript .= sectionHeader() .
"# Build valgrind\n" .
" wget -q -O - https://sourceware.org/pub/valgrind/${strValgrind}.tar.bz2 | tar jx -C /root && \\\n" .
" cd /root/${strValgrind} && \\\n" .
" ./configure --silent && \\\n" .
" make -s -j8 install && \\\n" .
" rm -rf /root/${strValgrind}";
}
#---------------------------------------------------------------------------------------------------------------------------
if (defined($oVm->{$strOS}{&VMDEF_LCOV_VERSION}))
@ -484,11 +492,11 @@ sub containerBuild
" https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-" . hostArch() . "/" .
"pgdg-redhat-repo-latest.noarch.rpm && \\\n";
}
elsif ($strOS eq VM_F33)
elsif ($strOS eq VM_F36)
{
$strScript .=
" rpm -ivh \\\n" .
" https://download.postgresql.org/pub/repos/yum/reporpms/F-33-" . hostArch() . "/" .
" https://download.postgresql.org/pub/repos/yum/reporpms/F-36-" . hostArch() . "/" .
"pgdg-fedora-repo-latest.noarch.rpm && \\\n";
}
@ -498,7 +506,7 @@ sub containerBuild
{
$strScript .=
" echo \"deb http://apt.postgresql.org/pub/repos/apt/ \$(lsb_release -s -c)-pgdg main" .
($strOS eq VM_U20 ? ' 15' : '') . "\" >> /etc/apt/sources.list.d/pgdg.list && \\\n" .
($strOS eq VM_U20 || $strOS eq VM_U22 ? ' 15' : '') . "\" >> /etc/apt/sources.list.d/pgdg.list && \\\n" .
" wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - && \\\n" .
" apt-get update && \\\n" .
" apt-get install -y --no-install-recommends postgresql-common libpq-dev && \\\n" .

View File

@ -118,7 +118,7 @@ sub coverageExtract
executeTest(
(defined($strContainerImage) ? 'docker exec -i -u ' . TEST_USER . " ${strContainerImage} " : '') .
"${strLCovExe} --capture --directory=${strWorkUnitPath} --o=${strLCovOut}");
"${strLCovExe} --capture --directory=${strWorkUnitPath} --o=${strLCovOut} 2>&1");
# Generate coverage report for each module
foreach my $strCoveredModule (@stryCoveredModule)

View File

@ -82,19 +82,21 @@ use constant VM_RH7 => 'rh7';
push @EXPORT, qw(VM_RH7);
use constant VM_RH8 => 'rh8';
push @EXPORT, qw(VM_RH8);
use constant VM_F33 => 'f33';
push @EXPORT, qw(VM_F33);
use constant VM_F36 => 'f36';
push @EXPORT, qw(VM_F36);
use constant VM_U18 => 'u18';
push @EXPORT, qw(VM_U18);
use constant VM_U20 => 'u20';
push @EXPORT, qw(VM_U20);
use constant VM_U22 => 'u22';
push @EXPORT, qw(VM_U22);
# VM aliases for run matrices (numbered oldest to newest)
use constant VM2 => VM_U18;
push @EXPORT, qw(VM2);
use constant VM3 => VM_RH7;
push @EXPORT, qw(VM3);
use constant VM4 => VM_U20;
use constant VM4 => VM_U22;
push @EXPORT, qw(VM4);
# List of default test VMs
@ -154,11 +156,11 @@ my $oyVm =
],
},
# Fedora 33
&VM_F33 =>
# Fedora 36
&VM_F36 =>
{
&VM_OS_BASE => VM_OS_BASE_RHEL,
&VM_IMAGE => 'fedora:33',
&VM_IMAGE => 'fedora:36',
&VM_ARCH => VM_ARCH_AMD64,
&VMDEF_PGSQL_BIN => '/usr/pgsql-{[version]}/bin',
&VMDEF_COVERAGE_C => true,
@ -168,11 +170,11 @@ my $oyVm =
&VM_DB =>
[
PG_VERSION_96,
PG_VERSION_10,
PG_VERSION_11,
PG_VERSION_12,
PG_VERSION_13,
PG_VERSION_14,
],
&VM_DB_TEST =>
@ -249,6 +251,43 @@ my $oyVm =
PG_VERSION_15,
],
},
# Ubuntu 22.04
&VM_U22 =>
{
&VM_OS_BASE => VM_OS_BASE_DEBIAN,
&VM_IMAGE => 'ubuntu:22.04',
&VM_ARCH => VM_ARCH_AMD64,
&VMDEF_COVERAGE_C => true,
&VMDEF_PGSQL_BIN => '/usr/lib/postgresql/{[version]}/bin',
&VMDEF_WITH_BACKTRACE => true,
&VMDEF_WITH_ZST => true,
&VM_DB =>
[
PG_VERSION_90,
PG_VERSION_91,
PG_VERSION_92,
PG_VERSION_93,
PG_VERSION_94,
PG_VERSION_95,
PG_VERSION_96,
PG_VERSION_10,
PG_VERSION_11,
PG_VERSION_12,
PG_VERSION_13,
PG_VERSION_14,
PG_VERSION_15,
],
&VM_DB_TEST =>
[
PG_VERSION_95,
PG_VERSION_96,
PG_VERSION_15,
],
},
};
####################################################################################################################################

View File

@ -792,7 +792,7 @@ eval
# Patch files in debian package builds
#
# Use these commands to create a new patch (may need to modify first line):
# BRDIR=/home/vagrant/pgbackrest;BRVM=u20;BRPATCHFILE=${BRDIR?}/test/patch/debian-package.patch
# BRDIR=/home/vagrant/pgbackrest;BRVM=u22;BRPATCHFILE=${BRDIR?}/test/patch/debian-package.patch
# DBDIR=${BRDIR?}/test/result/package/${BRVM}/debian
# diff -Naur ${DBDIR?}.old ${DBDIR}.new > ${BRPATCHFILE?}
my $strDebianPackagePatch = "${strBackRestBase}/test/patch/debian-package.patch";