Skip to content

Regression

Regression #688

name: Regression
on:
schedule:
# run daily 20:00 on main branch
- cron: '0 20 * * *'
push:
branches:
- prerelease_test
pull_request:
jobs:
matrixbuilder:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Checkout source code
uses: actions/checkout@v2
- name: Build matrix
id: set-matrix
run: python scripts/gh_matrix_builder.py ${{ github.event_name }}
regress:
name: PG${{ matrix.pg }}${{ matrix.snapshot }} ${{ matrix.name }} ${{ matrix.os }}
needs: matrixbuilder
runs-on: ${{ matrix.os }}
strategy:
matrix: ${{ fromJson(needs.matrixbuilder.outputs.matrix) }}
fail-fast: false
env:
PG_SRC_DIR: pgbuild
PG_INSTALL_DIR: postgresql
MAKE_JOBS: 6
CLANG: ${{ matrix.clang }}
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}
steps:
- name: Install Linux Dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install flex bison lcov systemd-coredump gdb libipc-run-perl libtest-most-perl ${{ matrix.extra_packages }}
- name: Install macOS Dependencies
if: runner.os == 'macOS'
run: |
# This is needed because GitHub image macos-10.15 version
# 20210927.1 did not install OpenSSL so we install openssl
# explicitly.
brew install openssl
sudo perl -MCPAN -e "CPAN::Shell->notest('install', 'IPC::Run')"
sudo perl -MCPAN -e "CPAN::Shell->notest('install', 'Test::Most')"
# on macOS the path used is depending on the runner version leading to cache failure
# when the runner version changes so we extract runner version from path and add it
# as cache suffix
- name: Cache suffix
if: runner.os == 'macOS'
run: echo "CACHE_SUFFIX=-${ImageVersion}" >> $GITHUB_ENV
# we cache the build directory instead of the install directory here
# because extension installation will write files to install directory
# leading to a tainted cache
- name: Cache PostgreSQL ${{ matrix.pg }} ${{ matrix.build_type }}
id: cache-postgresql
if: matrix.snapshot != 'snapshot'
uses: actions/cache@v2
with:
path: ~/${{ env.PG_SRC_DIR }}
key: ${{ matrix.os }}-postgresql-${{ matrix.pg }}-${{ matrix.cc }}-${{ matrix.build_type }}${{ env.CACHE_SUFFIX }}
- name: Build PostgreSQL ${{ matrix.pg }}${{ matrix.snapshot }} ${{ matrix.build_type }}
if: steps.cache-postgresql.outputs.cache-hit != 'true'
run: |
if [ "${{ matrix.snapshot }}" = "snapshot" ]; then
wget -q -O postgresql.tar.bz2 https://ftp.postgresql.org/pub/snapshot/${{ matrix.pg }}/postgresql-${{ matrix.pg }}-snapshot.tar.bz2
else
wget -q -O postgresql.tar.bz2 https://ftp.postgresql.org/pub/source/v${{ matrix.pg }}/postgresql-${{ matrix.pg }}.tar.bz2
fi
mkdir -p ~/$PG_SRC_DIR
tar --extract --file postgresql.tar.bz2 --directory ~/$PG_SRC_DIR --strip-components 1
cd ~/$PG_SRC_DIR
if [[ "${{ runner.os }}" == "Linux" ]]; then
./configure --prefix=$HOME/$PG_INSTALL_DIR ${{ matrix.pg_build_args }} --with-llvm LLVM_CONFIG=${{ matrix.llvm_config }} --with-openssl --without-readline --without-zlib --without-libxml ${{ matrix.pg_extra_args }}
else
# the current github macos image has a buggy llvm installation so we build without llvm on mac
./configure --prefix=$HOME/$PG_INSTALL_DIR ${{ matrix.pg_build_args }} --with-openssl --without-readline --without-zlib --without-libxml ${{ matrix.pg_extra_args }}
fi
make -j $MAKE_JOBS
make -j $MAKE_JOBS -C src/test/isolation
make -j $MAKE_JOBS -C contrib/postgres_fdw
- name: Install PostgreSQL ${{ matrix.pg }} ${{ matrix.build_type }}
run: |
make -C ~/$PG_SRC_DIR install
make -C ~/$PG_SRC_DIR/contrib/postgres_fdw install
- name: Checkout TimescaleDB
uses: actions/checkout@v2
- name: Test telemetry without OpenSSL
if: github.event_name != 'pull_request' && runner.os == 'Linux' && matrix.build_type == 'Debug'
run: |
BUILD_DIR=nossl ./bootstrap -DCMAKE_BUILD_TYPE=Debug -DPG_SOURCE_DIR=~/$PG_SRC_DIR -DPG_PATH=~/$PG_INSTALL_DIR ${{ matrix.tsdb_build_args }} -DUSE_OPENSSL=OFF
make -j $MAKE_JOBS -C nossl
make -C nossl install
make -C nossl regresscheck TESTS=telemetry
- name: Build TimescaleDB
run: |
./bootstrap -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DPG_SOURCE_DIR=~/$PG_SRC_DIR -DPG_PATH=~/$PG_INSTALL_DIR ${{ matrix.tsdb_build_args }} -DREQUIRE_ALL_TESTS=ON -DLINTER_STRICT=ON
make -j $MAKE_JOBS -C build
make -C build install
- name: Check exported symbols
run: ./build/scripts/export_prefix_check.sh
- name: make installcheck
id: installcheck
run: |
set -o pipefail
make -k -C build installcheck ${{ matrix.installcheck_args }} | tee installcheck.log
- name: pginstallcheck
run: make -C build pginstallcheck
- name: coverage
if: matrix.coverage
run: make -j $MAKE_JOBS -k -C build coverage
- name: Upload coverage report
if: matrix.coverage
uses: codecov/codecov-action@v1
with:
file: ./build/codecov/timescaledb-codecov.info
- name: Show regression diffs
if: always()
id: collectlogs
run: |
find . -name regression.diffs -exec cat {} + > regression.log
find . -name postmaster.log -exec cat {} + > postgres.log
if [[ "${{ runner.os }}" == "Linux" ]] ; then
# wait in case there are in-progress coredumps
sleep 10
if coredumpctl -q list >/dev/null; then echo "::set-output name=coredumps::true"; fi
fi
if [[ -s regression.log ]]; then echo "::set-output name=regression_diff::true"; fi
grep -e 'FAILED' -e 'failed (ignored)' installcheck.log || true
cat regression.log
- name: Save regression diffs
if: always() && steps.collectlogs.outputs.regression_diff == 'true'
uses: actions/upload-artifact@v3
with:
name: Regression diff ${{ matrix.os }} ${{ matrix.name }} ${{ matrix.pg }}
path: regression.log
- name: Save postmaster.log
if: always()
uses: actions/upload-artifact@v3
with:
name: PostgreSQL log ${{ matrix.os }} ${{ matrix.name }} ${{ matrix.pg }}
path: postgres.log
- name: Stack trace
if: always() && steps.collectlogs.outputs.coredumps == 'true'
run: |
echo "bt full" | sudo coredumpctl gdb
./scripts/bundle_coredumps.sh
false
- name: Coredumps
if: always() && steps.collectlogs.outputs.coredumps == 'true'
uses: actions/upload-artifact@v3
with:
name: Coredumps ${{ matrix.os }} ${{ matrix.name }} ${{ matrix.pg }}
path: coredumps
- name: Save TAP test logs
if: always()
uses: actions/upload-artifact@v3
with:
name: TAP test logs ${{ matrix.os }} ${{ matrix.name }} ${{ matrix.pg }}
path: |
build/test/tmp_check/log
build/tsl/test/tmp_check/log