Running tests on Windows

Josef "Jeff" Sipek jeffpc at josefsipek.net
Fri Jun 23 12:02:18 CDT 2006


On Fri, Jun 23, 2006 at 06:34:09PM +0200, Patrick Mézard wrote:
> Would not it be easier to rewrite tests in pure python instead of trying 
> to emulate shell commands? python is already some kind of portable 
> shell, most people likely to write shell test scripts for mercurial 
> probably also know python, it is much more powerful and extensible than 
> shell scripts.
> 
> The only drawback I can see is the testing context will be different and 
> may hide or make some bugs less reproducible. Anyway it will also be the 
> case with a sh-like python shell.

Why should it be a problem with the sh-like python shell? If you redirect
I/O, you get the output of the command which you can then compare, then you
can use os.* to check any files on the disk. This is what the tests do now,
as far as I know.

I think the point of the shell would be to _not_ import mercurial.*; but
instead use standard python calls (os.stat and os.system for example) to do
whatever it needs to do. Well, I guess it could have some mercurial commands
built in, but the regression tests shouldn't probably use them directly.

Also, I can't help but mention Auto-pilot [1]. It somewhat Red Hat/Fedora
centric, and probably doesn't work on non-Unix systems but it is a rather
useful system for benchmarking and regression testing.

I while back, I started writing a benchmarking script (for auto-pilot) that
does the same operations with hg, svn (both backends), cvs, and I think some
other ones as well. I should probably finish it (read: add more tests), run
continuously for a day or so, and get stats out of the result files. If I
remember correctly, I tried it before the revlogng merge, so it should be
much better now - even though hg did quite well anyway.

Jeff Sipek.

[1] http://www.filesystems.org/project-autopilot.html

-- 
Linux, n.:
  Generous programmers from around the world all join forces to help you
  shoot yourself in the foot for free. 


More information about the Mercurial mailing list