public function testCompleted(WorkerTestExecutor $worker, TestResult $result)
 {
     $this->executedTests++;
     foreach ($result->getErrors() as $error) {
         if ($error->severity == 'error') {
             $this->errors[] = [$result, $error];
         } elseif ($error->severity == 'warning') {
             $this->warnings[] = [$result, $error];
         } else {
             $this->fatals[] = [$result, $error];
         }
     }
 }
 public function testCompleted(WorkerTestExecutor $worker, TestResult $result)
 {
     if ($result->getErrors()) {
         $this->hasErrors = true;
     }
     if ($result->getIncomplete()) {
         $this->hasIncomplete = true;
     }
     if ($result->getSkipped()) {
         $this->hasSkipped = true;
     }
     if ($result->getRisky()) {
         $this->hasRisky = true;
     }
 }
 public function testCompleted(WorkerTestExecutor $worker, TestResult $result)
 {
     $this->executedTests++;
     $percentage = $this->executedTests / $this->expectedTests;
     if ($percentage - $this->lastReported > 0.1) {
         $this->lastReported = $percentage;
         $this->printStatus();
     }
     foreach ($result->getErrors() as $error) {
         $this->output->writeln('');
         $this->output->writeln("<warn>{$error->severity} in {$result->getClass()}::{$result->getName()}</warn>");
         $indentedError = '  ' . str_replace("\n", "\n  ", $error->getFormatted());
         $this->output->writeln($indentedError);
     }
 }
 public function onExit($status)
 {
     if ($this->pendingRequests->count() > 0) {
         $nextExpectedTest = $this->pendingRequests->dequeue();
         $this->distributor->testCompleted($this, TestResult::errorFromRequest($nextExpectedTest, "Worker{$this->id} died\n{$this->testErr}"));
     }
 }
 public function testCompleted(WorkerTestExecutor $worker, TestResult $result)
 {
     $this->executedTests++;
     $message = '.';
     foreach ($result->getErrors() as $error) {
         if ($error->severity == 'error') {
             $message = '<error>E</error>';
         } elseif ($error->severity == 'warning') {
             $message = '<warn>W</warn>';
         } else {
             $message = '<error>F</error>';
         }
     }
     $this->output->write($message);
     $this->checkLineLength($this->executedTests);
 }
 public function testProcessSendsUnexpectedResult()
 {
     $request1 = new TestRequest(1, 'foo', 'oo', 'footest.php');
     $request2 = new TestRequest(2, 'b', 'ar', 'bartest.php');
     $this->executor->run($request1);
     $this->executor->onTestResult(TestResult::errorFromRequest($request2, "Didn't bar!"));
     Phake::verify($this->distributor, Phake::atMost(1))->testCompleted($this->executor, Phake::capture($response));
     $this->assertEquals(2, $response->getId());
     $this->assertEquals("Didn't bar!", $response->getErrors()[0]->message);
     $this->assertEquals("An unexpected test was run, this could be a naming issue:\n" . "  Expected #1 - foo::footest.php\n" . "  Got #2 - b::bartest.php\n", $response->getErrors()[1]->message);
 }
 public function testCompleted(WorkerTestExecutor $worker, TestResult $result)
 {
     $ok = count($result->getErrors()) === 0 ? 'ok' : 'not ok';
     $this->output->writeln("{$ok} {$result->getId()} - {$result->getClass()}::{$result->getName()}");
     if ($result->getErrors()) {
         fwrite(STDERR, "  ---\n");
         foreach ($result->getErrors() as $error) {
             fwrite(STDERR, '  ' . preg_replace('/\\r|\\r\\n|\\n/', "\n  ", $error->getFormatted()) . "\n");
         }
         fwrite(STDERR, "  ...\n");
     }
 }
 public function start()
 {
     $this->process->start($this->loop);
     $this->comm = new BufferedReader($this->process->comm);
     $this->process->stderr->on('data', function ($data) {
         $this->listeners->onStdErr($data);
     });
     $this->process->stdout->on('data', function ($data) {
         $this->listeners->onStdOut($data);
     });
     $this->comm->onLine(function ($line) {
         if ($testResult = TestResult::decode($line)) {
             $this->listeners->onTestResult($testResult);
         }
     });
 }
 public function testCompleted(WorkerTestExecutor $worker, TestResult $result)
 {
     $this->executedTests++;
     $message = '<good>✓</good>';
     foreach ($result->getErrors() as $error) {
         if ($error->severity == 'error') {
             $message = '<error>E</error>';
         } elseif ($error->severity == 'warning') {
             $message = '<warn>W</warn>';
         } else {
             $message = '<error>F</error>';
         }
     }
     $details = sprintf('%3d%%  %5dms  %5.1fMB  %s::%s', $this->executedTests / $this->expectedTests * 100, $result->getElapsed() * 1000, $result->getMemoryUsed() / 1024 / 1024, $result->getShortClassName(), $result->getName());
     $this->writeLanes($worker->getId(), $message, $details);
 }
 public function testCompleted(WorkerTestExecutor $worker, TestResult $result)
 {
     if (count($result->getErrors()) > 0) {
         $this->distributor->stop();
     }
 }
 public function testCompleted(WorkerTestExecutor $worker, TestResult $result)
 {
     $this->json["Worker{$worker->getId()}"][] = $result->toArray();
 }
 private function showError(TestRequest $request, $string)
 {
     SerializePrinter::getInstance()->sendError(TestResult::errorFromRequest($request, $string));
 }