forked from enova/pgl_ddl_deploy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_all_versions.sh
executable file
·48 lines (39 loc) · 1 KB
/
test_all_versions.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/bash
set -eu
orig_path=$PATH
unset PGSERVICE
set_path() {
version=$1
export PATH=/usr/lib/postgresql/$version/bin:$orig_path
}
get_port() {
version=$1
pg_lsclusters | awk -v version=$version '$1 == version { print $3 }'
}
make_and_test() {
version=$1
from_version=$2
set_path $version
make clean
sudo "PATH=$PATH" make uninstall
sudo "PATH=$PATH" make install
port=$(get_port $version)
PGPORT=$port psql postgres -c "SELECT pg_terminate_backend(pid) FROM pg_stat_activity WHERE datname = 'contrib_regression' AND pid <> pg_backend_pid()"
FROMVERSION=$from_version PGPORT=$port make installcheck
}
test_all_versions() {
from_version="$1"
cat << EOM
*******************FROM VERSION $from_version******************
EOM
make_and_test "9.5" $from_version
make_and_test "9.6" $from_version
make_and_test "10" $from_version
make_and_test "11" $from_version
make_and_test "12" $from_version
}
#test_all_versions "1.7"
test_all_versions "1.6"
test_all_versions "1.5"
#test_all_versions "1.4"
#test_all_versions "1.3"