Unit testing on Github Actions #2744
McDic
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have finally made working workflows for unit testing on mixed language maturin project.
Workflow file: test.yml
You can just do
maturin developto install the module and run Python tests locally, but this command does not support running outside of virtual environment. So I built the wheel file withmaturin buildand did a installation of entire module viapip installdirectly.And finally the cwd is moved(
cd) into the testing directory and then ranpython -m unittest. This is because if you runpythonon the repository root, this may conflict with repository Python code(which leads to error because of absence of built Rust modules) if you have same name of directory on the repository root.The actual
ymlfile is simple but I noticed there aren't many pages that covers any guides or questions regarding testing Python codes on CI, so I decided to share this.Beta Was this translation helpful? Give feedback.
All reactions