cancel
Showing results for 
Search instead for 
Did you mean: 

Parallel integration tests

SOLVED

Parallel integration tests

Hey everyone,

 

our integration tests are extremly slow (I guess everyone got that problem). Using ho-nl/magento2-ReachDigital_TestFramework doesn't really solve the problem.

What I want to try now is to make them run in parallel. I tried using paratestphp/paratest but there are a lot of tests failing because of deadlocks and so on.

 

I found a setting in the file 'dev/tests/integration/framework/bootstrap.php' called 'TESTS_PARALLEL_THREAD' on line 63. This option creates another installation directory with a specific prefix.

Theres also an option called 'TESTS_PARALLEL_RUN' in 'dev/tests/integration/framework/deployTestModules.php' on line 51.

So the developers had something like parallel running of tests in mind.  Does anyone know how to use the options in the right way? I found absolutely nothing about this topic.

 

I guess the right way would be to create multiple databases and then run the tests separatly. But I don't want to make this manually.

 

Does anyone run integration tests parallel?

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Parallel integration tests

Well, I don't think that anyone will provide a helpful answer here so I already tried around by myself. Starting with the tip found here I was able to implement an own way to achieve parallel integration testing. In short:

  • Get all test names (via phpunit --list-tests option)
  • Create X databases and working (tmp dirs) foreach desired thread
  • Copy phpunit.xml and mysel config files foreach desired thread
  • Foreach over the list of testnames and use Robo parallel execution to execute X tests at once

Some other tips for enhancing the speed of integration tests:

  • use pcov instead of xdebug for code coverage (saves about half the time!)
  • Move the integration database(s) to the ram (tmpfs)

Hope this helps you.

View solution in original post

2 REPLIES 2

Re: Parallel integration tests

I have exactly the same problem. Anyone got a suggestion? This is quiet a common issue , please suggest me if you find any solution for it mypascoconnect

Re: Parallel integration tests

Well, I don't think that anyone will provide a helpful answer here so I already tried around by myself. Starting with the tip found here I was able to implement an own way to achieve parallel integration testing. In short:

  • Get all test names (via phpunit --list-tests option)
  • Create X databases and working (tmp dirs) foreach desired thread
  • Copy phpunit.xml and mysel config files foreach desired thread
  • Foreach over the list of testnames and use Robo parallel execution to execute X tests at once

Some other tips for enhancing the speed of integration tests:

  • use pcov instead of xdebug for code coverage (saves about half the time!)
  • Move the integration database(s) to the ram (tmpfs)

Hope this helps you.