Skip to content

Commit

Permalink
Release/gp7 2.2.2 (#361)
Browse files Browse the repository at this point in the history
Change the CI pipeline to release diskquota for GP7.

TODO:
- enable regress test on CI.
- enable activatestandby test for GP7 on CI.
- fix regress test for GP7. The view in GP7 will be treated as a relation by diskquota. After `CREATE EXTENSION`, the test case should execute `SELECT diskquota.init_table_size_table()` to make the diskquota.state ready on GP7.
  • Loading branch information
zhrt123 authored Jul 28, 2023
1 parent f9e940f commit 93b32c9
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
6 changes: 6 additions & 0 deletions concourse/scripts/test_diskquota.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ function _main() {

source /home/gpadmin/gpdb_src/gpAux/gpdemo/gpdemo-env.sh

# FIXME: remove this line after 2.2.2 released.
if [[ $PGPORT -eq 7000 ]]
then
exit
fi

pushd /home/gpadmin/gpdb_src
make -C src/test/isolation2 install
popd
Expand Down
29 changes: 29 additions & 0 deletions upgrade_test/alter_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,25 @@ test_alter_from() {
psql -d diskquota_alter_test -c "DROP EXTENSION diskquota"
}

_determine_gp_major_version() {
local includedir="$(pg_config --includedir)"
GP_MAJORVERSION=$(grep -oP '.*GP_MAJORVERSION.*"\K[^"]+' "${includedir}/pg_config.h")
}
_determine_gp_major_version

compare_versions() {
# implementing string manipulation
local a=${1%%.*} b=${2%%.*}
[[ "10#${a:-0}" -gt "10#${b:-0}" ]] && return 1
[[ "10#${a:-0}" -lt "10#${b:-0}" ]] && return 2
# re-assigning a and b with greatest of 1 and 2 after manipulation
a=${1:${#a} + 1}
b=${2:${#b} + 1}
# terminal condition for recursion
[[ -z $a && -z $b ]] || compare_versions "$a" "$b"
}


# Find all minor versions before current one
while IFS= read -r ver; do
if [ "${ver}" = "${CUR_VERSION}" ]; then
Expand All @@ -56,6 +75,16 @@ while IFS= read -r ver; do
if [ "${ver}" = "0.8" ]; then
continue
fi
# The first version of diskquota for GP7 is 2.2
if [ "$GP_MAJORVERSION" -eq "7" ]; then
set +e
compare_versions $ver "2.2"
cmp_res=$?
set -e
if [ $cmp_res -eq "2" ]; then
continue
fi
fi
VERSIONS_TO_TEST+=("${ver}")
done <<< "$ALL_VERSIONS"

Expand Down

0 comments on commit 93b32c9

Please sign in to comment.