Codeception / robo-paracept

Robo tasks for Codeception tests parallel execution
MIT License
57 stars 59 forks source link

Define an interface for merge tasks #24

Closed frol-kr closed 7 years ago

frol-kr commented 7 years ago

It would be nice to have a common interface for the merge tasks. Now if you want to generalise the process of building parallel execution of tasks, you probably end up having your report type as a config, from which task is built.

/**
* @return MergeXmlReportsTask|MergeHTMLReportsTask|\Robo\Collection\CollectionBuilder
*/
public function makeMergeTask()
{
     if ('xml' === $this->reportType) {
        /** @var MergeXmlReportsTask $merge */
        $merge = $this->roboFile->taskMergeHTMLReports();
     } else {
         /** @var MergeHTMLReportsTask $merge */
         $merge = $this->roboFile->taskMergeXmlReports();
     }
     return $merge;
}

instead of

/**
* @return MergeReportsTaskInterface|\Robo\Collection\CollectionBuilder
*/
public function makeMergeTask()
{
     return ('xml' === $this->reportType)
         ? $this->roboFile->taskMergeXmlReports()
         : $this->roboFile->taskMergeHTMLReports()
}

So what do you think about this? Here a pr