-
Notifications
You must be signed in to change notification settings - Fork 162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make GIS models testable and test in CI #171
Conversation
Use relative imports in all models. This way models can be ran from different locations, which will help with testing them.
Co-Authored-By: rht <[email protected]>
- Rename workflow - Run on each push (which allows developing on test branches in this repo) - Run only on changes to the example models, the test script or the CI config - Allow multiple commits after each other (to allow continuous trial and error
PR is ready for review, all the CI and test code works as intended. Some model example tests fail, and I will fix the most obvious ones, but all others can be fixed in separate PRs. |
@@ -48,7 +40,7 @@ jobs: | |||
- name: Install dependencies | |||
run: | | |||
pip install mesa --pre | |||
pip install pytest | |||
pip install .[test] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reminder to use uv
later in a separate PR.
- cron: '0 6 * * 1' # Monday at 6:00 UTC | ||
|
||
jobs: | ||
# build-stable: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When will this be enabled?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question. I think we will want to make a backport to the mesa-2.x
branch with examples, since Mesa-Geo is meant to work with Mesa 2.3.
So then we will make te split of testing pre-releases + git on the main branch, and stable on the Mesa-Geo 0.8.x branch.
This PR enables testing all GIS models with pytest, just like we do with our regular models (see #65 and #82). This includes a new
test_gis_examples.py
that allows running the tests locally, and is also used in the CI.Checklist
pyproject.toml
.py
file changes ingis
folderCurrently a lot of the example models still fail on various issues with the specific model. Help is very much wanted!