$execStatus = $metricsMgr->getExecStatusMatrixFlat($args->tplan_id, $buildSet, $opt); $metrics = $execStatus['metrics']; $latestExecution = $execStatus['latestExec']; // Every Test suite a row on matrix to display will be created // One matrix will be created for every platform that has testcases $tcols = array('tsuite', 'tcase', 'version'); if ($gui->show_platforms) { $tcols[] = 'platform'; } $tcols[] = 'priority'; $cols = array_flip($tcols); $args->cols = $cols; if (!is_null($execStatus['metrics'])) { buildSpreadsheetData($db, $args, $gui, $execStatus, $labels); } createSpreadsheet($gui, $args); $args->format = FORMAT_XLS; } else { // We need to ask user to do a choice $tpl = 'resultsTCFlatLauncher.tpl'; $gui->pageTitle = $labels['test_result_flat_filters']; if ($gui->matrixCfg->buildQtyLimit > 0) { $gui->userFeedback = $labels['too_much_data'] . '<br>' . sprintf($labels['too_much_builds'], $gui->activeBuildsQty, $gui->matrixCfg->buildQtyLimit); } $args->format = FORMAT_HTML; } $timerOff = microtime(true); $gui->elapsed_time = round($timerOff - $timerOn, 2); $smarty->assign('gui', $gui); displayReport($templateCfg->template_dir . $tpl, $smarty, $args->format, $mailCfg); /**
unset($r4build); unset($rows); unset($buildExecStatus); } // $platformSet } // $tcaseSet } // $tsuiteSet } unset($metrics); unset($latestExecution); switch ($args->format) { case FORMAT_XLS: // new dBug($gui->matrix); die(); createSpreadsheet($gui, $args, $buildIDSet); break; default: // new dBug($gui->matrix); // die(); $gui->tableSet[] = buildMatrix($gui, $args, $buildIDSet, $lastestBuild); break; } } else { // We need to ask user to do a choice $tpl = 'resultsTCLauncher.tpl'; $gui->pageTitle = $labels['test_result_matrix_filters']; if ($gui->matrixCfg->buildQtyLimit > 0) { $gui->userFeedback = $labels['too_much_data'] . '<br>' . sprintf($labels['too_much_builds'], $gui->activeBuildsQty, $gui->matrixCfg->buildQtyLimit); } }
if ($gFile && isCompatible($gFile, $uDataArray)) { addFile($gFile, $uDataArray, $dateTimeNeeded); } if ($tFile && isCompatible($tFile, $uDataArray)) { addFile($tFile, $uDataArray, $dateTimeNeeded); } if ($dateTimeNeeded && ($energyFilledOut || $gasFilledOut)) { addMonthlyCol(12, $uDataArray); } $monthlyCompatible = numRows($uDataArray) == 13 || numRows($uDataArray) == 0; // 12 months + 1 header, or no files have been added if ($energyFilledOut && $monthlyCompatible && !$eFile) { addEnergyUsage($energyUsages, $uDataArray); } //if($gasFilledOut && $monthlyCompatible && !$gFile) addGasUsage($gasUsages, $uDataArray); $userData = createSpreadsheet($uDataArray); //Get parameter file contents include 'paramMatch.php'; $paramFileName = getParamFileName($model); $paramContents = file_get_contents($paramFileName); //------------------------------------------------------------------------------------------------------------ function addFile($fileContents, &$dataArray, &$addDateTime) { $validHeaders = array(); $csvArray = csvToArray($fileContents); if (validDateTime($csvArray)) { if ($addDateTime) { //If we need to add date time, leave it in the array -- we don't need it anymore after this point $addDateTime = false; } else { // Else remove the date/time column
$gui->dataSet = $out; unset($out); } else { $gui->warning_msg = getWarning($args->type, $statusCode); } // Time tracking //$chronos[] = microtime(true);$tnow = end($chronos);$tprev = prev($chronos); //$t_elapsed_abs = number_format( $tnow - $tstart, 4); //$t_elapsed = number_format( $tnow - $tprev, 4); //echo '<br>' . __FUNCTION__ . ' Elapsed relative (sec):' . $t_elapsed . ' Elapsed ABSOLUTE (sec):' . $t_elapsed_abs .'<br>'; //reset($chronos); //$mem['usage'][] = memory_get_usage(true); $mem['peak'][] = memory_get_peak_usage(true); //echo '<br>' . __FUNCTION__ . ' Mem:' . end($mem['usage']) . ' Peak:' . end($mem['peak']) .'<br>'; switch ($args->format) { case FORMAT_XLS: createSpreadsheet($gui, $args, $cfSet); break; default: $tableOptions = array('status_not_run' => $args->type == $statusCode['not_run'], 'bugInterfaceOn' => $gui->bugInterfaceOn, 'format' => $args->format, 'show_platforms' => $gui->show_platforms); $gui->tableSet[] = buildMatrix($gui->dataSet, $args, $tableOptions, $gui->platformSet, $cfSet); break; } // Time tracking //$chronos[] = microtime(true);$tnow = end($chronos);$tprev = prev($chronos); //$t_elapsed_abs = number_format( $tnow - $tstart, 4); //$t_elapsed = number_format( $tnow - $tprev, 4); //echo '<br>' . __FUNCTION__ . ' Elapsed relative (sec):' . $t_elapsed . ' Elapsed ABSOLUTE (sec):' . $t_elapsed_abs .'<br>'; //reset($chronos); $smarty = new TLSmarty(); $smarty->assign('gui', $gui); displayReport($templateCfg->template_dir . $templateCfg->default_template, $smarty, $args->format, $mailCfg);