Skip to content

Commit

Permalink
PG16: Enable CI
Browse files Browse the repository at this point in the history
This commit enables PG16 in the following workflows:
* Regression Linux (including 32bit)
* ABI test
* Memory tests
* Sanitizer tests
* Coverity
  • Loading branch information
fabriziomello committed Nov 4, 2023
1 parent b4bb3a0 commit fbc1fbb
Show file tree
Hide file tree
Showing 13 changed files with 100 additions and 20 deletions.
4 changes: 4 additions & 0 deletions .github/ci_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,8 @@
PG15_LATEST = "15.4"
PG15_ABI_MIN = "15.0"

PG16_EARLIEST = "16.0"
PG16_LATEST = "16.0"
PG16_ABI_MIN = "16.0"

PG_LATEST = [PG13_LATEST, PG14_LATEST, PG15_LATEST]
48 changes: 47 additions & 1 deletion .github/gh_matrix_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
PG14_LATEST,
PG15_EARLIEST,
PG15_LATEST,
PG16_EARLIEST,
PG16_LATEST,
PG_LATEST,
)

Expand All @@ -43,6 +45,7 @@
"include": [],
}


# helper functions to generate matrix entries
# the release and apache config inherit from the
# debug config to reduce repetition
Expand Down Expand Up @@ -148,7 +151,7 @@ def macos_config(overrides):
"compressed_collation",
},
"os": "macos-11",
"pg_extra_args": "--with-libraries=/usr/local/opt/openssl/lib --with-includes=/usr/local/opt/openssl/include",
"pg_extra_args": "--with-libraries=/usr/local/opt/openssl/lib --with-includes=/usr/local/opt/openssl/include --without-icu",
"pginstallcheck": True,
"tsdb_build_args": "-DASSERTIONS=ON -DREQUIRE_ALL_TESTS=ON -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl",
}
Expand Down Expand Up @@ -189,17 +192,37 @@ def macos_config(overrides):
build_debug_config({"pg": PG15_LATEST, "ignored_tests": ignored_tests})
)

m["include"].append(
build_debug_config({"pg": PG16_LATEST, "ignored_tests": ignored_tests})
)

# test timescaledb with release config on latest postgres release in MacOS
m["include"].append(
build_release_config(
macos_config({"pg": PG15_LATEST, "ignored_tests": ignored_tests})
)
)

m["include"].append(
build_release_config(
macos_config({"pg": PG16_LATEST, "ignored_tests": ignored_tests})
)
)

# test latest postgres release without telemetry
m["include"].append(
build_without_telemetry({"pg": PG15_LATEST, "ignored_tests": ignored_tests})
)

m["include"].append(
build_without_telemetry(
{
"pg": PG16_LATEST,
"ignored_tests": ignored_tests,
}
)
)

# if this is not a pull request e.g. a scheduled run or a push
# to a specific branch like prerelease_test we add additional
# entries to the matrix
Expand Down Expand Up @@ -235,19 +258,33 @@ def macos_config(overrides):
build_debug_config({"pg": PG15_EARLIEST, "ignored_tests": ignored_tests})
)

# add debug test for first supported PG16 version
m["include"].append(
build_debug_config({"pg": PG16_EARLIEST, "ignored_tests": ignored_tests})
)

# add debug tests for timescaledb on latest postgres release in MacOS
m["include"].append(
build_debug_config(
macos_config({"pg": PG15_LATEST, "ignored_tests": ignored_tests})
)
)

m["include"].append(
build_debug_config(
macos_config({"pg": PG16_LATEST, "ignored_tests": ignored_tests})
)
)

# add release test for latest pg releases
m["include"].append(build_release_config({"pg": PG13_LATEST}))
m["include"].append(build_release_config({"pg": PG14_LATEST}))
m["include"].append(
build_release_config({"pg": PG15_LATEST, "ignored_tests": ignored_tests})
)
m["include"].append(
build_release_config({"pg": PG16_LATEST, "ignored_tests": ignored_tests})
)

# add apache only test for latest pg versions
for PG_LATEST_VER in PG_LATEST:
Expand All @@ -274,6 +311,15 @@ def macos_config(overrides):
}
)
)
m["include"].append(
build_debug_config(
{
"pg": 16,
"snapshot": "snapshot",
"ignored_tests": ignored_tests,
}
)
)
elif len(sys.argv) > 2:
# Check if we need to check for the flaky tests. Determine which test files
# have been changed in the PR. The sql files might include other files that
Expand Down
12 changes: 11 additions & 1 deletion .github/workflows/abi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@ jobs:
pg13_abi_min: ${{ steps.config.outputs.pg13_abi_min }}
pg14_abi_min: ${{ steps.config.outputs.pg14_abi_min }}
pg15_abi_min: ${{ steps.config.outputs.pg15_abi_min }}
pg16_abi_min: ${{ steps.config.outputs.pg16_abi_min }}
pg13_latest: ${{ steps.config.outputs.pg13_latest }}
pg14_latest: ${{ steps.config.outputs.pg14_latest }}
pg15_latest: ${{ steps.config.outputs.pg15_latest }}
pg16_latest: ${{ steps.config.outputs.pg16_latest }}

steps:
- name: Checkout source code
Expand All @@ -40,7 +42,7 @@ jobs:
fail-fast: false
matrix:
test: [ "13backward", "13forward", "14backward", "14forward",
"15backward", "15forward" ]
"15backward", "15forward", "16backward", "16forward" ]
os: [ windows-2019 ]
include:
- test: 13backward
Expand Down Expand Up @@ -68,6 +70,14 @@ jobs:
pg: 15
builder: ${{ fromJson(needs.config.outputs.pg15_abi_min) }}
tester: ${{ fromJson(needs.config.outputs.pg15_latest) }}
- test: 16backward
pg: 16
builder: ${{ fromJson(needs.config.outputs.pg16_latest) }}
tester: ${{ fromJson(needs.config.outputs.pg16_abi_min) }}
- test: 16forward
pg: 16
builder: ${{ fromJson(needs.config.outputs.pg16_abi_min) }}
tester: ${{ fromJson(needs.config.outputs.pg16_latest) }}

steps:

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/coverity.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
fail-fast: false
matrix:
# run only on the 3 latest PG versions as we have rate limit on coverity
pg: [13, 14, 15]
pg: [13, 14, 15, 16]
os: [ubuntu-20.04]
steps:
- name: Install Dependencies
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/linux-32bit-build-and-test-ignored.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
runs-on: ubuntu-latest
outputs:
pg_latest: ${{ steps.setter.outputs.PG_LATEST }}
pg15_latest: ${{ steps.setter.outputs.PG15_LATEST }}
pg16_latest: ${{ steps.setter.outputs.PG16_LATEST }}
steps:
- name: Checkout source code
uses: actions/checkout@v3
Expand All @@ -39,7 +39,8 @@ jobs:
pg: ${{ fromJson(needs.config.outputs.pg_latest) }}
build_type: [ Debug ]
include:
- pg: ${{ fromJson(needs.config.outputs.pg15_latest) }}
- pg: ${{ fromJson(needs.config.outputs.pg16_latest) }}
build_type: Debug
steps:
- run: |
echo "No build required"
12 changes: 8 additions & 4 deletions .github/workflows/linux-32bit-build-and-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
runs-on: ubuntu-latest
outputs:
pg_latest: ${{ steps.setter.outputs.PG_LATEST }}
pg15_latest: ${{ steps.setter.outputs.PG15_LATEST }}
pg16_latest: ${{ steps.setter.outputs.PG16_LATEST }}
steps:
- name: Checkout source code
uses: actions/checkout@v3
Expand Down Expand Up @@ -50,6 +50,9 @@ jobs:
matrix:
pg: ${{ fromJson(needs.config.outputs.pg_latest) }}
build_type: [ Debug ]
include:
- pg: ${{ fromJson(needs.config.outputs.pg16_latest) }}
build_type: Debug

steps:

Expand All @@ -65,7 +68,8 @@ jobs:
echo '/tmp/core.%h.%e.%t' > /proc/sys/kernel/core_pattern
apt-get install -y gcc make cmake libssl-dev libkrb5-dev libipc-run-perl \
libtest-most-perl sudo gdb git wget gawk lbzip2 flex bison lcov base-files \
locales clang-14 llvm-14 llvm-14-dev llvm-14-tools postgresql-client
locales clang-14 llvm-14 llvm-14-dev llvm-14-tools postgresql-client pkgconf \
icu-devtools
- name: Checkout TimescaleDB
uses: actions/checkout@v3
Expand Down Expand Up @@ -99,7 +103,7 @@ jobs:
# When building on i386 with the clang compiler, Postgres requires -msse2 to be used
./configure --prefix=$HOME/$PG_INSTALL_DIR --with-openssl \
--without-readline --without-zlib --without-libxml --enable-cassert \
--enable-debug --with-llvm LLVM_CONFIG=llvm-config-14 CFLAGS="-msse2"
--enable-debug --with-llvm --without-icu LLVM_CONFIG=llvm-config-14 CFLAGS="-msse2"
make -j $MAKE_JOBS
make -j $MAKE_JOBS -C src/test/isolation
make -j $MAKE_JOBS -C contrib/postgres_fdw
Expand Down Expand Up @@ -133,7 +137,7 @@ jobs:
export LANG=C.UTF-8
# PostgreSQL cannot be run as root. So, switch to postgres user.
sudo -u postgres make -k -C build installcheck IGNORES="${IGNORES}" \
SKIPS="${SKIPS}" | tee installcheck.log
SKIPS="${SKIPS}" PSQL="${HOME}/${PG_INSTALL_DIR}/bin/psql" | tee installcheck.log
- name: Show regression diffs
if: always()
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/linux-build-and-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
# If needed, install them before opening the core dump.
sudo apt-get update
sudo apt-get install flex bison lcov systemd-coredump gdb libipc-run-perl \
libtest-most-perl ${{ matrix.extra_packages }}
libtest-most-perl pkgconf icu-devtools ${{ matrix.extra_packages }}
- name: Install macOS Dependencies
if: runner.os == 'macOS'
Expand Down Expand Up @@ -162,7 +162,8 @@ jobs:
run: |
set -o pipefail
make -k -C build installcheck IGNORES="${{ join(matrix.ignored_tests, ' ') }}" \
SKIPS="${{ join(matrix.skipped_tests, ' ') }}" ${{ matrix.installcheck_args }} | tee installcheck.log
SKIPS="${{ join(matrix.skipped_tests, ' ') }}" ${{ matrix.installcheck_args }} \
PSQL="${HOME}/${PG_INSTALL_DIR}/bin/psql" | tee installcheck.log
- name: pginstallcheck
if: matrix.pginstallcheck
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/memory-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-20.04
strategy:
matrix:
pg: [13, 14, 15]
pg: [13, 14, 15, 16]
fail-fast: false

steps:
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/sanitizer-build-and-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
runs-on: ubuntu-latest
outputs:
pg_latest: ${{ steps.setter.outputs.PG_LATEST }}
pg15_latest: ${{ steps.setter.outputs.PG15_LATEST }}
pg16_latest: ${{ steps.setter.outputs.PG16_LATEST }}
steps:
- name: Checkout source code
uses: actions/checkout@v3
Expand All @@ -75,7 +75,7 @@ jobs:
os: ["ubuntu-22.04"]
pg: ${{ fromJson(needs.config.outputs.pg_latest) }}
include:
- pg: ${{ fromJson(needs.config.outputs.pg15_latest) }}
- pg: ${{ fromJson(needs.config.outputs.pg16_latest) }}
skips_version: 002_replication_telemetry 003_connections_privs 004_multinode_rdwr_1pc
steps:
- name: Install Linux Dependencies
Expand Down Expand Up @@ -156,7 +156,8 @@ jobs:
# postmaster.c is not atomic but read/written across signal handlers
# and ServerLoop.
make -k -C build installcheck SKIPS="${SKIPS} ${{matrix.skips_version}}" \
IGNORES="${IGNORES} ${{matrix.ignores_version}}" | tee installcheck.log
IGNORES="${IGNORES} ${{matrix.ignores_version}}" \
PSQL="${HOME}/${PG_INSTALL_DIR}/bin/psql" | tee installcheck.log
- name: Show regression diffs
if: always()
Expand Down
1 change: 1 addition & 0 deletions scripts/backport.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ def git_returncode(command):
]
branch_commit_titles = {x[1] for x in branch_commits}


# We will do backports per-PR, because one PR, though not often, might contain
# many commits. So as the first step, go through the commits unique to main, find
# out which of them have to be backported, and remember the corresponding PRs.
Expand Down
1 change: 1 addition & 0 deletions scripts/test_memory_spikes.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
CHECK_INTERVAL = 15
DEBUG = False


# finds processes with name as argument
def find_procs_by_name(name):
# Return a list of processes matching 'name'
Expand Down
8 changes: 4 additions & 4 deletions test/pg_regress.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ IGNORES=${IGNORES:-}
SKIPS=${SKIPS:-}
PSQL=${PSQL:-psql}
PSQL="${PSQL} -X" # Prevent any .psqlrc files from being executed during the tests
PG_VERSION_MAJOR=$(${PSQL} --version | awk '{print $3}' | sed -e 's![.].*!!')
PG_VERSION_MAJOR=$(${PSQL} --version | awk '{split($3,v,"."); print v[1]}')

# check if test matches any of the patterns in a list
# $1 list of patterns or test names
Expand Down Expand Up @@ -108,8 +108,8 @@ elif [[ -z ${TESTS} ]] && ( [[ -n ${SKIPS} ]] || [[ -n ${IGNORES} ]] ); then
for test_pattern in ${SKIPS}; do
for test_name in ${ALL_TESTS}; do
if [[ $test_name == $test_pattern ]]; then
sed -i ${TEMP_SCHEDULE} -e "s!^test:\s*${test_name}\s*\$!!"
sed -i ${TEMP_SCHEDULE} -e "s!\b${test_name}\b!!"
sed -e "s!^test:\s*${test_name}\s*\$!!" -i.backup ${TEMP_SCHEDULE}
sed -e "s!\b${test_name}\b!!" -i.backup ${TEMP_SCHEDULE}
fi
done
done
Expand Down Expand Up @@ -201,7 +201,7 @@ TEST_TABLESPACE3_PREFIX=${TEST_TABLESPACE3_PREFIX:-$(mktemp -d 2>/dev/null || mk
TEST_TABLESPACE1_PATH=${TEST_TABLESPACE1_PATH:-${TEST_TABLESPACE1_PREFIX}_default}
TEST_TABLESPACE2_PATH=${TEST_TABLESPACE2_PATH:-${TEST_TABLESPACE2_PREFIX}_default}
TEST_TABLESPACE3_PATH=${TEST_TABLESPACE3_PATH:-${TEST_TABLESPACE3_PREFIX}_default}
mkdir $TEST_TABLESPACE1_PATH $TEST_TABLESPACE2_PATH $TEST_TABLESPACE3_PATH
mkdir -p $TEST_TABLESPACE1_PATH $TEST_TABLESPACE2_PATH $TEST_TABLESPACE3_PATH

export TEST_TABLESPACE1_PREFIX TEST_TABLESPACE2_PREFIX TEST_TABLESPACE3_PREFIX
export TEST_TABLESPACE1_PATH TEST_TABLESPACE2_PATH TEST_TABLESPACE3_PATH
Expand Down
13 changes: 12 additions & 1 deletion test/pgtest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,18 @@ set(PG_IGNORE_TESTS

# Modify the test schedule to ignore some tests
foreach(IGNORE_TEST ${PG_IGNORE_TESTS})
string(CONCAT PG_TEST_SCHEDULE "ignore: ${IGNORE_TEST}\n" ${PG_TEST_SCHEDULE})
# ignored schedules was removed in PG16
# https://github.com/postgres/postgres/commit/bd8d453e9b5f8b632a400a9e796fc041aed76d82
if(${PG_VERSION_MAJOR} LESS "16")
string(CONCAT PG_TEST_SCHEDULE "ignore: ${IGNORE_TEST}\n"
${PG_TEST_SCHEDULE})
else()
# remove the ignored test from the schedule
string(REPLACE "test: ${IGNORE_TEST}\n" "" PG_TEST_SCHEDULE
"${PG_TEST_SCHEDULE}")
string(REPLACE " ${IGNORE_TEST} " " " PG_TEST_SCHEDULE
"${PG_TEST_SCHEDULE}")
endif()
endforeach(IGNORE_TEST)

# Write the final test schedule
Expand Down

0 comments on commit fbc1fbb

Please sign in to comment.