-
Notifications
You must be signed in to change notification settings - Fork 93
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
Better cross-platform compatibility in test files #444
Conversation
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.
Looks good to me, just a few changes necessary. Thanks a lot.
I didn't realise but what you described in #443 also happens in the Travis CI, meaning we can't merge even if you fix the few review comments. We need first to fix the Travis pipeline. Something has changed in the environment, it used to work for months. Let me know if you want to fix it yourself (even in this same PR) or if I should do it. |
Thanks for the pointers, I really appreciate it! I will address them later today. I can also fix the issue described in #443 in this PR, no problem. When you have some time, I am interested to hear how to run individual tests outside of tox. Being still largely unfamiliar with this ecosystem of tools, I've now resorted to running tox from PyCharm, which is less than ideal. |
Looks like "later today" is now. :) I have addressed the pointers. I also changed the Travis Windows build command but it seems like it didn't pick it up for the pull request build..., that is a bit awkward. :) https://travis-ci.com/github/rdiff-backup/rdiff-backup/jobs/368143319 |
Run individual tests outside of tox: check the ./setup.py clean --all # only if you've built wheels before and the shell complains about missing python
./setup.py build
PATH=$PWD/build/scripts-3.7:$PATH PYTHONPATH=$PWD/build/lib.linux-x86_64-3.7 python testing/somethingtest.py The nice thing is that you can also use the unittest parameters e.g. |
Regarding the Travis error, it seems to take the new version (I see the added Do you have enough rights to see the Travis job logs? |
@ericzolf Thanks for the testing instructions, I will check it out! As for the Travis, yeah I didn't look closely enough and was looking only at the abbreviation. Upon closer inspection indeed it seems to have taken the changed command line. I did some permutations on my machine (because honestly I have no knowledge about cmake at all...) and turns it out it's rather simple. There was
Yes! |
Everything looks good so nothing to do with your changes but I'm still hesitating:
|
Yeah I totally understand. What I observed is that using At the same time I'm fairly certain that my code changes did not break the pipeline either, as it already didn't work on my computer before I started tinkering with the code (hence why I raised #443). Is there any way to start a Travis CI build for I would propose that I strip the commits that are trying to fix the Travis build from this pull request and limit the scope to only the changes in the Python files. Then the Travis build issue can be addressed separately and doesn't have to interfere with these other changes. |
This is the last build on master: https://travis-ci.com/github/rdiff-backup/rdiff-backup/jobs/366370770 When quickly scanning some of the output, I notice the following:
So it looks like somewhere either between 7 days ago and now, or between master and my branch, it has changed between using Doing some experimentation locally again, it looks like it takes this value from the currently used Python installation. When I run Checking now how Python is installed in Travis, it seems like this is the issue: pyenv-win/pyenv-win#128 I will try and see how difficult it is to pin a That situation is addressed in: #445. I have removed the commits that changed that Travis cmake command from this pull request. |
I've merged back master into this branch so there shouldn't be anything against merging if the tests don't fail again. |
It was a bumpy ride for a first PR (which became a 2nd one)! Thanks for your tenacity! |
This is a (small) step towards #347, to ensure tests run on Windows. I have found a pretty good way to run the tests both on Linux and Windows (manually, yet) which allows me to identify areas which need some more work, address them, then check if tests still run on both.
os.getenvb
is not supported on Windowsrm -rf
obviously also isn't, unfortunatelyshutil.rmtree
only removes directories so an additional check to delete files was necessary/dev/urandom
on Windows