[QGIS-Developer] Tests failing with PostgreSQL 12/PostGIS 3.0

Sandro Santilli strk at kbt.io
Wed May 11 06:48:50 PDT 2022


On Tue, Sep 29, 2020 at 10:41:17AM -0300, José de Paula Rodrigues via QGIS-Developer wrote:
> Hi all,
> 
> I've tried running some test cases locally against PostgreSQL 12 and
> PostGIS 3.0.0 ~ 3.0.2. These tests are consistently failing here,
> whereas they run successfully on Travis. Attached are the logs of
> running
> 
> ctest --progress --output-on-failure -R '(PyQgsPostgresProvider)'
> 
> against the latest master commit
> (a0ec11948b561029b5d838dee89dc7ea4c8d115b, 2020-09-29 08:52+0200),
> with QGIS_DEBUG=5 environment variable. The file unpacks to a 18M
> plaintext log.
> 
> The failure found on line 167545 doesn't bother me much, it looks like
> a rounding error which can be easily corrected by applying round() to
> both sides of the test comparison.
> 
> What worries me is the failure reported on line 167554. From what I
> could figure, it comes from the SQL statement printed on line 17136:
> 
> DECLARE qgis_745 BINARY CURSOR FOR SELECT
> st_asbinary("geom",'NDR'),ctid,"pk"::text FROM
> "qgis_test"."some_poly_data" WHERE
> ST_Overlaps(ST_Buffer("geom",1,'8'),ST_GeomFromText('Polygon ((-75.1
> 76.1, -75.1 81.6, -68.8 81.6, -68.8 76.1, -75.1 76.1))',4326))
> 
> This makes the database report the following error: "Missing value for
> buffer parameter 8"
> 
> As I said, however, these tests run flawlessly on Travis, and they
> used to run flawlessly on my local PostgreSQL 12/PostGIS 3.0.2
> environment; I'm at a loss to pinpoint what changed, and maybe this is
> one more reason to upgrade the CI to test against newer PostgreSQL
> versions.

Try removing the quotes from the '8' parameter. Those quotes are
telling PostgreSQL to use the version of ST_Buffer taking buffer style
parameters, and there is no parameter named '8' (i would be 'quad_segs=8')

See https://postgis.net/docs/ST_Buffer.html

--strk;



More information about the QGIS-Developer mailing list