qgis / QGIS

QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)
https://qgis.org
GNU General Public License v2.0
9.98k stars 2.92k forks source link

TestQgsServerWMSGetMap tests fail image diff test #49031

Open strk opened 2 years ago

strk commented 2 years ago

What is the bug or the crash?

I get a few image diff failures with the TestQgsServerWMSGetMap test:

======================================================================
FAIL: test_mode8bit_with_transparency (__main__.TestQgsServerWMSGetMap)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/src/qgis/qgis/src/master/tests/src/python/test_qgsserver_wms_getmap.py", line 1880, in test_mode8bit_with_transparency
    self._img_diff_error(r, h, "WMS_GetMap_Mode_8bit_with_transparency")
  File "/home/src/qgis/qgis/src/master/tests/src/python/test_qgsserver.py", line 262, in _img_diff_error
    self.assertTrue(test, message)
AssertionError: False is not true : Image is wrong: diff file /tmp/WMS_GetMap_Mode_8bit_with_transparency_result_diff.png

======================================================================
FAIL: test_wms_getmap_highlight (__main__.TestQgsServerWMSGetMap)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/src/qgis/qgis/src/master/tests/src/python/test_qgsserver_wms_getmap.py", line 1234, in test_wms_getmap_highlight
    self._img_diff_error(r, h, "WMS_GetMap_Highlight")
  File "/home/src/qgis/qgis/src/master/tests/src/python/test_qgsserver.py", line 262, in _img_diff_error
    self.assertTrue(test, message)
AssertionError: False is not true : Image is wrong: diff file /tmp/WMS_GetMap_Highlight_result_diff.png

======================================================================
FAIL: test_wms_getmap_highlight_line (__main__.TestQgsServerWMSGetMap)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/src/qgis/qgis/src/master/tests/src/python/test_qgsserver_wms_getmap.py", line 1314, in test_wms_getmap_highlight_line
    self._img_diff_error(r, h, "WMS_GetMap_Highlight_Line")
  File "/home/src/qgis/qgis/src/master/tests/src/python/test_qgsserver.py", line 262, in _img_diff_error
    self.assertTrue(test, message)
AssertionError: False is not true : Image is wrong: diff file /tmp/WMS_GetMap_Highlight_Line_result_diff.png

======================================================================
FAIL: test_wms_getmap_highlight_point (__main__.TestQgsServerWMSGetMap)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/src/qgis/qgis/src/master/tests/src/python/test_qgsserver_wms_getmap.py", line 1259, in test_wms_getmap_highlight_point
    self._img_diff_error(r, h, "WMS_GetMap_Highlight_Point")
  File "/home/src/qgis/qgis/src/master/tests/src/python/test_qgsserver.py", line 262, in _img_diff_error
    self.assertTrue(test, message)
AssertionError: False is not true : Image is wrong: diff file /tmp/WMS_GetMap_Highlight_Point_result_diff.png

======================================================================
FAIL: test_wms_getmap_highlight_point_label_options (__main__.TestQgsServerWMSGetMap)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/src/qgis/qgis/src/master/tests/src/python/test_qgsserver_wms_getmap.py", line 1287, in test_wms_getmap_highlight_point_label_options
    self._img_diff_error(r, h, "WMS_GetMap_Highlight_Point_Label_Options")
  File "/home/src/qgis/qgis/src/master/tests/src/python/test_qgsserver.py", line 262, in _img_diff_error
    self.assertTrue(test, message)
AssertionError: False is not true : Image is wrong: diff file /tmp/WMS_GetMap_Highlight_Point_Label_Options_result_diff.png

======================================================================
FAIL: test_wms_getmap_labeling_settings (__main__.TestQgsServerWMSGetMap)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/src/qgis/qgis/src/master/tests/src/python/test_qgsserver_wms_getmap.py", line 623, in test_wms_getmap_labeling_settings
    self._img_diff_error(r, h, "WMS_GetMap_LabelingSettings")
  File "/home/src/qgis/qgis/src/master/tests/src/python/test_qgsserver.py", line 262, in _img_diff_error
    self.assertTrue(test, message)
AssertionError: False is not true : Image is wrong: diff file /tmp/WMS_GetMap_LabelingSettings_result_diff.png

======================================================================
FAIL: test_wms_getmap_style (__main__.TestQgsServerWMSGetMap)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/src/qgis/qgis/src/master/tests/src/python/test_qgsserver_wms_getmap.py", line 732, in test_wms_getmap_style
    self._img_diff_error(r, h, "WMS_GetMap_StyleDefault")
  File "/home/src/qgis/qgis/src/master/tests/src/python/test_qgsserver.py", line 262, in _img_diff_error
    self.assertTrue(test, message)
AssertionError: False is not true : Image is wrong: diff file /tmp/WMS_GetMap_StyleDefault_result_diff.png

Steps to reproduce the issue

xvfb-run ctest --output-on-failure -R PyQgsServerWMSGetMap$

Versions

Current master as of June 16th 2022 - 5973fb315cdb6d3b3c01e9a33b5339a00b9c9e4d

Supported QGIS version

New profile

Additional context

No response

strk commented 1 year ago

This problem still exists as of current master aka e8dcb8998829f518252d506df3afbe140a9707fe

One of the failing tests seem due to a possibly small difference in rendering, here's the diff file:

WMS_GetMap_Mode_8bit_with_transparency_result_diff

elpaso commented 1 year ago

This is not a bug. You should create a test mask or add an additional test control image as explained here: https://docs.qgis.org/testing/en/docs/developers_guide/unittesting.html#comparing-images-for-rendering-tests