Esempio n. 1
0
 /**
  * @param AbstractParaunitProcess $process
  * @return CodeCoverage
  */
 public function fetch(AbstractParaunitProcess $process)
 {
     $tempFilename = $this->tempFilenameFactory->getFilenameForCoverage($process->getUniqueId());
     $codeCoverage = null;
     if ($this->coverageFileIsValid($tempFilename)) {
         $codeCoverage = (require $tempFilename);
         unlink($tempFilename);
     }
     if ($codeCoverage instanceof CodeCoverage) {
         return $codeCoverage;
     }
     return new CodeCoverage();
 }
 /**
  * {@inheritdoc}
  */
 public function reset()
 {
     // RESET DELLO STATO
     parent::reset();
     $this->process = new Process($this->process->getCommandLine());
     return $this;
 }
Esempio n. 3
0
 /**
  * @param AbstractParaunitProcess $process
  * @throws \RuntimeException
  */
 protected function markProcessCompleted(AbstractParaunitProcess $process)
 {
     $pHash = $process->getUniqueId();
     if (array_key_exists($pHash, $this->processRunning)) {
         unset($this->processRunning[$pHash]);
     } else {
         throw new \RuntimeException('Trying to remove a non-existing process from running stack\\! ID: ' . $pHash);
     }
     if ($process->isToBeRetried()) {
         $process->reset();
         $process->increaseRetryCount();
         $this->processStack[$pHash] = $process;
     } else {
         $this->processCompleted[$pHash] = $process;
     }
 }
Esempio n. 4
0
 /**
  * @param AbstractParaunitProcess $process
  * @param array $logs
  * @return bool
  */
 private function noTestsExecuted(AbstractParaunitProcess $process, array $logs)
 {
     return $process->getExitCode() === 0 && count($logs) === 1;
 }