Skip to content

Add CI to run the unit test suite on pull requests #17

Description

@dmccoystephenson

Context

PR #10 introduces this repository's first automated tests, in tests/test_render_window.py. They are pure unittest tests that mock Pygame, so they need neither a display nor a running Viron server, and they complete in well under a second.

No .github/workflows/ directory exists, so nothing runs them automatically. Every future change would rely on a reviewer remembering to run python -m unittest discover -s tests by hand.

Proposal

A GitHub Actions workflow should be added that runs on pull requests targeting main and executes:

python -m unittest discover -s tests

Notes for whoever implements this:

  • actions/checkout should be configured without submodules. The Viron submodule is only needed by main.py at runtime; the test suite does not import it, and cloning it would slow the job down for no benefit.
  • README.md states a prerequisite of Python 3.10+, so the workflow's Python version should be pinned at or above that. Note that the current test suite itself uses only the standard library and runs on older interpreters as well.
  • Pygame is imported by render_window.py, so pip install pygame is required even though the tests patch it out.
  • A syntax check over the entry points (python -m py_compile main.py graphik.py __init__.py render_window.py render_window_example.py) would be a cheap addition to the same job, since neither main.py nor the example file is covered by tests.

Note

Adding a workflow modifies .github/workflows/, which is excluded from autonomous merge, so this is expected to be implemented and merged with human review.

This issue body was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener).


drafted by Claude on behalf of Daniel Stephenson

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions