开发者

Running python unit test over LSF

开发者 https://www.devze.com 2023-03-30 20:01 出处:网络
I need to parallelize my python unit-tests which I wrote using the default unittest module. I\'m trying to decide between two approaches:

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 s开发者_StackOverflow中文版ince 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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消