mirror of
https://github.com/timescale/timescaledb.git
synced 2025-05-15 10:11:29 +08:00
Break out multinode update tests
This commit is part of a longer sequence to refactor the update tests for use with smoke testing. The multinode parts of the tests are broken out into a new version to make the logic simpler. - All multinode tests are now added to a new version, `v7` which allow us to create multinode objects only for versions that support multinode. - Test script `test_updates_pg11` and `test_updates_pg12` are changed to use `v6` for updates from versions preceeding 2.0 and `v7` for versions 2.0 and later. - Setup file `post.update.sql` is not needed any more since it was used to "fix" a pre-2.0 updated version to add data nodes so that it matched the clean setup. This is not necessary any more since v6 does not add data nodes for some versions and not for others.
This commit is contained in:
parent
f0675be2e2
commit
10b3da03ec
@ -200,19 +200,13 @@ docker_pgcmd ${CONTAINER_UPDATED} "ALTER EXTENSION timescaledb UPDATE" "dn1"
|
||||
# which is available in the image.
|
||||
docker_pgcmd ${CONTAINER_UPDATED} "ALTER EXTENSION timescaledb UPDATE" "postgres"
|
||||
|
||||
# Post update script. Needed for multi-node tests when updating from a
|
||||
# version that doesn't support multi-node to a multi-node capable
|
||||
# version.
|
||||
if [[ "${TEST_VERSION}" > "v6" ]] || [[ "${TEST_VERSION}" = "v6" ]]; then
|
||||
echo "Executing post update scripts"
|
||||
docker_pgscript ${CONTAINER_UPDATED} /src/test/sql/updates/post.update.sql "single"
|
||||
if [[ "${TEST_REPAIR}" = "true" ]]; then
|
||||
echo "Executing post update repair script"
|
||||
docker_pgscript ${CONTAINER_UPDATED} /src/test/sql/updates/post.repair.sql "single"
|
||||
fi
|
||||
if [[ "${TEST_REPAIR}" = "true" ]]; then
|
||||
echo "Executing post update repair script"
|
||||
docker_pgscript ${CONTAINER_UPDATED} /src/test/sql/updates/post.repair.sql "single"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
# Check that there is nothing wrong before taking a backup
|
||||
echo "Checking that there are no missing dimension slices"
|
||||
docker_pgscript ${CONTAINER_UPDATED} /src/test/sql/updates/setup.check.sql
|
||||
|
@ -11,7 +11,7 @@ TEST_VERSION="v2"
|
||||
TAGS=$TAGS TEST_VERSION=$TEST_VERSION bash ${SCRIPT_DIR}/test_updates.sh "$@"
|
||||
EXIT_CODE=$?
|
||||
if [ $EXIT_CODE -ne 0 ]; then
|
||||
exit $EXIT_CODE
|
||||
exit $EXIT_CODE
|
||||
fi
|
||||
|
||||
TAGS="1.3.0-pg11 1.3.1-pg11 1.3.2-pg11 1.4.0-pg11 1.4.1-pg11 1.4.2-pg11"
|
||||
@ -20,7 +20,7 @@ TEST_VERSION="v4"
|
||||
TAGS=$TAGS TEST_VERSION=$TEST_VERSION bash ${SCRIPT_DIR}/test_updates.sh "$@"
|
||||
EXIT_CODE=$?
|
||||
if [ $EXIT_CODE -ne 0 ]; then
|
||||
exit $EXIT_CODE
|
||||
exit $EXIT_CODE
|
||||
fi
|
||||
|
||||
TAGS="1.5.0-pg11 1.5.1-pg11 1.6.0-pg11 1.6.1-pg11"
|
||||
@ -29,14 +29,23 @@ TEST_VERSION="v5"
|
||||
TAGS=$TAGS TEST_VERSION=$TEST_VERSION bash ${SCRIPT_DIR}/test_updates.sh "$@"
|
||||
EXIT_CODE=$?
|
||||
if [ $EXIT_CODE -ne 0 ]; then
|
||||
exit $EXIT_CODE
|
||||
exit $EXIT_CODE
|
||||
fi
|
||||
|
||||
TAGS="1.7.0-pg11 1.7.1-pg11 1.7.2-pg11 1.7.3-pg11 1.7.4-pg11 1.7.5-pg11 2.0.0-rc1-pg11 2.0.0-rc2-pg11 2.0.0-rc3-pg11 2.0.0-rc4-pg11 2.0.0-pg11 2.0.1-pg11 2.0.2-pg11 2.1.0-pg11"
|
||||
TAGS="1.7.0-pg11 1.7.1-pg11 1.7.2-pg11 1.7.3-pg11 1.7.4-pg11 1.7.5-pg11"
|
||||
TEST_VERSION="v6"
|
||||
|
||||
TAGS=$TAGS TEST_VERSION=$TEST_VERSION bash ${SCRIPT_DIR}/test_updates.sh "$@"
|
||||
EXIT_CODE=$?
|
||||
if [ $EXIT_CODE -ne 0 ]; then
|
||||
exit $EXIT_CODE
|
||||
exit $EXIT_CODE
|
||||
fi
|
||||
|
||||
TAGS="2.0.0-rc1-pg11 2.0.0-rc2-pg11 2.0.0-rc3-pg11 2.0.0-rc4-pg11 2.0.0-pg11 2.0.1-pg11 2.0.2-pg11 2.1.0-pg11"
|
||||
TEST_VERSION="v7"
|
||||
|
||||
TAGS=$TAGS TEST_VERSION=$TEST_VERSION bash ${SCRIPT_DIR}/test_updates.sh "$@"
|
||||
EXIT_CODE=$?
|
||||
if [ $EXIT_CODE -ne 0 ]; then
|
||||
exit $EXIT_CODE
|
||||
fi
|
||||
|
@ -6,11 +6,20 @@ set -o pipefail
|
||||
SCRIPT_DIR=$(dirname $0)
|
||||
echo $SCRIPT_DIR
|
||||
|
||||
TAGS="1.7.0-pg12 1.7.1-pg12 1.7.2-pg12 1.7.3-pg12 1.7.4-pg12 1.7.5-pg12 2.0.0-rc1-pg12 2.0.0-rc2-pg12 2.0.0-rc3-pg12 2.0.0-rc4-pg12 2.0.0-pg12 2.0.1-pg12 2.0.2-pg12 2.1.0-pg12"
|
||||
TAGS="1.7.0-pg12 1.7.1-pg12 1.7.2-pg12 1.7.3-pg12 1.7.4-pg12 1.7.5-pg12"
|
||||
TEST_VERSION="v6"
|
||||
|
||||
TAGS=$TAGS TEST_VERSION=$TEST_VERSION bash ${SCRIPT_DIR}/test_updates.sh "$@"
|
||||
EXIT_CODE=$?
|
||||
if [ $EXIT_CODE -ne 0 ]; then
|
||||
exit $EXIT_CODE
|
||||
exit $EXIT_CODE
|
||||
fi
|
||||
|
||||
TAGS="2.0.0-rc1-pg12 2.0.0-rc2-pg12 2.0.0-rc3-pg12 2.0.0-rc4-pg12 2.0.0-pg12 2.0.1-pg12 2.0.2-pg12 2.1.0-pg12"
|
||||
TEST_VERSION="v7"
|
||||
|
||||
TAGS=$TAGS TEST_VERSION=$TEST_VERSION bash ${SCRIPT_DIR}/test_updates.sh "$@"
|
||||
EXIT_CODE=$?
|
||||
if [ $EXIT_CODE -ne 0 ]; then
|
||||
exit $EXIT_CODE
|
||||
fi
|
||||
|
@ -1,23 +0,0 @@
|
||||
-- This file and its contents are licensed under the Apache License 2.0.
|
||||
-- Please see the included NOTICE for copyright information and
|
||||
-- LICENSE-APACHE for a copy of the license.
|
||||
|
||||
DO LANGUAGE PLPGSQL $$
|
||||
DECLARE
|
||||
relid regclass = NULL;
|
||||
ts_version TEXT;
|
||||
BEGIN
|
||||
SELECT oid INTO relid FROM pg_class WHERE relname='disthyper';
|
||||
SELECT extversion INTO ts_version FROM pg_extension WHERE extname = 'timescaledb';
|
||||
|
||||
-- Can only run multinode on 2.0.0+
|
||||
IF relid IS NULL AND ts_version >= '2.0.0' THEN
|
||||
RAISE NOTICE 'creating multinode setup for version % on database %',
|
||||
ts_version, current_database();
|
||||
PERFORM add_data_node('dn1', host=>'localhost', database=>'dn1');
|
||||
CREATE TABLE disthyper (time timestamptz, device int, temp float);
|
||||
PERFORM create_distributed_hypertable('disthyper', 'time', 'device');
|
||||
INSERT INTO disthyper VALUES ('2020-12-20 12:18', 1, 27.9);
|
||||
END IF;
|
||||
END
|
||||
$$;
|
13
test/sql/updates/post.v7.sql
Normal file
13
test/sql/updates/post.v7.sql
Normal file
@ -0,0 +1,13 @@
|
||||
-- This file and its contents are licensed under the Apache License 2.0.
|
||||
-- Please see the included NOTICE for copyright information and
|
||||
-- LICENSE-APACHE for a copy of the license.
|
||||
|
||||
\ir post.catalog.sql
|
||||
\ir post.insert.sql
|
||||
\ir post.integrity_test.sql
|
||||
\ir catalog_missing_columns.sql
|
||||
\ir post.compression.sql
|
||||
\ir post.continuous_aggs.v2.sql
|
||||
\ir post.policies.sql
|
||||
\ir post.sequences.sql
|
||||
\ir post.functions.sql
|
@ -9,4 +9,3 @@
|
||||
\if :TEST_REPAIR
|
||||
\ir setup.repair.sql
|
||||
\endif
|
||||
\ir setup.multinode.sql
|
||||
|
6
test/sql/updates/setup.v7.sql
Normal file
6
test/sql/updates/setup.v7.sql
Normal file
@ -0,0 +1,6 @@
|
||||
-- This file and its contents are licensed under the Apache License 2.0.
|
||||
-- Please see the included NOTICE for copyright information and
|
||||
-- LICENSE-APACHE for a copy of the license.
|
||||
|
||||
\ir setup.v6.sql
|
||||
\ir setup.multinode.sql
|
Loading…
x
Reference in New Issue
Block a user