sherve
sherve

Reputation: 300

Running python unit test over LSF

I need to parallelize my python unit-tests which I wrote using the default unittest module. I'm trying to decide between two approaches:

  1. keep using unittest but use a custom 'multiprocess' runner which can spawn a test using Platform LSF (remote execution tool) an example can be found in the TestOOB project.
  2. Use py.test and customize the pytest-xdist plugin to run LSF instead of SSH.

I lean towards #1 since I already have a working setup and particularly the test suite generation (which is using a generator that parse an excel spreadsheet and is not trivial)

Any recommendation on a particular approach to follow ?

Note: my company is using LSF and I must use it for resource sharing with other teams.

Upvotes: 4

Views: 765

Answers (1)

hpk42
hpk42

Reputation: 23561

i'd first try to simply install "pytest-xdist" from pypi and run your existing tests with "py.test -n 5" in 5 parallel processes. If that basically works it means that modifying pytest-xdist to use the LSF transport is a worthwhile option. Effectively you will need to look into extending execnet (http://codespeak.net/execnet) which is the underlying library for distributing execution. HTH.

Upvotes: 1

Related Questions