Skip to content

Commit 2e7ec6c

Browse files
committed
(CI/update) fixing test Test old version before update
1 parent d5f24eb commit 2e7ec6c

File tree

2 files changed

+45
-41
lines changed

2 files changed

+45
-41
lines changed

.github/workflows/update.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,16 +94,16 @@ jobs:
9494
cmake -DPOSTGRESQL_VERSION=${PGVER} -DCMAKE_BUILD_TYPE=Release -DWITH_DOC=OFF ..
9595
make -j 4
9696
sudo make install
97-
sudo service postgresql start
98-
createdb -p "${PGPORT}" ___pgr___test___
99-
psql -p "${PGPORT}" -d ___pgr___test___ -c "CREATE EXTENSION pgrouting CASCADE;"
10097
10198
- name: Test old version before update with current tests
10299
run: |
103100
sudo service postgresql start
101+
createdb -p "${PGPORT}" ___pgr___test___
102+
psql -p "${PGPORT}" -d ___pgr___test___ -c "CREATE EXTENSION pgrouting CASCADE;"
104103
psql -p "${PGPORT}" -d ___pgr___test___ -c "SELECT * FROM pgr_full_version();"
105104
DIR=$(git rev-parse --show-toplevel)
106105
bash "${DIR}/tools/testers/setup_db.sh" "${PGPORT}" ___pgr___test___ "${PG_RUNNER_USER}" "${{ matrix.old_pgr }}"
106+
psql -p "${PGPORT}" -d ___pgr___test___ -c "SELECT * FROM pgr_full_version();"
107107
pg_prove -Q -f --normalize --directives --recurse -U "${PG_RUNNER_USER}" -d ___pgr___test___ "pgtap"
108108
109109
- name: Build current version
@@ -118,8 +118,11 @@ jobs:
118118
- name: Test old version with currrent tests after installing current
119119
run: |
120120
sudo service postgresql start
121-
psql -p "${PGPORT}" -d ___pgr___test___ -c "SELECT * FROM pgr_full_version();"
121+
dropdb -p "${PGPORT}" ___pgr___test___
122+
createdb -p "${PGPORT}" ___pgr___test___
122123
DIR=$(git rev-parse --show-toplevel)
124+
bash "${DIR}/tools/testers/setup_db.sh" "${PGPORT}" ___pgr___test___ "${PG_RUNNER_USER}" "${{ matrix.old_pgr }}"
125+
psql -p "${PGPORT}" -d ___pgr___test___ -c "SELECT * FROM pgr_full_version();"
123126
pg_prove -Q -f --normalize --directives --recurse -U "${PG_RUNNER_USER}" -d ___pgr___test___ "pgtap"
124127
125128
- name: Test old version with current tests after update

src/legacy/legacy.c

Lines changed: 38 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,28 @@
1-
/**********************************************************************
2-
*
3-
* PostGIS - Spatial Types for PostgreSQL
4-
* http://postgis.net
5-
*
6-
* PostGIS is free software: you can redistribute it and/or modify
7-
* it under the terms of the GNU General Public License as published by
8-
* the Free Software Foundation, either version 2 of the License, or
9-
* (at your option) any later version.
10-
*
11-
* PostGIS is distributed in the hope that it will be useful,
12-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14-
* GNU General Public License for more details.
15-
*
16-
* You should have received a copy of the GNU General Public License
17-
* along with PostGIS. If not, see <http://www.gnu.org/licenses/>.
18-
*
19-
**********************************************************************
20-
*
21-
* Copyright (C) 2018-2020 Regina Obe <[email protected]>
22-
*
23-
**********************************************************************/
1+
/*PGR-GNU*****************************************************************
2+
File: legacy.c
3+
4+
Copyright (c) 2017 pgRouting developers
5+
6+
7+
Copyright (c) 2018-2020 Regina Obe <[email protected]>
8+
------
9+
10+
This program is free software; you can redistribute it and/or modify
11+
it under the terms of the GNU General Public License as published by
12+
the Free Software Foundation; either version 2 of the License, or
13+
(at your option) any later version.
14+
15+
This program is distributed in the hope that it will be useful,
16+
but WITHOUT ANY WARRANTY; without even the implied warranty of
17+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18+
GNU General Public License for more details.
19+
20+
You should have received a copy of the GNU General Public License
21+
along with this program; if not, write to the Free Software
22+
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23+
24+
********************************************************************PGR-GNU*/
25+
2426
/******************************************************************************
2527
* This file is to hold functions we no longer use,
2628
* but we need to keep because they were used at one time behind SQL API functions.
@@ -35,20 +37,19 @@
3537
#include "utils/builtins.h"
3638

3739
#define PGROUTING_DEPRECATE(version, funcname) \
38-
Datum funcname(PG_FUNCTION_ARGS); \
39-
PG_FUNCTION_INFO_V1(funcname); \
40-
Datum funcname([[maybe_unused]] PG_FUNCTION_ARGS) \
41-
{ \
42-
ereport(ERROR, (\
43-
errcode(ERRCODE_FEATURE_NOT_SUPPORTED), \
44-
errmsg("A stored procedure tried to use deprecated C internal function '%s'", \
45-
__func__), \
46-
errdetail("Library function '%s' was deprecated in pgRouting %s", \
47-
__func__, version), \
48-
errhint("Consider upgrade pgRouting") \
49-
)); \
50-
PG_RETURN_POINTER(NULL); \
51-
}
40+
Datum funcname(PG_FUNCTION_ARGS); \
41+
PG_FUNCTION_INFO_V1(funcname); \
42+
Datum funcname([[maybe_unused]] PG_FUNCTION_ARGS) \
43+
{ \
44+
ereport(ERROR, (\
45+
errcode(ERRCODE_FEATURE_NOT_SUPPORTED), \
46+
errmsg("A stored procedure tried to use deprecated C internal function '%s'", \
47+
__func__), \
48+
errdetail("Library function '%s' was deprecated in pgRouting %s", \
49+
__func__, version), \
50+
errhint("Consider upgrade pgRouting"))); \
51+
PG_RETURN_POINTER(NULL); \
52+
}
5253

5354
PGROUTING_DEPRECATE("4.0.0", _pgr_trsp)
5455
PGROUTING_DEPRECATE("4.0.0", _v4trsp)

0 commit comments

Comments
 (0)