public function testPostProcessRun()
 {
     $firstStepPaths = new TestPaths($this->resultDir, 1, true, 1);
     $secondStepPaths = new TestPaths($this->resultDir, 1, true, 2);
     $csiCacheFile = $firstStepPaths->csiCacheFile(CSI_CACHE_VERSION) . ".gz";
     $breakdownCacheFile = $firstStepPaths->breakdownCacheFile(BREAKDOWN_CACHE_VERSION) . ".gz";
     $this->assertEquals($csiCacheFile, $secondStepPaths->csiCacheFile(CSI_CACHE_VERSION) . ".gz");
     $this->assertEquals($breakdownCacheFile, $secondStepPaths->breakdownCacheFile(BREAKDOWN_CACHE_VERSION) . ".gz");
     $this->assertNotEquals($firstStepPaths->cacheKey(), $secondStepPaths->cacheKey());
     $this->assertFileNotExists($csiCacheFile);
     $this->assertFileNotExists($breakdownCacheFile);
     $resultProcessing = new ResultProcessing($this->resultDir, $this->testId, 1, true);
     $error = $resultProcessing->postProcessRun();
     $this->assertNull($error);
     $this->assertFileExists($csiCacheFile);
     $cache = json_decode(gz_file_get_contents($csiCacheFile), true);
     $this->assertNotEmpty(@$cache[$firstStepPaths->cacheKey()], "CSI Cache for step 1 is empty");
     // actually, the second step doesn't contain CSI info. But it should be in the cache anyway
     $this->assertArrayHasKey($secondStepPaths->cacheKey(), $cache, "CSI Cache for step 2 is empty");
     $this->assertFileExists($breakdownCacheFile);
     $cache = json_decode(gz_file_get_contents($breakdownCacheFile), true);
     $this->assertNotEmpty(@$cache[$firstStepPaths->cacheKey()], "Breakdown Cache for step 1 is empty");
     $this->assertNotEmpty(@$cache[$secondStepPaths->cacheKey()], "Breakdown Cache for step 2 is empty");
 }
Ejemplo n.º 2
0
     $testInfo_dirty = true;
 }
 if (isset($runNumber) && isset($cacheWarmed) && array_key_exists('error', $_REQUEST) && strlen($_REQUEST['error'])) {
     if (!array_key_exists('errors', $testInfo)) {
         $testInfo['errors'] = array();
     }
     if (!array_key_exists($runNumber, $testInfo['errors'])) {
         $testInfo['errors'][$runNumber] = array();
     }
     $testInfo['errors'][$runNumber][$cacheWarmed] = $_REQUEST['error'];
     $testInfo_dirty = true;
 }
 // Do any post-processing on this individual run that doesn't requre the test to be locked
 if (isset($runNumber) && isset($cacheWarmed)) {
     $resultProcessing = new ResultProcessing($testPath, $id, $runNumber, $cacheWarmed);
     $testerError = $resultProcessing->postProcessRun();
     if ($testInfo['fvonly'] || $cacheWarmed) {
         if (!array_key_exists('test_runs', $testInfo)) {
             $testInfo['test_runs'] = array();
         }
         if (array_key_exists($runNumber, $testInfo['test_runs'])) {
             $testInfo['test_runs'][$runNumber]['done'] = true;
         } else {
             $testInfo['test_runs'][$runNumber] = array('done' => true);
         }
         $numSteps = $resultProcessing->countSteps();
         $reportedSteps = 0;
         if (!empty($testInfo['test_runs'][$runNumber]['steps'])) {
             $reportedSteps = $testInfo['test_runs'][$runNumber]['steps'];
             if ($reportedSteps != $numSteps) {
                 $testerError = "Number of steps for first and repeat view differ (fv: {$reportedSteps}, rv: {$numSteps})";