-
Notifications
You must be signed in to change notification settings - Fork 82
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
Dev: Add Initial testing suite #225
Merged
Merged
Conversation
This file contains 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
getting segfaults when running tests on macOS, will have to just run the tests locally. don't have the time to look into it.
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #225 +/- ##
======================================
Coverage ? 0.00%
======================================
Files ? 11
Lines ? 1903
Branches ? 0
======================================
Hits ? 0
Misses ? 1903
Partials ? 0 ☔ View full report in Codecov by Sentry. |
Now rounds the vert positions to 4 decimal places. Reduces data required for storing the snapshots, but there was also floating point errors when testing on my mac laptops after 5-8 decimal places that were slightly different to other machines. This level of accurary should be more than enough, as each vert is being tested on 3 degrees of freedom.
BradyAJohnston
added a commit
that referenced
this pull request
Sep 14, 2023
Dev: Add Initial testing suite Now that a [recent version of bpy](https://pypi.org/project/bpy/) is built and available on PyPi, this enables testing of the addon through `pytest` like other python-based projects. I have set up the workflows for running automatic testing on Windows and Linux machines, but there is a `segfault` error on macOS machines when running on GitHub actions. The tests run fine on my own 2017 MacBook pro, but I haven't looked into it much what the error might be. In previously having discussion with the Blender devs, applying the modifiers and then comparing vertices might be the best strategy for doing snapshot tests. I have a couple of tests so far, which do exactly that for the regular import, cartoon and ribbon methods. There is also a method which tests importing via `.pdb` / `.cif` and downloading from the PDB and ensures their verts are the same. Currently these tests are just positionally based, though the other attributes will also be testable. Best to get some initial tests added and put into the workflow so that potentially others can contribute also. There are errors with importing `pyopenvdb` when using the `bpy` addon. It seems that the library isn't installed into the local python, and instead is called from within the addon itself to load volume files. This currently limits the ability to write any tests involving the volumetric import, but something to work on in the future.
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.
Adds some very initial testing capabilities for the add-on.
Utilises the
bpy
python package build of Blender to run tests. Was previously not being released or maintained by the Blender team, but it seems that now (as of March 30) that the Blender Foundation has taken over the release of thebpy
package. Potential in the future for compilation ofbpy
for different platforms to run the tests.Restructures the repo to be more like a traditional python package repo, adding
Manifest.in
andpyproject.toml
to enable installation withpip install .
for MolecularNodes.Adds
tests/
folder with some initial testing files, as well as snapshots and test data intests/data