shvetsgroup/ParallelRunner — pull request #18 by m0ppers (2013-09-26 11:14:14+00:00)
Title: Possibility to inform the context which worker is currently active

We are doing data setup steps in most of our behat tests and we are running our parallel jobs on different databases (so they don't interfere). However our Context (which inserts the data) needs to know which worker is currently active. So i implemented a WorkerAwareInterface for Contexts (that behat thing must have been written by Java enthusiasts :|) so i can target the correct database for the data.

What do you think about this?

Currently i am doing evil stuff like this in our Contexts (however it is sufficient to do the job right now):

if ($this->worker->getId() == 1) {
$targetDatabase = "database2";
} else {
$targetDatabase = "database1";
}

For the future i need to be able to specify arbitrary worker data in here:

shvetsgroup\ParallelRunner\Extension:
profiles:
- firefox
- chrome

Any idea what a good approach would be?

Maybe:

shvetsgroup\ParallelRunner\Extension:
profiles:
firefox:
database: database1
chrome:
database: database2

What do you think? is my patch useful at all? Am i the only one doing such stuff?