[TIP] Parallel test runner in python?

muriel bowie muriel.bowie at gmail.com
Mon Mar 16 05:41:46 PDT 2009


Thank you so much for the update. That was exactly the information I
needed! And yes, I indeed meant py.test not test.py in my original
post ;)

We are using fabric [1] for distributing and running the selenium
tests for now. But we are planning to use proper parallel tests later.
 I will definitely look into multiprocess.py for nose since we are
already using nose for our other tests. However, from what I can see
in the docs, py.test support for parallel testing looks somewhat more
"advanced". I am thus looking forward to some more docs, Holger ;)

> Regarding Selenium Grid - do you plan to integrate your
> python tests with it or did you provide pointers
> for telling what you need?

Yeah, we were planning to integrate our tests with selenium grid. It's
seems to be the standard way from what I see in the Ruby provided with
the selenium grid sources. Porting the Ruby code to python seems
fairly easy except for the parallel testrunner part. I will let you
know how it goes.

Thanks,
Muriel

[1] http://www.nongnu.org/fab/

On Thu, Mar 12, 2009 at 3:05 PM, holger krekel <holger at merlinux.eu> wrote:
> Hi Muriel,
>
> Indeed, as Kumar nicely points out, py.test has support for
> sending tests to multiple machines and running them in
> parallel.  It cares for synchronizing a working directory with
> remote machines.  It does not require anything on the remote
> side other than Python.  It has its own rsync protocol
> implemented in python.  However, the upcoming support in
> py.test 1.0 is more stable than the very experimental one in
> 0.9.2   You can get it from current
> http://codespeak.net/svn/py/trunk.  Also because I'll give a
> tutorial about working with dist-testing at pycon dist you can
> expect some more docs and get-started information in the next
> 3 weeks.
>
> Regarding Selenium Grid - do you plan to integrate your
> python tests with it or did you provide pointers
> for telling what you need?
>
> cheers,
> holger
>
> On Wed, Mar 11, 2009 at 19:11 -0500, Kumar McMillan wrote:
>> On Wed, Mar 11, 2009 at 8:38 AM, muriel bowie <muriel.bowie at gmail.com> wrote:
>> > We are planning to use python with Selenium Grid [1], and I was
>> > wondering if anyone else has done this before.
>>
>> I currently run Selenium Remote Control tests from Nose.  I haven't
>> set up a grid yet but it works just the same.  You just change your
>> Selenium connection details (the proxy server) and all the
>> gridification is handled on the server side, IIRC.
>>
>> There is a hosted Selenium grid service worth checking out because
>> getting true scalability out of a custom Selenium Grid takes a lot of
>> time and effort: http://saucelabs.com/
>>
>> Also, this does not rely on having a local test suite that knows about
>> gridification -- all of that happens in the Selenium proxy server.
>>
>> I have read that Windmill allows you to use multiple slave machines so
>> I assume it supports running web tests in a grid (maybe someone knows
>> more about it?):
>> http://adamchristian.com/archives/43
>>
>> > What we need is a way
>> > to run the python tests in parallel on different machines, similar to
>> > DeepTest in Ruby [4] (sorry for mentioning the R word here ;) ). There
>> > was a thread on this list in December 2007 [2], but I can't find any
>> > follow-ups to this. Also, there seemed to be plans to integrate
>> > parallel testing with nose [3] in 2008. So, the question is: has
>> > anything been done so far?
>>
>> If you are asking specifically about Nose, you can use the
>> multiprocess plugin from this branch:
>> http://code.google.com/p/python-nose/source/browse/branches/ticket-93/nose/plugins/multiprocess.py
>>
>> The tricky part is that most Nose-based test suites are not designed
>> to run in parallel.  Mainly because they rely on package level
>> setup/teardown.  A good fix that distributes these fixtures without
>> requiring a radical redesign of one's test suite has not been
>> implemented yet.
>>
>> I believe that py.test has better support for running tests in
>> parallel but I don't have direct experience with this myself:
>> https://codespeak.net/py/dist/test.html#automated-distributed-testing
>>
>> >
>> > I am currently looking into using test.py, but I just want to make
>> > sure there is nothing else out there that I am missing.
>>
>> oh, maybe you meant py.test here? :)
>>
>> >
>> > Thanks,
>> > Muriel
>> >
>> > [1] http://selenium-grid.seleniumhq.org/
>> > [2] http://lists.idyll.org/pipermail/testing-in-python/2007-December/000463.html
>> > [3] http://osdir.com/ml/python.testing.general/2008-01/msg00023.html
>> > [4] http://deep-test.rubyforge.org/
>> >
>> > --
>> > key :: 0xFC222661
>> >
>> > _______________________________________________
>> > testing-in-python mailing list
>> > testing-in-python at lists.idyll.org
>> > http://lists.idyll.org/listinfo/testing-in-python
>> >
>>
>> _______________________________________________
>> testing-in-python mailing list
>> testing-in-python at lists.idyll.org
>> http://lists.idyll.org/listinfo/testing-in-python
>>
>
> --
> Metaprogramming, Python, Testing: http://tetamap.wordpress.com
> Python, PyPy, pytest contracting: http://merlinux.eu
>



-- 
key :: 0xFC222661



More information about the testing-in-python mailing list