-
Notifications
You must be signed in to change notification settings - Fork 76
Convert run_tests script to Python (#168) #185
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
Conversation
@Nebelhom looks like travis is sad ;( |
Travis is sad, because it cannot find I don't really find that surprising, giving that I removed it ;) |
Yup, and that's first thing to fix ;-)
Besides, me gusta 👍 |
run_tests.py
Outdated
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.
This is no longer a bash script...
I agree with @JarekPs comments too, and would be interested to see if we can list the test dependencies in setup.py, but would otherwise be happy with a requirements file for them. |
As mentioned earlier we might want to have it as 'python setup.py test' later. So I would defer the package dependency updates to a separate pull and keep this for the conversion only. For the remaining changes the following URL might be useful: http://pytest.org/latest/goodpractises.html |
Does one of you know of a good HOWTO on using extras_require? It doesn't want to work for me. and various stackoverflows haven't helped yet... thax guys |
Why do you need extras_require on this PR? As said earlier and I think Dave repeated it, its a separate issue. |
I've decided now (with the advice of my fellow developers, i.e. you) to just translate the bash script to a python script. Unfortunately, I encounter two issues that I am not able to fix (or understand for that matter). Any help/hints with them are greatly appreciated.
|
Looks like this happens after install. See https://github.com/pypa/pip/blob/develop/pip/commands/install.py#L292, if you want to skip the cleanup it looks like there are some options. The other option would be to change the log level.
This would imply that ManifestDestiny is not installed. 0.6 is available now, maybe try upgrading? Alternatively, paste the full output from your script.
Is |
In the end, @davehunt's insights made the difference. Many thanks to you for this. Apart from the issue with the logger output, everything is fixed now. While I will try and sort this problem out (most likely setting a suitable flag somewhere), you can already have a browse and check if you like what you see. comments are welcome. Thanks guys. |
run_tests.py
Outdated
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.
Wouldn't this install virtualenv globally on the users machine, and sudo permissions are necessary? I still think we have to download it ourselves as given in the comment.
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.
it actually would. Never thought of it that way.
After a brief search, I cam across the following links with this problem in mind:
http://stackoverflow.com/questions/9348869/how-to-install-virtualenv-without-using-sudo
http://peak.telecommunity.com/DevCenter/EasyInstall#creating-a-virtual-python
The former cites the latter. Would this be a good alternative?
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.
Please check the build scripts of mozmill-environment. We should never have to install virtualenv on the testers box.
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.
you're right as usual. all the build scripts include virtualenv. I'll remove the line.
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.
Are you suggest that running mozdownload tests should be dependent on having a mozmill-environment @whimboo? I don't think this is a good idea. I would suggest throwing an exception if virtualenv is not present and instruct the user to install it in order to run the tests.
run_tests.py
Outdated
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.
We repeat the tests/venv several times. I would suggest putting this a part of the path into a variable.
You were right! I changed it accordingly. Could you look over it again? Let's get this landed :) |
run_tests.py
Outdated
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.
Hm, what about putting all this into a requirements.txt file under tests? I think that would be easier to maintain also in terms if we don't want to have those strict requirements in the future.
I tried to rewrite the script according to the mozmill-environment script. Could you please give me your feedback? I am sure there are things that will need adjusting... Thanks |
README.md
Outdated
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.
Given that you have added the shebang to the py file, you can start it directly without specifying the python interpreter.
The latest update looks fine! There are a couple of majorly nits which have to be fixed. Thanks for the update Johannes! |
…ll to pip, moved 'except IOError' closer to potential source
@whimboo Rebase was done. Let's hope Travis runs it now... it failed :( And again I cannot actually look at why it failed. For some reason, Travis does not give me access. It always forwards me to the getting started page... |
You don't see the results here?
I do not see that you are running |
After having talked to you on IRC, I think we both agree that we would like to call The problem we are encountering with I could, of course, call Do you have a better idea? |
Yep, you're trying to use mozfile from outside of your virtual environment, so you would need it to be installed globally. You could even have a situation where your Python script has dependencies that are not satisfied by your Python package. For Travis-CI you could simply install the script dependencies because you're in a temporary environment, but locally this would attempt to install globally. Another option is YAVE (yet another virtual environment) for the script to run in, with its own requirements. Personally, I would probably just avoid using external dependencies in the script. |
Oh, yeah. Lets remove it then and return to shutil.rmdir() in this case. I missed that we call this outside of the created venv. So it doesn't make that much sense right now. |
@Nebelhom you missed to mention your latest update here. I assume this PR is ready for the final review? |
yup, if I remember correctly, this PR is ready for its final review. Travis still seems to be happy... |
This looks great now. I squashed the commit and landed the patch as feb16bf. Thanks a lot for all your work Johannes! |
@whimboo Oh wow, never thought I would see the day this one would get accepted. Phew! Let's wait a week and see how many crashes it causes ;) Thanks for your support there whimboo. I'm really glad we managed to get it landed! |
You are most welcome @Nebelhom!! It's great to see your Python skillz improved each and every time a new patch gets uploaded. |
This PR addresses Issue #168