From 725aeb9e388a4ae15d110486eca9bfbfa2b2cd46 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 10 Nov 2025 22:44:21 +0000 Subject: [PATCH] Document headless testing environment variables Add PYNPUT_BACKEND=dummy and QT_QPA_PLATFORM=offscreen to test commands in both AGENTS.md and README.md. These environment variables enable running tests in headless environments without X11 display or GUI dependencies. --- AGENTS.md | 9 +++++---- README.md | 4 +++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index db3d1db..0455804 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -12,9 +12,9 @@ This repository contains a Python synthesizer and its accompanying tests. - Build/Install: `uv sync` - Run app: `uv run python main.py` - Lint: `uv run ruff check .` -- Run all tests: `uv run pytest` -- Run single test: `uv run pytest tests/test_file.py::TestClass::test_function -v` -- Test with coverage: `uv run pytest --cov=qwerty_synth --cov-report=html` +- Run all tests: `PYNPUT_BACKEND=dummy QT_QPA_PLATFORM=offscreen uv run pytest` +- Run single test: `PYNPUT_BACKEND=dummy QT_QPA_PLATFORM=offscreen uv run pytest tests/test_file.py::TestClass::test_function -v` +- Test with coverage: `PYNPUT_BACKEND=dummy QT_QPA_PLATFORM=offscreen uv run pytest --cov=qwerty_synth --cov-report=html` ## Code Practices @@ -51,7 +51,8 @@ This repository contains a Python synthesizer and its accompanying tests. 1. Install dependencies with `uv sync`. 2. Ensure the system package `portaudio19-dev` is installed. 3. Run the linter using `uv run ruff check .` and fix issues when possible. -4. Execute the tests: `uv run pytest`. +4. Execute the tests with `PYNPUT_BACKEND=dummy` and `QT_QPA_PLATFORM=offscreen`: + `PYNPUT_BACKEND=dummy QT_QPA_PLATFORM=offscreen uv run pytest`. ## Project Structure diff --git a/README.md b/README.md index bd2754a..2924b91 100644 --- a/README.md +++ b/README.md @@ -84,9 +84,11 @@ Note: MIDI controller input and MIDI file playback are separate features that ca Run the test suite to verify everything is working correctly: ```bash -uv run pytest +PYNPUT_BACKEND=dummy QT_QPA_PLATFORM=offscreen uv run pytest ``` +The environment variables enable headless mode for running tests without a display or X11 server. + ## Usage tips * You can tweak the envelope (ADSR) in real time while playing notes.