Conversation
* Initial plan * Add test coverage for explicit raise statements Co-authored-by: lispandfound <12835929+lispandfound@users.noreply.github.com> * Add comprehensive test coverage for geo module Co-authored-by: lispandfound <12835929+lispandfound@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: lispandfound <12835929+lispandfound@users.noreply.github.com>
* Initial plan * Add basic tests for omitted modules Co-authored-by: lispandfound <12835929+lispandfound@users.noreply.github.com> * fix: fix ruff and type-checking --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: lispandfound <12835929+lispandfound@users.noreply.github.com> Co-authored-by: Jake Faulkner <jake.faulkner@canterbury.ac.nz>
Summary of ChangesHello @lispandfound, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request represents a substantial refactoring effort aimed at modernizing the project's development and testing infrastructure. By migrating to GitHub Actions and a Highlights
Ignored Files
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces a significant and valuable refactoring of the project. The migration from Jenkins to GitHub Actions, the move to a pyproject.toml-based setup, and the relocation and expansion of tests are all excellent steps towards modernizing the repository and improving its maintainability. The new tests are comprehensive, using property-based testing and covering many edge cases, which greatly increases confidence in the code's correctness and robustness. Overall, this is a high-quality contribution. I have one point of clarification regarding the packaged data.
|
Coverage is improved in type checking PR which adds some coverage exclusions for the numba functions that are causing low test coverage. |
There was a problem hiding this comment.
Pull request overview
This PR performs a major infrastructure refactoring by migrating from Jenkins to GitHub Actions for CI/CD, reorganizing the test suite from qcore/test/ to a top-level tests/ directory, and modernizing the build configuration to use pyproject.toml instead of requirements.txt. The changes also include significant test coverage improvements by adding new test cases for previously untested or under-tested functionality.
Key Changes:
- Migrated CI/CD from Jenkins to GitHub Actions with workflows for pytest, ruff, and deptry
- Moved all tests from
qcore/test/totests/directory following pytest conventions - Converted dependency management from
requirements.txttopyproject.tomlwith explicit dependencies - Added extensive test coverage for functions in utils, timeseries, siteamp, simulation_structure, shared, point_in_polygon, nhm, geo, coordinates, CLI, and archive_structure modules
Reviewed changes
Copilot reviewed 24 out of 54 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_xyts.py | Added type assertions and invalid file handling test |
| tests/test_utils.py | New test file for YAML loading functionality |
| tests/test_timeseries.py | Added comprehensive tests for text output, error handling, and edge cases |
| tests/test_src_site_dist.py | New comprehensive test suite for distance calculations |
| tests/test_siteamp.py | Added return type annotations and input validation tests |
| tests/test_simulation_structure.py | New test suite for simulation structure path utilities |
| tests/test_shared.py | New test suite for station and corner parsing utilities |
| tests/test_point_in_polygon.py | New test suite for polygon containment checks |
| tests/test_nhm.py | New comprehensive test suite for NHM fault operations |
| tests/test_grid.py | Added return type annotations and type assertion tests |
| tests/test_geo.py | New comprehensive test suite for geographic calculations |
| tests/test_coordinates.py | Code formatting improvements and consistency fixes |
| tests/test_cli.py | Enhanced CLI testing with additional edge cases |
| tests/test_archive_structure.py | New test suite for archive path utilities |
| pyproject.toml | Migrated from requirements.txt with explicit dependencies and version constraints |
| .github/workflows/*.yml | New GitHub Actions workflows for pytest, ruff, deptry checks |
| requirements.txt | Deleted in favor of pyproject.toml |
| Jenkinsfile | Deleted as part of migration to GitHub Actions |
| qcore/test/* | All test files removed as tests migrated to top-level tests/ directory |
Comments suppressed due to low confidence (2)
tests/test_timeseries.py:951
- Missing import for tempfile module. The code uses tempfile.TemporaryFile but doesn't import tempfile at the top of the file.
tests/test_coordinates.py:92 - Variable geod is not used.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This reverts commit 22fecb6.
This PR does three things that couldn't easily be separated:
As part of (1) and (2), the PR moved to a
pyproject.tomlbased setup for everything and deleted the requirements.txtNote
The high line count is because I added a
uv.lockfile to get the GitHub Actions to reliably reproduce.Note
Coverage check fails for now because of numba functions. This is addressed in #365 and #366