Archive

Archive for the ‘Uncategorized’ Category

TestLink and Bugzilla integration

September 3rd, 2010

TestLink and Bugzilla integration

In our case we had the following landscape of installations:

  • Bugzilla has Oracle 10g database on a separate server
  • Testlink has MSSQL 2000 database on a separate server

Bugzilla and Testlink were installed on the same Linux server

Integration how to

The official guide at http://www.teamst.org/_tldoc/1.7/tl-bts-howto.pdf is not so descriptive.
The probability to face problems is quite hight.

So edit a file …/testlink/cfg/bugzilla.cfg.php

//Set the bug tracking system Interface
/** DB host to use when connecting to the Bugzilla db */
define('BUG_TRACK_DB_HOST', 'your_oracle_host');

/** name of the database that contains the Bugzilla tables */
define('BUG_TRACK_DB_NAME', 'xxx'); // - this is a name of the oracle instance or SID

/** charset of the database that contains the Bugzilla tables */
define('BUG_TRACK_DB_CHARSET', 'utf8');

/** useful if you have several schemas see BUGID 1444*/
// define('BUG_TRACK_DB_SCHEMA', '');

/** DB type used for the bugtracking db */
define('BUG_TRACK_DB_TYPE','oci8'); // usually people use oracle, but you really need to use oci8, please be shure that you have OCI8 PHP Extension installed

/** DB user and password to use for connecting to the Bugzilla db */
define('BUG_TRACK_DB_USER', 'user');
define('BUG_TRACK_DB_PASS', 'pass');

/** link to the bugtracking system, for viewing bugs */
define('BUG_TRACK_HREF', "http://yourdomain/bugzilla/show_bug.cgi?id=");

if you would like just a link to bugzilla, then just put as it is said in the integration guide

/** link to the bugtracking system, for entering new bugs */
define('BUG_TRACK_ENTER_BUG_HREF',"http://yourdomain/bugzilla/);

but if ou have only one product to register bugs then it is mor euser friendly to have the folowing line instead:

/** link to the bugtracking system, for entering new bugs */
define('BUG_TRACK_ENTER_BUG_HREF',"http://yourdomain/bugzilla/enter_bug.cgi?product=yyy");

where yyy is a name of the product in bugzilla.

then

Inside …/testlink/custom_config.inc.php file create line:
$g_interface_bugs=’BUGZILLA’;

Possible problems you can face up with:

1. Warnings inside log files like

Just go to file adodb-oci8.inc.php or adodb-mssql.inc.php

and copy-paste function parameters from adodb.inc.php

for example change in adodb-oci8.inc.php from
function MetaPrimaryKeys($table)

to

function MetaPrimaryKeys($table, $owner=false,$internalKey=false)

etc.

2. Table or view does not exist while trying to view failed execution of tast case or test results
Have spent several hours trying to fix an error ORA-00942: table or view does not exist while integrating TestLink and Bugzilla.

This is because the actual query that goes to oracle looks like:
SELECT bug_status FROM xxx.bugs WHERE bug_id=’123′
Where xxx is database name from bugzilla config /testlink/cfg/bugzilla.cfg
/** name of the database that contains the Bugzilla tables */
define(’BUG_TRACK_DB_NAME’, ‘xxx’);

Change file
..\testlink\lib\bugtracking\int_bugzilla.php

line 79 from
$query = “SELECT bug_status FROM {$this->dbSchema}.bugs WHERE bug_id=’” . $id.”‘”;

to
$query = “SELECT bug_status FROM bugs WHERE bug_id=’” . $id.”‘”;

and line 110 from
$query = “SELECT short_desc FROM {$this->dbSchema}.bugs WHERE bug_id=’” . $id.”‘”;

to

$query = “SELECT short_desc FROM bugs WHERE bug_id=’” . $id.”‘”;

3. Sometimes it is quite hard to test even a simple query against oracle server
I had the situation, when oracle client and testlink code were on a linux machine, where I did not have root access rights or sqlplus to execute queries
A good piece of software helped
OracleEditor.php from http://oracleeditor.sourceforge.net/

in order to connect without troubles put into database name oracle connection string like

(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=your_oracle.host.com)(PORT=1521))(CONNECT_DATA=(SID=xxx)))
change your host and SID in this string and then just copy-paste to “Service name:” field

oracle_editor

Author: Anton Vedeshin Categories: Uncategorized Tags:

Bad Behavior has blocked 120 access attempts in the last 7 days.