arcade icon indicating copy to clipboard operation
arcade copied to clipboard

Headless integration and unit tests

Open pushfoo opened this issue 2 years ago • 1 comments

Enhancement

Current behavior:

GitHub CI does not run tests, while the Windows test runner & Local Linux pytest runs do.

For example, this missing symbol fails on Windows & locally as expected, but does not under the Linux runners.

Expected behavior:

Linux runners fail as expected:

FAILED tests/unit/scene/test_scene_dunder_methods.py::test_contains - NameError: name 'Walls_SpriteList' is not defined

Steps to reproduce/example code:

Use b85a87f5a1a5d1d732 on gran4/improve_scene.

pushfoo avatar May 16 '23 16:05 pushfoo

Recap of discord discussion

Root cause

  1. The Linux CI runners only ran linting & doc build because we had no way to run tests headless before
  2. The self-hosted windows runner was a temporary solution to allow tests to run with a real GL context
  3. Adding headless support to pyglet & arcade happened relatively recently
  4. We still need to finish enabling tests
  5. We need to document the problem better in the meantime

Possible future work / fixes

  1. Get headless working for Linux
  2. (Optional) Build mocks / fixtures to increase unit test purity, like this one added in pyglet
  3. (Optional) DRYing up our GitHub actions config

pushfoo avatar May 16 '23 18:05 pushfoo