Open fingolfin opened 11 years ago
For a truly complete testing experience, I guess setting up a custom http and/or ssh server on the local machine would be the way to go. Both should be doable, though it might be quite a piece of work... For setting up a local ssh server (on a non-standard port, and only to be accessed from localhost, and only while the tests are running), one could use one of these:
For http access, we should be able to simply use hg server --port 1234 --address lo0
or so.
I'm mostly just replying here to let you know I haven't abandoned gitifyhg, I'm just having a really truly horribly week. ;-)
If it makes your decision easy, py.test has a feature to skip tests unless a certain command line parameter is supplied. It uses skipif http://pytest.org/latest/skipping.html#skipping. I can't remember offhand how to supply the command line argument, but I have it in some code that I can supply when level_of(overwhermed) < critical.
It turns out I used envvars instead of command line arguments in that other code I mentioned. all I did this was put this at the top of a test module for 'slow' tests and let them go.
if 'RUNSLOW' not in os.environ:
import py.test
py.test.skip("Not running slow tests. use RUNSLOW=yes py.test to run")
For this problem, I would also use http://pytest.org/latest/skipping.html#skipping-on-a-missing-import-dependency so that whichever of the ssh solutions you choose are not required dependencies.
Whenever the user accesses a remote repo, gitifyhg first clones that repo and all operations are done as a local repository. Therefore, there is only one real possible point of failure (which is highlighted in #50, for example) that is different between cloning local and remote repositories. Because of that, it's not as high a priority to test both situations as it was in Felipe's code, which treated the two variations differently.
Right now, all gitifyhg test use local repositories only. However, some problems only manifest when using external repos. For example, the msysgit remote-hg helper has a bug which causes it to not work with SSH remotes (I have a fix for that in my personal fork of it, though).
To do this, I would envision that we setup a special test repository on e.g. bitbucket, which allows cloning over both ssh and https. While of course in theory it would be best if all tests could also be run for these protocols, doing that might not be feasible, at least for any tests that need to perform pushes. But even having a simple "try to clone fixed test remote repository, see if output looks right" would IMHO be already a nice addition.
The main reason I am not adding that right away but instead am writing this is that it also has the risk of being annoying, say, if you run the tests while being offline. Perhaps one could add an option to only run these extra tests if required?