Repository: kyamagu/skia-python (language: python)

Issue:
GL related tests on linux getting skipped on CI recently
@kyamagu it looks like the largest number of passed tests on CI is mac os x at the moment (110 skipped), and I just noticed that most of the GL related tests are being skipped on Linux (300+ skipped). So this is the opposite situation before the recent GL related fix for mac os x. I suspect the new GL settings doesn't quite work against Xvfb. I haven't noticed / checked CI as pytest gives 100- skipped on my own linux box. Probably a Xvfb issue there (Xvfb does not support higher GL versions). To investigate.


Discussion / hints:
Unfortunately CI only keeps logs for 3 months so we don't know when it happened. I'll need to run the older release fresh on my playground to find out. Probably not important as the new GL versions work against real X.

Fix patch:
diff --git a/docs/tutorial/canvas.rst b/docs/tutorial/canvas.rst
index 16eb1791..ff658761 100644
--- a/docs/tutorial/canvas.rst
+++ b/docs/tutorial/canvas.rst
@@ -91,10 +91,11 @@ The following example uses glfw package to create an OpenGL context. Install
         glfw.window_hint(glfw.VISIBLE, glfw.FALSE)
         glfw.window_hint(glfw.STENCIL_BITS, 8)
         # see https://www.glfw.org/faq#macos
-        glfw.window_hint(glfw.CONTEXT_VERSION_MAJOR, 3)
-        glfw.window_hint(glfw.CONTEXT_VERSION_MINOR, 2)
-        glfw.window_hint(glfw.OPENGL_FORWARD_COMPAT, True)
-        glfw.window_hint(glfw.OPENGL_PROFILE, glfw.OPENGL_CORE_PROFILE)
+        if sys.platform.startswith("darwin"):
+            glfw.window_hint(glfw.CONTEXT_VERSION_MAJOR, 3)
+            glfw.window_hint(glfw.CONTEXT_VERSION_MINOR, 2)
+            glfw.window_hint(glfw.OPENGL_FORWARD_COMPAT, True)
+            glfw.window_hint(glfw.OPENGL_PROFILE, glfw.OPENGL_CORE_PROFILE)
         window = glfw.create_window(640, 480, '', None, None)
         glfw.make_context_current(window)
         yield window
@@ -144,10 +145,11 @@ Here's a complete example:
             raise RuntimeError('glfw.init() failed')
         glfw.window_hint(glfw.STENCIL_BITS, 8)
         # see https://www.glfw.org/faq#macos
-        glfw.window_hint(glfw.CONTEXT_VERSION_MAJOR, 3)
-        glfw.window_hint(glfw.CONTEXT_VERSION_MINOR, 2)
-        glfw.window_hint(glfw.OPENGL_FORWARD_COMPAT, True)
-        glfw.window_hint(glfw.OPENGL_PROFILE, glfw.OPENGL_CORE_PROFILE)
+        if sys.platform.startswith("darwin"):
+            glfw.window_hint(glfw.CONTEXT_VERSION_MAJOR, 3)
+            glfw.window_hint(glfw.CONTEXT_VERSION_MINOR, 2)
+            glfw.window_hint(glfw.OPENGL_FORWARD_COMPAT, True)
+            glfw.window_hint(glfw.OPENGL_PROFILE, glfw.OPENGL_CORE_PROFILE)
         window = glfw.create_window(WIDTH, HEIGHT, '', None, None)
         glfw.make_context_current(window)
         yield window


Test patch:
diff --git a/tests/conftest.py b/tests/conftest.py
index a8b40518..0658d2ae 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -16,10 +16,11 @@ def glfw_context():
     glfw.window_hint(glfw.VISIBLE, glfw.FALSE)
     glfw.window_hint(glfw.STENCIL_BITS, 8)
     # see https://www.glfw.org/faq#macos
-    glfw.window_hint(glfw.CONTEXT_VERSION_MAJOR, 3)
-    glfw.window_hint(glfw.CONTEXT_VERSION_MINOR, 2)
-    glfw.window_hint(glfw.OPENGL_FORWARD_COMPAT, True)
-    glfw.window_hint(glfw.OPENGL_PROFILE, glfw.OPENGL_CORE_PROFILE)
+    if sys.platform.startswith("darwin"):
+        glfw.window_hint(glfw.CONTEXT_VERSION_MAJOR, 3)
+        glfw.window_hint(glfw.CONTEXT_VERSION_MINOR, 2)
+        glfw.window_hint(glfw.OPENGL_FORWARD_COMPAT, True)
+        glfw.window_hint(glfw.OPENGL_PROFILE, glfw.OPENGL_CORE_PROFILE)
     context = glfw.create_window(640, 480, '', None, None)
     glfw.make_context_current(context)
     logger.debug('glfw context created')