Skip to content

Commit

Permalink
PG16: Enable CI
Browse files Browse the repository at this point in the history
  • Loading branch information
fabriziomello committed Nov 3, 2023
1 parent a1a3894 commit 71abce4
Show file tree
Hide file tree
Showing 12 changed files with 111 additions and 19 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: 0 additions & 2 deletions .github/workflows/linux-32bit-build-and-test-ignored.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ jobs:
matrix:
pg: ${{ fromJson(needs.config.outputs.pg_latest) }}
build_type: [ Debug ]
include:
- pg: ${{ fromJson(needs.config.outputs.pg15_latest) }}
steps:
- run: |
echo "No build required"
13 changes: 10 additions & 3 deletions .github/workflows/linux-32bit-build-and-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,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 +100,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 @@ -131,9 +132,15 @@ jobs:
run: |
set -o pipefail
export LANG=C.UTF-8
PG_MAJOR=$(echo "${{ matrix.pg }}" | sed -e 's![.].*!!')
# PG16: It should be removed when we fix remaining issues
if [ $PG_MAJOR -eq 16 ]; then
SKIPS="${SKIPS} compression_sorted_merge-16 transparent_decompression-16 transparent_decompression_ordered_index-16 \
transparent_decompress_chunk-16 transparent_decompression_join_index ordered_append_join-16 decompress_join"
fi
# 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/windows-build-and-test-ignored.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
strategy:
fail-fast: false
matrix:
pg: [ 13, 14, 15 ]
pg: [ 13, 14, 15, 16 ]
os: [ windows-2022 ]
build_type: ${{ fromJson(needs.config.outputs.build_type) }}
steps:
Expand Down
14 changes: 9 additions & 5 deletions .github/workflows/windows-build-and-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
strategy:
fail-fast: false
matrix:
pg: [ 13, 14, 15 ]
pg: [ 13, 14, 15, 16 ]
os: [ windows-2022 ]
build_type: ${{ fromJson(needs.config.outputs.build_type) }}
ignores: ["chunk_adaptive metadata telemetry"]
Expand All @@ -72,6 +72,8 @@ jobs:
# pkg_version: ${{ fromJson(needs.config.outputs.pg15_latest) }}
pkg_version: 15.0.1 # hardcoded due to issues with PG15.1 on chocolatey
tsl_skips_version: dist_partial_agg-15 dist_grant-15
- pg: 16
pkg_version: ${{ fromJson(needs.config.outputs.pg16_latest) }}
env:
# PostgreSQL configuration
PGPORT: 55432
Expand Down Expand Up @@ -185,10 +187,11 @@ jobs:
# isolationtester is only packaged with pg14+ so we would have to build our own postgres
# to get it for earlier versions so we skip it for < 14.
if [[ "${{ matrix.pg }}" -ge "14" ]]; then
make -C build_wsl isolationchecklocal | tee -a installcheck.log
make -C build_wsl isolationchecklocal PSQL="$HOME/PostgreSQL/${{ matrix.pg }}/bin/psql" | tee -a installcheck.log
fi
make -C build_wsl regresschecklocal IGNORES="${{ matrix.ignores }}" | tee -a installcheck.log
make -C build_wsl regresschecklocal IGNORES="${{ matrix.ignores }}" \
PSQL="$HOME/PostgreSQL/${{ matrix.pg }}/bin/psql" | tee -a installcheck.log
- name: Setup postgres cluster for TSL tests
run: |
Expand All @@ -211,12 +214,13 @@ jobs:
# isolationtester is only packaged with pg14+ so we would have to build our own postgres
# to get it for earlier versions so we skip it for < 14.
if [[ "${{ matrix.pg }}" -ge "14" ]]; then
make -C build_wsl isolationchecklocal-t | tee -a installcheck.log
make -C build_wsl isolationchecklocal-t PSQL="$HOME/PostgreSQL/${{ matrix.pg }}/bin/psql" | tee -a installcheck.log
fi
make -C build_wsl -k regresschecklocal-t \
IGNORES="${{ matrix.tsl_ignores }} ${{ matrix.tsl_ignores_version }}" \
SKIPS="${{ matrix.tsl_skips }} ${{ matrix.tsl_skips_version }}" | tee -a installcheck.log
SKIPS="${{ matrix.tsl_skips }} ${{ matrix.tsl_skips_version }}" \
PSQL="$HOME/PostgreSQL/${{ matrix.pg }}/bin/psql" | tee -a installcheck.log
- name: Show regression diffs
id: collectlogs
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
15 changes: 12 additions & 3 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 @@ -66,6 +66,8 @@ if [[ ${PG_VERSION_MAJOR} -ge 16 ]]; then
fi
fi

echo "PSQL ${PSQL}"
echo "PG_VERSION_MAJOR ${PG_VERSION_MAJOR}"
echo "TESTS ${TESTS}"
if [[ ${PG_VERSION_MAJOR} -lt 16 ]]; then
echo "IGNORES ${IGNORES}"
Expand Down Expand Up @@ -108,8 +110,15 @@ 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 -i works slightly different on MacOS
echo ">> TEST_REMOVED: ${test_name} == ${test_pattern}"
cat ${TEMP_SCHEDULE} | sed -e "s!^test:\s*${test_name}\s*\$!!" \
> "${TEMP_SCHEDULE}.changed" \
&& mv "${TEMP_SCHEDULE}.changed" ${TEMP_SCHEDULE}
cat ${TEMP_SCHEDULE} | sed -e "s!\b${test_name}\b!!" \
> "${TEMP_SCHEDULE}.changed" \
&& mv "${TEMP_SCHEDULE}.changed" ${TEMP_SCHEDULE}
cat ${TEMP_SCHEDULE}
fi
done
done
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 71abce4

Please sign in to comment.