forked from timescale/timescaledb
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Currently the update test is quite inconvenient to run locally and also inconvenient to debug as the different update tests all run in their own docker container. This patch refactors the update test to no longer require docker and make it easier to debug as it will run in the local environment as determined by pg_config. This patch also consolidates update/downgrade and repair test since they do very similar things and adds support for coredump stacktraces to the github action and removes some dead code from the update tests. Additionally the versions to be used in the update test are now determined from existing git tags so the post release patch no longer needs to add newly released versions.
- Loading branch information
Showing
17 changed files
with
358 additions
and
1,145 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
SCRIPT_DIR=$(dirname $0) | ||
PG_MAJOR_VERSION=$(pg_config --version | awk '{print $2}' | awk -F. '{print $1}') | ||
|
||
PG_EXTENSION_DIR=$(pg_config --sharedir)/extension | ||
if [ "${CI:-false}" == true ]; then | ||
GIT_REF=${GIT_REF:-$(git rev-parse HEAD)} | ||
else | ||
GIT_REF=$(git branch --show-current) | ||
fi | ||
|
||
|
||
BUILD_DIR="build_update_pg${PG_MAJOR_VERSION}" | ||
|
||
CURRENT_VERSION=$(grep '^version ' version.config | awk '{ print $3 }') | ||
PREV_VERSION=$(grep '^downgrade_to_version ' version.config | awk '{ print $3 }') | ||
|
||
if [ ! -d "${BUILD_DIR}" ]; then | ||
echo "Initializing build directory" | ||
BUILD_DIR="${BUILD_DIR}" ./bootstrap -DCMAKE_BUILD_TYPE=Release -DWARNINGS_AS_ERRORS=OFF -DASSERTIONS=ON -DLINTER=ON -DGENERATE_DOWNGRADE_SCRIPT=ON -DREGRESS_CHECKS=OFF -DTAP_CHECKS=OFF | ||
fi | ||
|
||
if [ ! -f "${PG_EXTENSION_DIR}/timescaledb--${PREV_VERSION}.sql" ]; then | ||
echo "Building ${PREV_VERSION}" | ||
git checkout ${PREV_VERSION} | ||
make -C "${BUILD_DIR}" -j4 > /dev/null | ||
sudo make -C "${BUILD_DIR}" install > /dev/null | ||
git checkout ${GIT_REF} | ||
fi | ||
|
||
# We want to use the latest loader for all the tests so we build it last | ||
make -C "${BUILD_DIR}" -j4 | ||
sudo make -C "${BUILD_DIR}" install > /dev/null | ||
|
||
set +e | ||
|
||
FROM_VERSION=${CURRENT_VERSION} TO_VERSION=${PREV_VERSION} TEST_VERSION=v8 TEST_REPAIR=false "${SCRIPT_DIR}/test_update_from_version.sh" | ||
return_code=$? | ||
if [ $return_code -ne 0 ]; then | ||
echo -e "\nFailed downgrade from ${CURRENT_VERSION} to ${PREV_VERSION}\n" | ||
exit 1 | ||
fi | ||
|
Oops, something went wrong.