Add running tests in CI for each PR and commit on master#1168
Open
megahirt wants to merge 9 commits into
Open
Conversation
- Bump actions/checkout and actions/setup-python to v6 - Bump actions/upload-artifact to v7 - Add --junit-xml output to both pytest invocations - Add EnricoMi/publish-unit-test-result-action@v2 step to both jobs - Add workflow-level permissions for checks and pull-requests writes Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The test harness calls python/scripts/ptxprint as a subprocess which uses the #!/usr/bin/python3 shebang. On the GHA runner this resolves to system Python (missing regex, fonttools etc.) rather than the setup-python venv. Redirect /usr/bin/python3 to the venv Python after pip install so the shebang finds the correct interpreter. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
parlocs.py unconditionally imports gi (PyGObject). Fix by: - Adding libgirepository1.0-dev, libcairo2-dev, gir1.2-gtk-3.0, python3-gi, python3-gi-cairo, xvfb to apt dependencies - Switching to pip install -e ".[gui]" to pull in pygobject/pycairo - Running pytest under xvfb-run so GTK can open a virtual display Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
pygobject 3.56.2 requires girepository-2.0 which conflicts with the libgirepository1.0-dev apt package on Ubuntu 24.04. Avoid building from source by installing python3-gi via apt and exposing it to the venv Python through PYTHONPATH=/usr/lib/python3/dist-packages. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The python3-gi apt package on Ubuntu 24.04 ships _gi compiled for Python 3.12. Running with Python 3.11 causes an ABI mismatch: ImportError: cannot import name '_gi' from partially initialized module 'gi' Switching setup-python to 3.12 makes the C extension importable. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
XeTeX now runs successfully but done_job uses Poppler via GObject
introspection to diff the output PDF against the baseline. Add the
Poppler GIR typelib so gi.require_version('Poppler', ...) succeeds.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* test: trigger GHA workflow to verify PR test reporting Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * ci: create test/tmp directory for archive verification step --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
Author
|
@mhosken consider merging this one first so that all subsequent PRs get a "green check" for running tests on the PR branch... :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a new GitHub Actions workflow to automate Python testing for the project. The workflow is designed to run both unit and integration tests on relevant code changes, ensuring code quality and reliability through continuous integration.
Continuous Integration Setup:
.github/workflows/python-tests.ymlworkflow that triggers on pushes and pull requests to themasterbranch, as well as manual dispatches. The workflow runs when changes are made to Python source, test files, or configuration files.Testing Jobs:
pytestontest_usfmx.py, publishing the results to GitHub.pytestontest_projects.pyusingxvfb, and publishes test results. On failure, it uploads PDF diffs and log files as artifacts for debugging.Permissions and Reporting:
publish-unit-test-result-actionto report test outcomes in GitHub checks.