Example #1
0
$metricsMgr = new tlTestPlanMetrics($db);
$tproject_mgr = new testproject($db);
$tplan_info = $tplan_mgr->get_by_id($args->tplan_id);
$tproject_info = $tproject_mgr->get_by_id($args->tproject_id);
unset($tproject_mgr);
// $filters = array();
//$options = array('output' => 'array', 'only_executed' => true, 'details' => 'full');
// $execSet = $tplan_mgr->get_linked_tcversions($args->tplan_id, $filters, $options);
$execSet = (array) $metricsMgr->getLTCVNewGeneration($args->tplan_id, null, array('addExecInfo' => true, 'accessKeyType' => 'index', 'specViewFields' => true, 'testSuiteInfo' => true, 'includeNotRun' => false));
$testcase_bugs = array();
$mine = array();
$l18n = init_labels(array('execution_history' => null, 'design' => null, 'no_linked_bugs' => null));
foreach ($execSet as $execution) {
    $tc_id = $execution['tc_id'];
    $mine[] = $execution['exec_id'];
    $bug_urls = buildBugString($db, $execution['exec_id'], $its, $openBugs, $resolvedBugs);
    if ($bug_urls) {
        // First bug found for this tc
        if (!isset($testcase_bugs[$tc_id])) {
            $suiteName = $execution['tsuite_name'];
            $tc_name = $execution['full_external_id'] . ":" . $execution['name'];
            // add linked icons
            $exec_history_link = "<a href=\"javascript:openExecHistoryWindow({$tc_id});\">" . "<img title=\"" . $l18n['execution_history'] . "\" src=\"{$img['history']}\" /></a> ";
            $edit_link = "<a href=\"javascript:openTCEditWindow({$tc_id});\">" . "<img title=\"" . $l18n['design'] . "\" src=\"{$img['edit']}\" /></a> ";
            $tc_name = "<!-- " . sprintf("%010d", $execution['external_id']) . " -->" . $exec_history_link . $edit_link . $tc_name;
            $testcase_bugs[$tc_id] = array($suiteName, $tc_name, array());
        }
        foreach ($bug_urls as $url) {
            if (!in_array($url, $testcase_bugs[$tc_id][2])) {
                $testcase_bugs[$tc_id][2][] = $url;
            }
Example #2
0
$openBugs = array();
$resolvedBugs = array();
$arrData = array();
$tplan_mgr = new testplan($db);
$tproject_mgr = new testproject($db);
$tplan_info = $tplan_mgr->get_by_id($args->tplan_id);
$tproject_info = $tproject_mgr->get_by_id($args->tproject_id);
$filters = array();
$options = array('output' => 'array', 'only_executed' => true, 'details' => 'full');
$results = $tplan_mgr->get_linked_tcversions($args->tplan_id, $filters, $options);
$testcase_bugs = array();
foreach ($results as $execution) {
    $tc_id = $execution['tc_id'];
    $mine[] = $execution['exec_id'];
    $exec_id = $execution['exec_id'];
    $bug_urls = buildBugString($db, $exec_id, $openBugs, $resolvedBugs);
    if ($bug_urls) {
        // First bug found for this tc
        if (!isset($testcase_bugs[$tc_id])) {
            $suiteName = $execution['tsuite_name'];
            $tc_name = buildExternalIdString($tproject_info['prefix'], $execution['external_id']) . ":" . $execution['name'];
            $testcase_bugs[$tc_id] = array($suiteName, $tc_name, array());
        }
        foreach ($bug_urls as $url) {
            if (!in_array($url, $testcase_bugs[$tc_id][2])) {
                $testcase_bugs[$tc_id][2][] = $url;
            }
        }
    }
}
foreach ($testcase_bugs as &$row) {