Skip to content
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

Test/base example #190

Merged
merged 28 commits into from
Jan 17, 2025
Merged

Test/base example #190

merged 28 commits into from
Jan 17, 2025

Conversation

zacdezgeo
Copy link
Collaborator

@zacdezgeo zacdezgeo commented Jan 14, 2025

What I Changed

  • Moved plugin code and related assets to ee_plugin folder (mainly to solve import errors for our tests)
  • Add base example in readme to an automated test under test/test_map.py
  • Update other asset paths in other tests
  • Update CI

How to Test It

  • Verify Github Action execution
  • Run tests locally (python -m pytest test)
  • Spin up QGIS and run base example

Other Notes

@zacdezgeo zacdezgeo requested review from gena and alukach January 14, 2025 21:24
@zacdezgeo zacdezgeo self-assigned this Jan 14, 2025
@zacdezgeo
Copy link
Collaborator Author

@gena; the tests currently fail because of authentication (see the github run here). We need to add secrets.EE_CREDENTIALS_JSON to our GitHub secrets. The refresh token doesn't expire, so this should be a lasting solution. @alukach and I do not have admin or maintainer rights, so we can't add the secret.

We did some due diligence to ensure the packaging matches the previous structure even with our refactoring, but we might have some blindspots in how things are published. From our research into the packaging CI and the pavement.py package task, we should have covered everything needed.

* Move fixtures to separate conftest.py file

The goal will be to reuse the fixture for other tests

* Add unit test reproducing the bud

* Fix bug adding vector layers by creating layers with the EE flag

* Simplify code paths layer is a QgsRasterLayer in any case
@zacdezgeo
Copy link
Collaborator Author

We added our EE credentials to the secrets and the tests now pass. We flagged some future improvements on the CI that can be addressed at a later time. They mostly have the intent of optimizing the run (time):

@@ -0,0 +1 @@
PYTHONPATH=${PYTHONPATH}:./extlibs:/Applications/QGIS-LTR.app/Contents/MacOS/lib/python3.9
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't love hardcoding these paths into our repo but I think we can refine that later. These are simply for developer experience so will just be an annoyance for any plugin developers with differing paths.

@zacdezgeo zacdezgeo merged commit fb49243 into master Jan 17, 2025
4 checks passed
@zacdezgeo zacdezgeo deleted the test/base-example branch January 17, 2025 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error after layer is added Increase Code Coverage for Existing Plugin Functionality
2 participants