Conversation
Adjust the GitHub Actions release job: add a 15-minute timeout and replace the single release step with separate uploads for Linux and Windows binaries. Use explicit file patterns (artifacts/**/PyMacroRecorder-Linux and artifacts/**/PyMacroRecorder-Windows.exe) and enable overwrite_files; both upload steps use the GITHUB_TOKEN from the GH_PAT secret. Download artifacts step remains unchanged.
Add a comprehensive test suite and headless fixtures: new tests for app, config, hotkeys, models, player, recorder, storage and utils, plus tests/conftest.py providing fake tkinter and pynput objects for headless execution. Update CI to lint tests as well, run pytest with coverage, and upload coverage to Codacy. Remove PyInstaller installs from CI/release scripts and build-manylinux.sh, and add pytest-cov to requirements.
There was a problem hiding this comment.
Pull request overview
This pull request merges comprehensive testing infrastructure and CI/CD improvements from the dev branch to master. The changes introduce headless testing capabilities for a Tkinter-based macro recorder application, enabling automated testing without GUI or hardware dependencies. The PR also refines the CI/CD workflows by consolidating dependency management and improving the release process.
Changes:
- Added comprehensive headless test suite with fake implementations of
tkinterandpynputfor testing without GUI/hardware dependencies - Enhanced CI/CD workflows with pytest coverage reporting, Codacy integration, and refined binary release process
- Streamlined dependency management by removing redundant
pyinstallerinstallation steps from workflows and build scripts
Reviewed changes
Copilot reviewed 12 out of 13 changed files in this pull request and generated 23 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/conftest.py | Provides headless fixtures and fake implementations for tkinter and pynput to enable testing without GUI |
| tests/test_app.py | Tests for Tkinter app utilities including logging, hotkey handling, preview population, and macro save/load |
| tests/test_config.py | Tests for configuration loading/saving with validation and normalization |
| tests/test_hotkeys.py | Tests for hotkey manager including filtering, dispatching, and capture functionality |
| tests/test_models.py | Tests for macro data models |
| tests/test_player.py | Tests for macro playback engine |
| tests/test_recorder.py | Tests for event recording with delay calculation and hotkey filtering |
| tests/test_storage.py | Tests for CSV persistence of macros |
| tests/test_utils.py | Tests for keyboard/mouse utility functions |
| requirements.txt | Adds pytest-cov for coverage reporting |
| .github/workflows/ci.yml | Expands linting to include tests directory, enables pytest with coverage, adds Codacy upload |
| .github/workflows/release.yml | Separates Linux and Windows binary uploads, adds timeout, removes redundant pyinstaller install |
| build-manylinux.sh | Removes redundant pyinstaller installation step |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferencesFootnotes
|
Add .codacy.yaml to exclude test files from Codacy analysis and refactor tests/conftest.py to improve headless test support. Replace the previous inline try/except with standalone fake tkinter classes (_FakeWidget, _FakeTk, _FakeStringVar, _FakePhotoImage, _FakeEvent) and introduce helper functions (_setup_fake_tkinter_modules and _check_tkinter_available) that populate sys.modules with fake tkinter modules when tkinter is not available. Expand the fake widget API (selection, index, mainloop, title, geometry, iconphoto, iconbitmap, etc.) for more complete emulation during tests.
Translate French test/module docstrings to English and add descriptive docstrings/comments for fake widgets, listeners, and helper methods used in headless tests. Adjusted pylint disables and added small lint-friendly annotations (e.g. enum name suppression). These are documentation/clarity changes only and should not alter test behavior.
Add detailed module-level and function/class docstrings across the test suite and conftest fakes to clarify intent and behavior for headless testing. Changes document fake tkinter and pynput implementations, expand test descriptions and parameter notes, and annotate helper fakes used in tests. No functional logic changes—this is purely documentation and test readability improvements across tests/conftest.py, tests/test_*.py files.
Add a CI step that runs codacy/codacy-coverage-reporter-action@v1 to submit coverage variation to Codacy. The step uses the CODACY_PROJECT_TOKEN secret and points to coverage.xml, placed after the existing Codacy bash report step in the workflow.
Replace the manual bash upload (curl get.sh) and the separate Codacy variation step with codacy/codacy-coverage-reporter-action@v1. Consolidates coverage upload and variation/diff reporting into a single action, uses the CODACY_PROJECT_TOKEN secret, and removes the external script fetch to simplify and harden the CI workflow.
Remove the matrix.extension suffix from uploaded artifact names and tighten the release upload paths to the exact artifact files. This makes artifact names consistent across runners (ci.yml & release.yml) and ensures the release job uploads the correct binaries (artifacts/PyMacroRecorder-Linux/PyMacroRecorder and artifacts/PyMacroRecorder-Windows/PyMacroRecorder.exe) instead of relying on globs.
This pull request introduces improvements to CI/CD workflows and adds comprehensive headless tests for the application and configuration logic. The most significant changes are grouped below.
CI/CD Workflow Enhancements:
.github/workflows/ci.ymlby including thetestsdirectory forpylintandruff, enablingpytestwith coverage reporting, and uploading coverage results to Codacy..github/workflows/release.ymlto separately upload Linux and Windows binaries with proper naming and overwrite behavior, and added a timeout for the publish job.pyinstallerinstallation from CI and release workflows as well as from thebuild-manylinux.shscript, streamlining dependency management. [1] [2] [3]Testing Improvements:
tests/conftest.pymodule to provide headless fixtures and fakes fortkinterandpynput, enabling reliable testing without GUI or hardware dependencies.tests/test_app.pywith thorough headless tests for the main Tkinter app utilities, covering logging, hotkey handling, preview population, event deletion, recording/playback flows, and macro save/load logic.tests/test_config.pyto verify configuration loading and saving, including default handling, JSON validation, hotkey normalization, and disk write behavior.