-
Notifications
You must be signed in to change notification settings - Fork 613
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
Use pytest as our test runner #1177
Comments
I have a bit of time, so I'll make a proposal here. Currently, we use bazel for 3 things:
My plan would be to do:
To do that, we need to have TF addons working in editable mode. This is required by python test runners (not only pytest, uniitest too when not working with bazel). This has another benefit: It's a more flexible developement environement. IDEs will work, and we can run python code in scripts using our developement version of Addons. See #1186 . To sum it up. Here would be the steps:
bazel build //tensorflow_addons/... (same as before)
See #1186 pip install -e ./ # install the python project in editable mode
python configure.py
bash tools/install_so_files.sh # compiling custom ops + copy in the right directory
pytest ./ when running the tests again: bash tools/install_so_files.sh # should be very fast because of the bazel cache
pytest ./ or if no C++/Cuda files, have changed, it's possible to skip the
Same as before. See the github workflow files, that doesn't change. Benefits
And many more! Note that the codebase changes are not mandatory. Pytest will happily run our current codebase, on the condition that the SO files are in the right places (merging #1186 is enough). Drawbacks
Changes requiredAnd after that only some minor fixes here and there. Running pytest is already possible on the huge majority of test files in TF addons given that the SO are in the right places. Some interesting linksRunning unittest with pytest Proof of concept with pytest running in the CI |
Final and clean pull request: #1243 |
See #1174.
We have multiple approches to this change and I believe it would be beneficial to discuss it before implementing anything.
@Squadrick would you be able when you have the time to make a summary of how you see the migration? I may not have fully undertood your plan. I'll also make a summary of how I see a possible pytest adoption afterwards so I can highlight the differences and the points where we're going in the same direction.
Thank you in advance.
@seanpmorgan We might need to discuss it in the monthly meeting.
The text was updated successfully, but these errors were encountered: