forked from UmangSardesai/Codeception-BrowserStack
-
Notifications
You must be signed in to change notification settings - Fork 9
/
RoboFile.php
48 lines (42 loc) · 1.22 KB
/
RoboFile.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
require_once 'vendor/autoload.php';
/**
* This is project's console commands configuration for Robo task runner.
*
* @see http://robo.li/
*/
class Robofile extends \Robo\Tasks
{
use \Codeception\Task\MergeReports;
private $numParallel = 4;
public function parallelRun()
{
$parallel = $this->taskParallelExec();
for ($i = 0; $i < $this->numParallel; $i++) {
$parallel->process(
$this->taskCodecept() // use built-in Codecept task
->suite('acceptance') // run acceptance tests
->env("parallel_$i") // in its own environment
->group("single")
->xml("tests/_log/result_$i.xml")
);
}
return $parallel->run();
}
function parallelMergeResults()
{
$merge = $this->taskMergeXmlReports();
for ($i=0; $i<$this->numParallel; $i++) {
$merge->from("tests/_output/tests/_log/result_$i.xml");
}
$merge->into("tests/_output/tests/_log/result.xml")
->run();
}
function parallelAll()
{
$result = $this->parallelRun();
$this->parallelMergeResults();
return $result;
}
}
?>