Try to get Windows CI working again

When I added the hack to get Python 3.6 running on our AppVeyor Windows CI,
everything passed, but now we have a problem. The images generated on
Windows/Py36 are now different from what we've historically expected. This
isn't shocking since my hack was to fix the version of pyqt to avoid a library
incompatibility issue, for Python 3.6 only.

Let's try applying the same version constraint *everywhere*. From my
experiments, this seems to make Windows/Py3.x create images agreeing with the
'webkit' test corpus, while Windows/Py2.7 still agrees with 'webkit_win'. One
clear difference between the two is the reported OpenGL renderer, so revise
the test logic to factor that in when choosing which corpus to compare
against.
This commit is contained in:
Peter Williams 2019-06-05 23:59:28 -04:00
Родитель 3f9eb34b67
Коммит 8f5cddb962
3 изменённых файлов: 13 добавлений и 4 удалений

Просмотреть файл

@ -13,15 +13,14 @@ environment:
# to the matrix section.
CONDA_CHANNELS: "astrofrog/label/dev conda-forge"
CONDA_DEPENDENCIES: "astropy qtpy traitlets ipywidgets>=7.0 ipyevents widgetsnbextension pyqt pytest pytest-cov>=2.6.1 pytest-remotedata>=0.3.1 requests matplotlib flask flask-cors pyopengl"
# Without the pyqt version constraint, a lib compat issue leads to import failures on qtpy for Python 3.6:
CONDA_DEPENDENCIES: "astropy qtpy traitlets ipywidgets>=7.0 ipyevents widgetsnbextension pyqt==5.6.0 pytest pytest-cov>=2.6.1 pytest-remotedata>=0.3.1 requests matplotlib flask flask-cors pyopengl"
PIP_DEPENDENCIES: "pytest-faulthandler codecov reproject"
matrix:
- PYTHON_VERSION: "2.7"
- PYTHON_VERSION: "3.5"
- PYTHON_VERSION: "3.6"
# Without the pyqt version constraint, a lib compat issue leads to import failures on qtpy:
CONDA_DEPENDENCIES: "astropy qtpy traitlets ipywidgets>=7.0 ipyevents widgetsnbextension pyqt==5.6.0 pytest pytest-cov>=2.6.1 pytest-remotedata>=0.3.1 requests matplotlib flask flask-cors pyopengl"
# matrix:
# fast_finish: true

Просмотреть файл

@ -40,7 +40,10 @@ if QT_INSTALLED and OPENGL_INSTALLED:
return info
_cached_opengl_renderer = ''
def pytest_report_header(config):
global _cached_opengl_renderer
lines = []
@ -69,6 +72,10 @@ def pytest_report_header(config):
lines.append("OpenGL Version: {0}".format(opengl_info['version']))
lines.append("Shader Version: {0}".format(opengl_info['shader']))
# This is (no surprise) a hack to enable the Windows testing
# framework to check which renderer WebKit is using, which affets
# the output.
_cached_opengl_renderer = opengl_info['renderer']
else:
lines.append("Could not determine OpenGL version (OpenGL package required)")

Просмотреть файл

@ -79,8 +79,11 @@ with open('actual.png', 'wb') as f:
def assert_widget_image(tmpdir, widget, filename):
actual = tmpdir.join(filename).strpath
widget.render(actual)
from ..conftest import _cached_opengl_renderer
framework = 'webengine' if WEBENGINE else 'webkit'
if sys.platform.startswith('win') and not WEBENGINE:
if sys.platform.startswith('win') and not WEBENGINE and 'GDI' in _cached_opengl_renderer:
framework += '_win'
elif sys.platform.startswith('darwin'):
framework += '_osx'