Пример #1
0
function getIssues(&$dbHandler, &$execSet, $tprojectID)
{
    $it_mgr = new tlIssueTracker($dbHandler);
    $its = $it_mgr->getInterfaceObject($tprojectID);
    unset($it_mgr);
    // we will see in future if we can use a better algorithm
    $issues = array();
    $tcv2loop = array_keys($execSet);
    foreach ($tcv2loop as $tcvid) {
        $execQty = count($execSet[$tcvid]);
        for ($idx = 0; $idx < $execQty; $idx++) {
            $exec_id = $execSet[$tcvid][$idx]['execution_id'];
            $dummy = get_bugs_for_exec($dbHandler, $its, $exec_id);
            if (count($dummy) > 0) {
                $issues[$exec_id] = $dummy;
            }
        }
    }
    return $issues;
}
Пример #2
0
/**
 * Get links to bugs related to execution.
 * @param $db
 * @param $execID execution id
 * @param $openBugsArray array to count open bugs
 * @param $resolvedBugsArray array to count resolved bugs
 *
 * @return array List of links to related bugs
 */
function buildBugString(&$db, $execID, &$bugInterface, &$openBugsArray, &$resolvedBugsArray)
{
    $bugUrls = array();
    if ($bugInterface) {
        $bugs = get_bugs_for_exec($db, $bugInterface, $execID);
        if ($bugs) {
            foreach ($bugs as $bugID => $bugInfo) {
                if ($bugInfo['isResolved']) {
                    if (!in_array($bugID, $resolvedBugsArray)) {
                        $resolvedBugsArray[] = $bugID;
                    }
                } else {
                    if (!in_array($bugID, $openBugsArray)) {
                        $openBugsArray[] = $bugID;
                    }
                }
                $bugUrls[] = $bugInfo['link_to_bts'];
            }
        }
    }
    return $bugUrls;
}
Пример #3
0
/**
 * 
 *
 */
function buildTestExecResults(&$dbHandler, $cfg, $labels, $exec_info, $colspan, $show_exec_notes = false)
{
    $out = '';
    $testStatus = $cfg['status_labels'][$exec_info[0]['status']];
    $testerName = gendocGetUserName($dbHandler, $exec_info[0]['tester_id']);
    $executionNotes = $show_exec_notes ? $exec_info[0]['notes'] : '';
    $td_colspan = '';
    if (!is_null($colspan)) {
        $td_colspan .= ' colspan="' . $colspan . '" ';
    }
    $out .= '<tr><td width="20%" valign="top">' . '<span class="label">' . $labels['last_exec_result'] . ':</span></td>' . '<td ' . $td_colspan . '><b>' . $testStatus . "</b></td></tr>\n" . '<tr><td width="' . $cfg['firstColWidth'] . '" valign="top">' . $labels['build'] . '</td>' . '<td ' . $td_colspan . '>' . htmlspecialchars($exec_info[0]['build_name']) . "</b></td></tr>\n" . '<tr><td width="' . $cfg['firstColWidth'] . '" valign="top">' . $labels['tester'] . '</td>' . '<td ' . $td_colspan . '>' . $testerName . "</b></td></tr>\n";
    if ($executionNotes != '') {
        $out .= '<tr><td width="' . $cfg['firstColWidth'] . '" valign="top">' . $labels['title_execution_notes'] . '</td>' . '<td ' . $td_colspan . '>' . nl2br($executionNotes) . "</td></tr>\n";
    }
    $bug_interface = config_get('bugInterfaceOn');
    //BUGFIX for error logs.
    if ($bug_interface) {
        $bugs = get_bugs_for_exec($dbHandler, $bug_interface, $exec_info[0]['execution_id']);
        if ($bugs) {
            $bugString = '';
            foreach ($bugs as $bugID => $bugInfo) {
                $bugString .= $bugInfo['link_to_bts'] . "<br />";
            }
            $out .= '<tr><td width="' . $cfg['firstColWidth'] . '" valign="top">' . $labels['bugs'] . '</td><td ' . $td_colspan . '>' . $bugString . "</td></tr>\n";
        }
    }
    return $out;
}
Пример #4
0
function exec_additional_info(&$db, $attachmentRepository, &$tcase_mgr, $other_execs, $tplan_id, $tproject_id, $bugInterfaceOn, $bugInterface)
{
    //  $bugInterfaceOn = config_get('bugInterfaceOn');
    //  $bugInterface = config_get('bugInterface');
    $attachmentInfos = null;
    $bugs = null;
    $cfexec_values = null;
    foreach ($other_execs as $tcversion_id => $execInfo) {
        $num_elem = sizeof($execInfo);
        for ($idx = 0; $idx < $num_elem; $idx++) {
            $exec_id = $execInfo[$idx]['execution_id'];
            $aInfo = getAttachmentInfos($attachmentRepository, $exec_id, 'executions', true, 1);
            if ($aInfo) {
                $attachmentInfos[$exec_id] = $aInfo;
            }
            if ($bugInterfaceOn) {
                $the_bugs = get_bugs_for_exec($db, $bugInterface, $exec_id);
                if (count($the_bugs) > 0) {
                    $bugs[$exec_id] = $the_bugs;
                }
            }
            // Custom fields
            $cfexec_values[$exec_id] = $tcase_mgr->html_table_of_custom_field_values($tcversion_id, 'execution', null, $exec_id, $tplan_id, $tproject_id);
        }
    }
    $info = array('attachment' => $attachmentInfos, 'bugs' => $bugs, 'cfexec_values' => $cfexec_values);
    return $info;
}
Пример #5
0
function exec_additional_info(&$db, $mgrPool, $other_execs, $tplan_id, $tproject_id, $bugInterfaceOn, $bugInterface)
{
    $attachmentInfos = null;
    $bugs = null;
    $cfexec_values = null;
    foreach ($other_execs as $tcversion_id => $execInfo) {
        $num_elem = sizeof($execInfo);
        for ($idx = 0; $idx < $num_elem; $idx++) {
            $exec_id = $execInfo[$idx]['execution_id'];
            // REFACTORING NEEDED !!! 20120930
            // $aInfo = getAttachmentInfos($mgrPool->attachmentRepository,$exec_id,'executions',
            //            tlAttachmentRepository::STOREINSESSION,1);
            $infoSet = $mgrPool->repository->getAllAttachmentsMetadata($exec_id, 'executions', tlAttachmentRepository::STOREINSESSION, 1);
            if ($infoSet) {
                $attachmentInfos[$exec_id] = $infoSet;
            }
            if ($bugInterfaceOn) {
                $the_bugs = get_bugs_for_exec($db, $bugInterface, $exec_id);
                if (count($the_bugs) > 0) {
                    $bugs[$exec_id] = $the_bugs;
                }
            }
            // Custom fields
            $cfexec_values[$exec_id] = $mgrPool->tcase->html_table_of_custom_field_values($tcversion_id, 'execution', null, $exec_id, $tplan_id, $tproject_id);
        }
    }
    return array($attachmentInfos, $bugs, $cfexec_values);
}
Пример #6
0
         if ($args->type == $statusCode['not_run']) {
             $build_mgr = new build_mgr($db);
             if (isset($testcase['assigned_build_id'])) {
                 $build_info = $build_mgr->get_by_id($testcase['assigned_build_id']);
                 $testcase['assigned_build_name'] = $build_info['name'];
             } else {
                 $testcase['assigned_build_name'] = lang_get('unassigned');
             }
             // When not run, test case version, is the version currently linked to test plan
             $topLevelSuites[$topCache[$testcase['tc_id']]]['items'][$level][] = array('suiteName' => $verbosePath, 'level' => $level, 'testTitle' => $tcLink, 'testVersion' => $testcase['version'], 'platformName' => htmlspecialchars($testcase['platform_name']), 'buildName' => htmlspecialchars($testcase['assigned_build_name']), 'testerName' => htmlspecialchars($testerName), 'notes' => strip_tags($testcase['summary']), 'platformID' => $testcase['platform_id']);
         } else {
             // BUGID 3492
             // BUGID 3356
             // When test case has been runned, version must be get from executions.tcversion_number
             if ($gui->bugInterfaceOn) {
                 $bugs = get_bugs_for_exec($db, $bugInterface, $testcase['exec_id']);
                 //count all test cases that have no bug linked
                 if (count($bugs) == 0) {
                     $gui->without_bugs_counter += 1;
                 }
                 foreach ($bugs as $bug) {
                     $bugString .= $bug['link_to_bts'] . '<br/>';
                 }
             }
             $topLevelSuites[$topCache[$testcase['tc_id']]]['items'][$level][] = array('suiteName' => $verbosePath, 'testTitle' => $tcLink, 'testVersion' => $testcase['tcversion_number'], 'platformName' => htmlspecialchars($testcase['platform_name']), 'buildName' => htmlspecialchars($testcase['build_name']), 'testerName' => htmlspecialchars($testerName), 'localizedTS' => $testcase['execution_ts'], 'notes' => strip_tags($testcase['execution_notes']), 'bugString' => $bugString, 'platformID' => $testcase['platform_id']);
         }
     }
     //END foreach item
 }
 //END foreach MyRBB
 // Rearrange for display
Пример #7
0
/**
 * Get links to bugs related to execution.
 * @param $db
 * @param $execID execution id
 * @param $openBugsArray array to count open bugs
 * @param $resolvedBugsArray array to count resolved bugs
 *
 * @return array List of links to related bugs
 */
function buildBugString(&$db, $execID, &$openBugsArray, &$resolvedBugsArray)
{
    $bugUrls = array();
    $bugInterface = config_get('bugInterface');
    if ($bugInterface) {
        $bugs = get_bugs_for_exec($db, $bugInterface, $execID);
        if ($bugs) {
            foreach ($bugs as $bugID => $bugInfo) {
                registerBug($bugID, $bugInfo, $openBugsArray, $resolvedBugsArray);
                $bugUrls[] = $bugInfo['link_to_bts'];
            }
        }
    }
    return $bugUrls;
}
/**
 * 
 * @internal revisions
 * @since 1.9.12
 *
 *
 */
function buildTestExecResults(&$dbHandler, &$its, $exec_info, $opt, $buildCF = null)
{
    static $testerNameCache;
    $out = '';
    $my['opt'] = array('show_notes' => true);
    $my['opt'] = array_merge($my['opt'], (array) $opt);
    $cfg =& $opt['cfg'];
    $labels =& $opt['lbl'];
    $testStatus = $cfg['status_labels'][$exec_info[0]['status']];
    if (!isset($testerNameCache[$exec_info[0]['tester_id']])) {
        $testerNameCache[$exec_info[0]['tester_id']] = gendocGetUserName($dbHandler, $exec_info[0]['tester_id']);
    }
    $executionNotes = $my['opt']['show_notes'] ? $exec_info[0]['notes'] : '';
    switch ($exec_info[0]['execution_type']) {
        case TESTCASE_EXECUTION_TYPE_AUTO:
            $etk = 'execution_type_auto';
            break;
        case TESTCASE_EXECUTION_TYPE_MANUAL:
        default:
            $etk = 'execution_type_manual';
            break;
    }
    $td_colspan = '';
    if (!is_null($opt['colspan'])) {
        $td_colspan .= ' colspan="' . $opt['colspan'] . '" ';
    }
    //
    //$out .= '<tr><td width="' . $cfg['firstColWidth'] . '" valign="top">' . $labels['build'] .'</td>' .
    //        '<td '  .$td_colspan . '>' . htmlspecialchars($exec_info[0]['build_name']) . "</b></td></tr>\n";
    // Check if CF exits for this BUILD
    if (!is_null($buildCF) && isset($buildCF[$exec_info[0]['build_id']]) && $buildCF[$exec_info[0]['build_id']] != '') {
        $out .= '<tr><td width="' . $cfg['firstColWidth'] . '" valign="top"></td>' . '<td ' . $td_colspan . '>' . $buildCF[$exec_info[0]['build_id']] . "</td></tr>\n";
    }
    $out .= '<tr><td width="' . $cfg['firstColWidth'] . '" valign="top">' . $labels['tester'] . '</td>' . '<td ' . $td_colspan . '>' . $testerNameCache[$exec_info[0]['tester_id']] . "</b></td></tr>\n";
    $out .= '<tr><td width="20%" valign="top">' . '<span class="label">' . $labels['report_exec_result'] . ':</span></td>' . '<td ' . $td_colspan . '><b>' . $testStatus . "</b></td></tr>\n" . '<tr><td width="20%">' . '<span class="label">' . $labels['execution_mode'] . ':</span></td>' . '<td ' . $td_colspan . '><b>' . $labels[$etk] . "</b></td></tr>\n" . '<tr><td width="20%">' . '<span class="label">' . $labels['execution_duration'] . ':</span></td>';
    $out .= '<td ' . $td_colspan . '><b>' . (isset($exec_info[0]['execution_duration']) ? $exec_info[0]['execution_duration'] : "&nbsp;") . "</b></td></tr>\n";
    if ($executionNotes != '') {
        $out .= '<tr><td width="' . $cfg['firstColWidth'] . '" valign="top">' . $labels['title_execution_notes'] . '</td>' . '<td ' . $td_colspan . '>' . nl2br($executionNotes) . "</td></tr>\n";
    }
    if (!is_null($its)) {
        $bugs = get_bugs_for_exec($dbHandler, $its, $exec_info[0]['execution_id']);
        if ($bugs) {
            $bugString = '';
            foreach ($bugs as $bugID => $bugInfo) {
                $bugString .= $bugInfo['link_to_bts'] . "<br />";
            }
            $out .= '<tr><td width="' . $cfg['firstColWidth'] . '" valign="top">' . $labels['bugs'] . '</td><td ' . $td_colspan . '>' . $bugString . "</td></tr>\n";
        }
    }
    return $out;
}
Пример #9
0
 /**
  * @TODO - figure out what file to include so i don't have
  * to redefine this
  * builds bug information for execution id
  * written by Andreas, being implemented again by KL
  */
 function buildBugString(&$db, $execID)
 {
     $bugString = null;
     if (!$execID) {
         return $bugString;
     }
     $bug_interface = config_get("bugInterface");
     $bugs = get_bugs_for_exec($db, $bug_interface, $execID);
     if ($bugs) {
         foreach ($bugs as $bugID => $bugInfo) {
             $bugString .= $bugInfo['link_to_bts'] . "<br />";
         }
     }
     return $bugString;
 }
Пример #10
0
/**
 * 
 *
 */
function buildTestExecResults(&$dbHandler, $cfg, $labels, $exec_info, $colspan)
{
    $out = '';
    $testStatus = $cfg['status_labels'][$exec_info[0]['status']];
    $testerName = gendocGetUserName($dbHandler, $exec_info[0]['tester_id']);
    $executionNotes = $exec_info[0]['notes'];
    if ($exec_info[0]['has_attach'] == 1) {
        $has_attach = "Yes";
    } else {
        $has_attach = "No";
    }
    $td_colspan = '';
    if (!is_null($colspan)) {
        $td_colspan .= ' colspan="' . $colspan . '" ';
    }
    $out .= '<tr><td width="20%" valign="top">' . '<span class="label">' . $labels['last_exec_result'] . ':</span></td>' . '<td ' . $td_colspan . '><b>' . $testStatus . "</b> Attachments:" . $has_attach . "</td></tr>\n" . '<tr><td width="' . $cfg['firstColWidth'] . '" valign="top">' . $labels['build'] . '</td>' . '<td ' . $td_colspan . '>' . htmlspecialchars($exec_info[0]['build_name']) . "</b></td></tr>\n" . '<tr><td width="' . $cfg['firstColWidth'] . '" valign="top">' . $labels['tester'] . '</td>' . '<td ' . $td_colspan . '>' . $testerName . "</b></td></tr>\n";
    if ($executionNotes != '') {
        $out .= '<tr><td width="' . $cfg['firstColWidth'] . '" valign="top">' . $labels['title_execution_notes'] . '</td>' . '<td ' . $td_colspan . '>' . nl2br($executionNotes) . "</td></tr>\n";
    }
    $bug_interface = config_get('bugInterface');
    if ($bug_interface != 'NO') {
        // amitkhullar-BUGID 2207 - Code to Display linked bugs to a TC in Test Report
        $bugs = get_bugs_for_exec($dbHandler, $bug_interface, $exec_info[0]['execution_id']);
        if ($bugs) {
            $bugString = '';
            foreach ($bugs as $bugID => $bugInfo) {
                $bugString .= $bugInfo['link_to_bts'] . "<br />";
            }
            $out .= '<tr><td width="' . $cfg['firstColWidth'] . '" valign="top">' . $labels['bugs'] . '</td><td ' . $td_colspan . '>' . $bugString . "</td></tr>\n";
        }
    }
    return $out;
}
Пример #11
0
/**
 * 
 *
 */
function buildTestExecResults(&$dbHandler, &$its, $cfg, $labels, $exec_info, $colspan, $show_exec_notes = false, $buildCF = null)
{
    static $testerNameCache;
    $out = '';
    $testStatus = $cfg['status_labels'][$exec_info[0]['status']];
    if (!isset($testerNameCache[$exec_info[0]['tester_id']])) {
        $testerNameCache[$exec_info[0]['tester_id']] = gendocGetUserName($dbHandler, $exec_info[0]['tester_id']);
    }
    $executionNotes = $show_exec_notes ? $exec_info[0]['notes'] : '';
    $td_colspan = '';
    if (!is_null($colspan)) {
        $td_colspan .= ' colspan="' . $colspan . '" ';
    }
    $out .= '<tr><td width="20%" valign="top">' . '<span class="label">' . $labels['last_exec_result'] . ':</span></td>' . '<td ' . $td_colspan . '><b>' . $testStatus . "</b></td></tr>\n" . '<tr><td width="20%">' . '<span class="label">' . $labels['execution_duration'] . ':</span></td>' . '<td ' . $td_colspan . '><b>' . $exec_info[0]['execution_duration'] . "</b></td></tr>\n" . '<tr><td width="' . $cfg['firstColWidth'] . '" valign="top">' . $labels['build'] . '</td>' . '<td ' . $td_colspan . '>' . htmlspecialchars($exec_info[0]['build_name']) . "</b></td></tr>\n";
    // Check if CF exits for this BUILD
    if (!is_null($buildCF) && isset($buildCF[$exec_info[0]['build_id']])) {
        $out .= '<tr><td width="' . $cfg['firstColWidth'] . '" valign="top"></td>' . '<td ' . $td_colspan . '>' . $buildCF[$exec_info[0]['build_id']] . "</td></tr>\n";
    }
    $out .= '<tr><td width="' . $cfg['firstColWidth'] . '" valign="top">' . $labels['tester'] . '</td>' . '<td ' . $td_colspan . '>' . $testerNameCache[$exec_info[0]['tester_id']] . "</b></td></tr>\n";
    if ($executionNotes != '') {
        $out .= '<tr><td width="' . $cfg['firstColWidth'] . '" valign="top">' . $labels['title_execution_notes'] . '</td>' . '<td ' . $td_colspan . '>' . nl2br($executionNotes) . "</td></tr>\n";
    }
    if (!is_null($its)) {
        $bugs = get_bugs_for_exec($dbHandler, $its, $exec_info[0]['execution_id']);
        if ($bugs) {
            $bugString = '';
            foreach ($bugs as $bugID => $bugInfo) {
                $bugString .= $bugInfo['link_to_bts'] . "<br />";
            }
            $out .= '<tr><td width="' . $cfg['firstColWidth'] . '" valign="top">' . $labels['bugs'] . '</td><td ' . $td_colspan . '>' . $bugString . "</td></tr>\n";
        }
    }
    return $out;
}
         if (isset($cfOnExec[$execID][$cfID]) && !is_null($cfOnExec[$execID][$cfID])) {
             $out[$odx][$cfID] = $tcase_mgr->cfield_mgr->string_custom_field_value($cfOnExec[$execID][$cfID], null);
         } else {
             $out[$odx][$cfID] = '';
         }
     }
 }
 // --------------------------------------------------------------------------
 // Bug processing.
 // Remember that bugs are linked to executions NOT test case.
 // When using Platforms a Test Case can have multiple executions
 // (N on each platform).
 // --------------------------------------------------------------------------
 $bugString = '';
 if ($gui->bugInterfaceOn && $exec['status'] != $statusCode['not_run']) {
     $bugSet = get_bugs_for_exec($db, $its, $exec['executions_id'], array('id', 'summary'));
     if (count($bugSet) == 0) {
         $gui->without_bugs_counter += 1;
     }
     switch ($args->format) {
         case FORMAT_XLS:
             // See IMPORTANT NOTICE/WARNING about XLS generation
             foreach ($bugSet as $bug) {
                 $bugString .= $bug['id'] . ':' . $bug['summary'] . "\r";
             }
             break;
         default:
             foreach ($bugSet as $bug) {
                 $bugString .= $bug['link_to_bts'] . '<br/>';
             }
             break;
Пример #13
0
/**
 * 
 * @internal revisions
 * @since 1.9.12
 *
 *
 */
function buildTestExecResults(&$dbHandler, &$its, $cfg, $labels, $exec_info, $colspan, $show_exec_notes = false, $buildCF = null)
{
    static $testerNameCache;
    $out = '';
    $testStatus = $cfg['status_labels'][$exec_info[0]['status']];
    if (!isset($testerNameCache[$exec_info[0]['tester_id']])) {
        $testerNameCache[$exec_info[0]['tester_id']] = gendocGetUserName($dbHandler, $exec_info[0]['tester_id']);
    }
    $executionNotes = $show_exec_notes ? $exec_info[0]['notes'] : '';
    switch ($exec_info[0]['execution_type']) {
        case TESTCASE_EXECUTION_TYPE_AUTO:
            $etk = 'execution_type_auto';
            break;
        case TESTCASE_EXECUTION_TYPE_MANUAL:
        default:
            $etk = 'execution_type_manual';
            break;
    }
    $td_colspan = '';
    if (!is_null($colspan)) {
        $td_colspan .= ' colspan="' . $colspan . '" ';
    }
    $out .= '<tr style="' . "font-weight: bold;background: #EEE;text-align: left;" . '">' . '<td width="' . $cfg['firstColWidth'] . '" valign="top">' . $labels['execution_details'] . '</td>' . '<td ' . $td_colspan . '>' . "&nbsp;" . "</b></td></tr>\n";
    $out .= '<tr><td width="' . $cfg['firstColWidth'] . '" valign="top">' . $labels['build'] . '</td>' . '<td ' . $td_colspan . '>' . htmlspecialchars($exec_info[0]['build_name']) . "</b></td></tr>\n";
    // Check if CF exits for this BUILD
    if (!is_null($buildCF) && isset($buildCF[$exec_info[0]['build_id']])) {
        $out .= '<tr><td width="' . $cfg['firstColWidth'] . '" valign="top"></td>' . '<td ' . $td_colspan . '>' . $buildCF[$exec_info[0]['build_id']] . "</td></tr>\n";
    }
    $out .= '<tr><td width="' . $cfg['firstColWidth'] . '" valign="top">' . $labels['tester'] . '</td>' . '<td ' . $td_colspan . '>' . $testerNameCache[$exec_info[0]['tester_id']] . "</b></td></tr>\n";
    $out .= '<tr><td width="20%" valign="top">' . '<span class="label">' . $labels['report_exec_result'] . ':</span></td>' . '<td ' . $td_colspan . '><b>' . $testStatus . "</b></td></tr>\n" . '<tr><td width="20%">' . '<span class="label">' . $labels['execution_mode'] . ':</span></td>' . '<td ' . $td_colspan . '><b>' . $labels[$etk] . "</b></td></tr>\n" . '<tr><td width="20%">' . '<span class="label">' . $labels['execution_duration'] . ':</span></td>';
    $out .= '<td ' . $td_colspan . '><b>' . (isset($exec_info[0]['execution_duration']) ? $exec_info[0]['execution_duration'] : "&nbsp;") . "</b></td></tr>\n";
    if ($executionNotes != '') {
        $out .= '<tr><td width="' . $cfg['firstColWidth'] . '" valign="top">' . $labels['title_execution_notes'] . '</td>' . '<td ' . $td_colspan . '>' . nl2br($executionNotes) . "</td></tr>\n";
    }
    if (!is_null($its)) {
        $bugs = get_bugs_for_exec($dbHandler, $its, $exec_info[0]['execution_id']);
        if ($bugs) {
            $bugString = '';
            foreach ($bugs as $bugID => $bugInfo) {
                $bugString .= $bugInfo['link_to_bts'] . "<br />";
            }
            $out .= '<tr><td width="' . $cfg['firstColWidth'] . '" valign="top">' . $labels['bugs'] . '</td><td ' . $td_colspan . '>' . $bugString . "</td></tr>\n";
        }
    }
    return $out;
}