From 3106f191395063157a8516b994dfe134815eb81c Mon Sep 17 00:00:00 2001 From: Nyall Dawson Date: Mon, 16 Dec 2024 13:49:05 +1000 Subject: [PATCH 1/2] Disable broken test for automatic transaction groups on GDAL >= 3.5 This functionality is broken on newer GDAL versions, due to incorrect assumptions at time of development. See https://github.com/qgis/QGIS/pull/59797#issuecomment-2544133498 Parties interested in seeing this test resurrected are welcome to submit fixes. --- tests/src/python/test_qgsvectorlayereditbuffer.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tests/src/python/test_qgsvectorlayereditbuffer.py b/tests/src/python/test_qgsvectorlayereditbuffer.py index 9944664d98aa..196f20052d94 100644 --- a/tests/src/python/test_qgsvectorlayereditbuffer.py +++ b/tests/src/python/test_qgsvectorlayereditbuffer.py @@ -11,6 +11,7 @@ __copyright__ = "Copyright 2016, The QGIS Project" import os +from osgeo import gdal from qgis.PyQt.QtCore import QTemporaryDir, QVariant from qgis.PyQt.QtTest import QSignalSpy @@ -31,6 +32,10 @@ start_app() +def GDAL_COMPUTE_VERSION(maj, min, rev): + return (maj) * 1000000 + (min) * 10000 + (rev) * 100 + + def createEmptyLayer(): layer = QgsVectorLayer( "Point?field=fldtxt:string&field=fldint:integer", "addfeat", "memory" @@ -843,7 +848,12 @@ def _check_feature(wkt): self.assertEqual(f.attribute(2), None) _test(Qgis.TransactionMode.Disabled) - _test(Qgis.TransactionMode.AutomaticGroups) + + # THIS FUNCTIONALITY IS BROKEN ON NEWER GDAL VERSIONS, DUE TO INCORRECT + # assumptions at time of development. See https://github.com/qgis/QGIS/pull/59797#issuecomment-2544133498 + if int(gdal.VersionInfo("VERSION_NUM")) < GDAL_COMPUTE_VERSION(3, 5, 0): + _test(Qgis.TransactionMode.AutomaticGroups) + _test(Qgis.TransactionMode.BufferedGroups) From 636e1a5d9ec6fb4cda2ec56d2cf112cf80a7844b Mon Sep 17 00:00:00 2001 From: Nyall Dawson Date: Mon, 16 Dec 2024 13:50:33 +1000 Subject: [PATCH 2/2] Run test on qt6 --- .ci/test_blocklist_qt6.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/.ci/test_blocklist_qt6.txt b/.ci/test_blocklist_qt6.txt index bf8da70ae337..e6ccd68c4db3 100644 --- a/.ci/test_blocklist_qt6.txt +++ b/.ci/test_blocklist_qt6.txt @@ -49,7 +49,6 @@ PyQgsPalLabelingPlacement PyQgsRasterAttributeTable PyQgsRasterLayerRenderer PyQgsSymbolLayerReadSld -PyQgsVectorLayerEditBuffer PyQgsLayerDefinition PyQgsSettings PyQgsSettingsEntry