Finalizing patch for 2.3

git-svn-id: svn://10.0.0.236/trunk@258916 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
ghendricks%novell.com
2009-11-07 03:36:00 +00:00
parent 35b974146a
commit b7489523c9
9 changed files with 476 additions and 404 deletions

View File

@@ -88,53 +88,149 @@ sub testopiaUpdateDB {
$dbh->bz_add_column('test_named_queries', 'type', {TYPE => 'INT3', NOTNULL => 1, DEFAULT => 0}, 0);
fixTables();
$dbh->bz_alter_column('test_attachment_data', 'attachment_id', {TYPE => 'INT4', NOTNULL => 1});
$dbh->bz_alter_column('test_attachment_data', 'attachment_id', {TYPE => 'INT4', NOTNULL => 1, REFERENCES => {
TABLE => 'test_attachments',
COLUMN => 'attachment_id',
DELETE => 'CASCADE'
}});
$dbh->bz_alter_column('test_attachments', 'attachment_id', {TYPE => 'INTSERIAL', PRIMARYKEY => 1, NOTNULL => 1});
$dbh->bz_alter_column('test_attachments', 'creation_ts', {TYPE => 'DATETIME', NOTNULL => 1});
$dbh->bz_alter_column('test_builds', 'build_id', {TYPE => 'INTSERIAL', PRIMARYKEY => 1, NOTNULL => 1});
$dbh->bz_alter_column('test_case_activity', 'case_id', {TYPE => 'INT4', NOTNULL => 1});
$dbh->bz_alter_column('test_case_bugs', 'case_id', {TYPE => 'INT4', NOTNULL => 1});
$dbh->bz_alter_column('test_case_bugs', 'case_run_id', {TYPE => 'INT4'});
$dbh->bz_alter_column('test_case_components', 'case_id', {TYPE => 'INT4', NOTNULL => 1});
$dbh->bz_alter_column('test_case_activity', 'case_id', {TYPE => 'INT4', NOTNULL => 1, REFERENCES => {
TABLE => 'test_cases',
COLUMN => 'case_id',
DELETE => 'CASCADE'
}});
$dbh->bz_alter_column('test_case_bugs', 'case_id', {TYPE => 'INT4', NOTNULL => 1, REFERENCES => {
TABLE => 'test_cases',
COLUMN => 'case_id',
DELETE => 'CASCADE'
}});
$dbh->bz_alter_column('test_case_bugs', 'case_run_id', {TYPE => 'INT4', REFERENCES => {
TABLE => 'test_case_runs',
COLUMN => 'case_run_id',
DELETE => 'CASCADE'
}});
$dbh->bz_alter_column('test_case_components', 'case_id', {TYPE => 'INT4', NOTNULL => 1, REFERENCES => {
TABLE => 'test_cases',
COLUMN => 'case_id',
DELETE => 'CASCADE'
}});
$dbh->bz_alter_column('test_case_dependencies', 'blocked', {TYPE => 'INT4', NOTNULL => 1});
$dbh->bz_alter_column('test_case_dependencies', 'dependson', {TYPE => 'INT4', NOTNULL => 1});
$dbh->bz_alter_column('test_case_plans', 'case_id', {TYPE => 'INT4', NOTNULL => 1});
$dbh->bz_alter_column('test_case_plans', 'plan_id', {TYPE => 'INT4', NOTNULL => 1});
$dbh->bz_alter_column('test_case_runs', 'build_id', {TYPE => 'INT4', NOTNULL => 1});
$dbh->bz_alter_column('test_case_runs', 'case_id', {TYPE => 'INT4', NOTNULL => 1});
$dbh->bz_alter_column('test_case_plans', 'case_id', {TYPE => 'INT4', NOTNULL => 1, REFERENCES => {
TABLE => 'test_cases',
COLUMN => 'case_id',
DELETE => 'CASCADE'
}});
$dbh->bz_alter_column('test_case_plans', 'plan_id', {TYPE => 'INT4', NOTNULL => 1, REFERENCES => {
TABLE => 'test_plans',
COLUMN => 'plan_id',
DELETE => 'CASCADE'
}});
$dbh->bz_alter_column('test_case_runs', 'build_id', {TYPE => 'INT4', NOTNULL => 1, REFERENCES => {
TABLE => 'test_builds',
COLUMN => 'build_id',
DELETE => 'CASCADE'
}});
$dbh->bz_alter_column('test_case_runs', 'case_id', {TYPE => 'INT4', NOTNULL => 1, REFERENCES => {
TABLE => 'test_cases',
COLUMN => 'case_id',
DELETE => 'CASCADE'
}});
$dbh->bz_alter_column('test_case_runs', 'case_run_status_id', {TYPE => 'INT2', NOTNULL => 1});
$dbh->bz_alter_column('test_case_runs', 'case_run_id', {TYPE => 'INTSERIAL', PRIMARYKEY => 1, NOTNULL => 1});
$dbh->bz_alter_column('test_case_runs', 'environment_id', {TYPE => 'INT4', NOTNULL => 1});
$dbh->bz_alter_column('test_case_runs', 'environment_id', {TYPE => 'INT4', NOTNULL => 1, REFERENCES => {
TABLE => 'test_environments',
COLUMN => 'environment_id',
DELETE => 'CASCADE'
}});
$dbh->bz_alter_column('test_case_runs', 'iscurrent', {TYPE => 'BOOLEAN', NOTNULL => 1, DEFAULT => '0'});
$dbh->bz_alter_column('test_case_runs', 'run_id', {TYPE => 'INT4', NOTNULL => 1});
$dbh->bz_alter_column('test_case_runs', 'run_id', {TYPE => 'INT4', NOTNULL => 1, REFERENCES => {
TABLE => 'test_runs',
COLUMN => 'run_id',
DELETE => 'CASCADE'
}});
$dbh->bz_alter_column('test_case_run_status', 'case_run_status_id', {TYPE => 'SMALLSERIAL', PRIMARYKEY => 1, NOTNULL => 1});
$dbh->bz_alter_column('test_cases', 'case_id', {TYPE => 'INTSERIAL', PRIMARYKEY => 1, NOTNULL => 1});
$dbh->bz_alter_column('test_cases', 'case_status_id', {TYPE => 'INT2', NOTNULL => 1});
$dbh->bz_alter_column('test_case_status', 'case_status_id', {TYPE => 'SMALLSERIAL', PRIMARYKEY => 1, NOTNULL => 1});
$dbh->bz_alter_column('test_case_tags', 'case_id', {TYPE => 'INT4', NOTNULL => 1});
$dbh->bz_alter_column('test_case_texts', 'case_id', {TYPE => 'INT4', NOTNULL => 1});
$dbh->bz_alter_column('test_case_texts', 'creation_ts', {TYPE => 'DATETIME', NOTNULL => 1});
$dbh->bz_alter_column('test_environment_map', 'environment_id', {TYPE => 'INT4', NOTNULL => 1});
$dbh->bz_alter_column('test_case_tags', 'case_id', {TYPE => 'INT4', NOTNULL => 1, REFERENCES => {
TABLE => 'test_cases',
COLUMN => 'case_id',
DELETE => 'CASCADE'
}});
$dbh->bz_alter_column('test_case_texts', 'case_id', {TYPE => 'INT4', NOTNULL => 1, REFERENCES => {
TABLE => 'test_cases',
COLUMN => 'case_id',
DELETE => 'CASCADE'
}});
$dbh->bz_alter_column('test_case_texts', 'creation_ts', {TYPE => 'DATETIME', NOTNULL => 1, REFERENCES => {
TABLE => 'test_cases',
COLUMN => 'case_id',
DELETE => 'CASCADE'
}});
$dbh->bz_alter_column('test_environment_map', 'environment_id', {TYPE => 'INT4', NOTNULL => 1, REFERENCES => {
TABLE => 'test_cases',
COLUMN => 'case_id',
DELETE => 'CASCADE'
}});
$dbh->bz_alter_column('test_environment_map', 'property_id', {TYPE => 'INT4'});
$dbh->bz_alter_column('test_environment_property', 'property_id', {TYPE => 'INT4', PRIMARYKEY => 1, NOTNULL => 1});
$dbh->bz_alter_column('test_environments', 'environment_id', {TYPE => 'INTSERIAL', PRIMARYKEY => 1, NOTNULL => 1});
$dbh->bz_alter_column('test_named_queries', 'isvisible', {TYPE => 'BOOLEAN', NOTNULL => 1, DEFAULT => 1});
$dbh->bz_alter_column('test_plan_activity', 'plan_id', {TYPE => 'INT4', NOTNULL => 1});
$dbh->bz_alter_column('test_plan_activity', 'plan_id', {TYPE => 'INT4', NOTNULL => 1, REFERENCES => {
TABLE => 'test_plans',
COLUMN => 'plan_id',
DELETE => 'CASCADE'
}});
$dbh->bz_alter_column('test_plans', 'plan_id', {TYPE => 'INTSERIAL', PRIMARYKEY => 1, NOTNULL => 1});
$dbh->bz_alter_column('test_plans', 'type_id', {TYPE => 'INT2', NOTNULL => 1});
$dbh->bz_alter_column('test_plan_types', 'type_id', {TYPE => 'SMALLSERIAL', NOTNULL => 1, PRIMARYKEY => 1}, 0);
$dbh->bz_alter_column('test_plan_tags', 'plan_id', {TYPE => 'INT4', NOTNULL => 1});
$dbh->bz_alter_column('test_plan_tags', 'plan_id', {TYPE => 'INT4', NOTNULL => 1, REFERENCES => {
TABLE => 'test_tags',
COLUMN => 'tag_id',
DELETE => 'CASCADE'
}});
$dbh->bz_alter_column('test_plan_texts', 'creation_ts', {TYPE => 'DATETIME', NOTNULL => 1});
$dbh->bz_alter_column('test_plan_texts', 'plan_id', {TYPE => 'INT4', NOTNULL => 1});
$dbh->bz_alter_column('test_plan_texts', 'plan_id', {TYPE => 'INT4', NOTNULL => 1, REFERENCES => {
TABLE => 'test_plans',
COLUMN => 'plan_id',
DELETE => 'CASCADE'
}});
$dbh->bz_alter_column('test_plan_texts', 'plan_text', {TYPE => 'MEDIUMTEXT'});
$dbh->bz_alter_column('test_run_activity', 'run_id', {TYPE => 'INT4', NOTNULL => 1});
$dbh->bz_alter_column('test_run_cc', 'run_id', {TYPE => 'INT4', NOTNULL => 1});
$dbh->bz_alter_column('test_runs', 'build_id', {TYPE => 'INT4', NOTNULL => 1});
$dbh->bz_alter_column('test_runs', 'environment_id', {TYPE => 'INT4', NOTNULL => 1});
$dbh->bz_alter_column('test_runs', 'plan_id', {TYPE => 'INT4', NOTNULL => 1});
$dbh->bz_alter_column('test_run_activity', 'run_id', {TYPE => 'INT4', NOTNULL => 1, REFERENCES => {
TABLE => 'test_runs',
COLUMN => 'run_id',
DELETE => 'CASCADE'
}});
$dbh->bz_alter_column('test_run_cc', 'run_id', {TYPE => 'INT4', NOTNULL => 1, REFERENCES => {
TABLE => 'test_runs',
COLUMN => 'run_id',
DELETE => 'CASCADE'
}});
$dbh->bz_alter_column('test_runs', 'build_id', {TYPE => 'INT4', NOTNULL => 1, REFERENCES => {
TABLE => 'test_builds',
COLUMN => 'build_id',
DELETE => 'CASCADE'
}});
$dbh->bz_alter_column('test_runs', 'environment_id', {TYPE => 'INT4', NOTNULL => 1, REFERENCES => {
TABLE => 'test_environments',
COLUMN => 'environment_id',
DELETE => 'CASCADE'
}});
$dbh->bz_alter_column('test_runs', 'plan_id', {TYPE => 'INT4', NOTNULL => 1, REFERENCES => {
TABLE => 'test_plans',
COLUMN => 'plan_id',
DELETE => 'CASCADE'
}});
$dbh->bz_alter_column('test_runs', 'run_id', {TYPE => 'INTSERIAL', PRIMARYKEY => 1, NOTNULL => 1});
$dbh->bz_alter_column('test_runs', 'start_date', {TYPE => 'DATETIME', NOTNULL => 1});
$dbh->bz_alter_column('test_run_tags', 'run_id', {TYPE => 'INT4', NOTNULL => 1});
$dbh->bz_alter_column('test_run_tags', 'run_id', {TYPE => 'INT4', NOTNULL => 1, REFERENCES => {
TABLE => 'test_runs',
COLUMN => 'run_id',
DELETE => 'CASCADE'
}});
$dbh->bz_drop_index('test_attachments', 'AI_attachment_id');
$dbh->bz_drop_index('test_attachments', 'attachment_id');

View File

@@ -0,0 +1,14 @@
This directory contains drivers for the XMLRPC interface to Testopia. These
drivers can be used as stand-alone accessors to the XMLRPC or provide an
example for proper access in their respective languages.
With the exception of the Perl driver, each has been contributed generously
by members of the community. Thus, the Testopia developers cannot provide
support for any driver except the Perl driver (client.pl). Where contact
information is provided, you may contact the original developers for support.
As changes are made to the XMLRPC interface, the drivers tend to lag behind
(with the noted exception of the Perl driver which is used by the developers
to test the interface and is therefore kept current). Please check that the
driver you choose is up to date with the current version of the API. If it is
not, we welcome you to help bring it up to date by providing patches.

View File

@@ -1,158 +1,158 @@
Testrunner to Testopia installation guide by sneharaj.rajendran <sneharajr@gmail.com>
1, Upgrade the Bugzilla first before start the migration.
2, Make sure that all the table related to test runner is dropped.
Drop table test_case_attachments ; drop table test_case_groups; drop table test_case_tags; drop table test_cases; drop table test_cases_bugs; drop table test_cases_log; drop table test_cases_log_testers; drop table test_cases_texts; drop table test_plan_attachments; drop table test_plan_cases_tags; drop table test_plan_types; drop table test_plans; drop table test_plans_texts; drop table test_plans_watchers; drop table test_runs; drop table test_runs_testers; drop table testers; drop table testers_components;
3, Apply the corresponding patch before the installation.
Patch -p0 -i Testopia/ patch-3.0
4, To install the Testopia run the following command.
Perl checksetup.pl
The above command will create the table structure for the Testopia .
Test Runner to Testopia migration
1, Let start the database porting from test runner to testopia.
Create two database base
Eg: create database bugdump ; create database newdb;
Note: newdb will be used for port the data from bugsdump database both will be temporary database used for migration.
Note: restore the old bugzilla data in to one database
2, Login to mysql.
Mysql -u root -p bugsdump < "<dumpfile.sql>"
3, login to new bugzilla database and ran the following commands.
Use bugs;
insert into test_case_status (case_status_id,name) values (3,'Disabled');
insert into test_case_status (case_status_id,name) values (1,'proposed');
insert into test_case_status (case_status_id,name) values (2,'Confirmed');
insert into test_builds (build_id,product_id,name) values (1,1,'Dummy data build');
insert into test_environments (environment_id,product_id,name) values (1,1,'Dummy data environment');
insert into test_case_run_status values (1,'idle');
insert into test_case_run_status values (2,'passed');
insert into test_case_run_status values (3,'failed');
4, Following sqlquerys will dump the data into newdb database
use bugsdump;
create table newdb.new_test_case_categories select distinct g.group_id as category_id, test_plans.product_id, concat(g.name, "_",g.group_id),g.description from test_cases, test_case_groups as g , test_plans where test_cases.group_id = g.group_id and test_plans.plan_id = test_cases.plan_id;
create table newdb.new_test_case_tags select test_case_tags.tag_id,test_case_tags.case_id, test_cases.userid from test_case_tags, test_cases where test_cases.case_id = test_case_tags.case_id;
create table newdb.new_test_case_plans select plan_id, case_id from test_cases;
create table newdb.new_test_case_components select case_id, component_id from test_cases;
create table newdb.new_test_case_bugs select bug_id,case_log_id as case_run_id, case_id from test_cases_bugs;
create table newdb.new_test_case_runs select id as case_run_id ,test_run_id as run_id, case_id,runningby as assignee,testedby,if(status=1,1,if(status=2,2,3)) as case_run_status_id, test_case_version,'1' as build_id, runningon as running_date, close_date as close_date, notes,isprivate as iscurrent, seq as sortkey, NULL as environment_id from test_cases_log;
create table newdb.new_test_case_texts select case_id, case_version as case_text_version, '1' as who , creation_ts, action,effect,summary as setup, req_id as breakdown from test_cases_texts;
create table newdb.new_test_plan_types select type_id,name, '' as description from test_plan_types;
create table newdb.new_test_plan_tags select tag_id,plan_id, '1' as userid from test_plan_cases_tags;
create table newdb.new_test_plans select t.plan_id,t.product_id,t.editor as author_id,t.type as type_id ,t.product_version as default_product_version,t.name,t.creation_date,if((t.active= 'T'), 1, 0) as isactive from test_plans t, products p where p.id= t.product_id;
create table newdb.new_test_plan_texts select plan_id, plan_version as plan_text_version, '1' as who, creation_ts, plan_text from test_plans_texts;
create table newdb.new_test_runs select test_run_id as run_id, plan_id, NULL as environment_id , product_version, NULL as build_id, plan_version as plan_text_version, manager as manager_id, NULL as default_tester_id, start_date, stop_date, summary, notes from test_runs;
create table newdb.new_test_cases select test_cases.case_id, if(status=1,1,if(status=2,2,3)) as case_status_id, group_id as category_id, 0 as priority_id,userid as author_id, 0 as default_tester_id, creation_date, 0 as estimated_time, if(strcmp(run_mode,'manual'),1,0) as isautomated,seq as sortkey, script, arguments, test_cases_texts.summary ,'' as requirement, '' as alias from test_cases left join test_cases_texts on (test_cases.case_id=test_cases_texts.case_id) group by test_cases_texts.case_id;
5, Take the dump of each table by table from newdb
6, logout from bugzilla database
7, create a folder name dump inside buzilla installation folder and execute the following command one by one to take the back of table created under newdb database
mysqldump -u root -p newdb new_test_case_categories -t > new_test_case_categories
mysqldump -u root -p newdb new_test_case_components -t > new_test_case_components
mysqldump -u root -p newdb new_test_case_plans -t > new_test_case_plans
mysqldump -u root -p newdb new_test_case_runs -t > new_test_case_runs
mysqldump -u root -p newdb new_test_case_tags -t > new_test_case_tags
mysqldump -u root -p newdb new_test_case_texts -t > new_test_case_texts
mysqldump -u root -p newdb new_test_cases -t > new_test_cases
mysqldump -u root -p newdb new_test_plan_tags -t > new_test_plan_tags
mysqldump -u root -p newdb new_test_plan_texts -t > new_test_plan_texts
mysqldump -u root -p newdb new_test_plan_types -t > new_test_plan_types
mysqldump -u root -p newdb new_test_plans -t > new_test_plans
mysqldump -u root -p newdb new_test_runs -t > new_test_runs
mysqldump -u root -p newdb new_test_case_bugs -t > new_test_case_bugs
8, Open each file and replace the word
:1,$s/new_//g
9, Restore the data into bugs one by one
Mysql -u root -p bugs < new_test_case_components
Mysql -u root -p bugs < new_test_case_plans
Mysql -u root -p bugs < new_test_case_runs
Mysql -u root -p bugs < new_test_case_tags
Mysql -u root -p bugs < new_test_case_texts
Mysql -u root -p bugs < new_test_cases
Mysql -u root -p bugs < new_test_plan_tags
Mysql -u root -p bugs < new_test_plan_texts
Mysql -u root -p bugs < new_test_plan_types
Mysql -u root -p bugs < new_test_plans
Mysql -u root -p bugs < new_test_runs
Mysql -u root -p bugs < new_test_case_categories
10, Login to mysql database
Mysql -u root -p
Use bugs;
update test_case_runs set iscurrent =1;
Testrunner to Testopia installation guide by sneharaj.rajendran <sneharajr@gmail.com>
1, Upgrade the Bugzilla first before start the migration.
2, Make sure that all the table related to test runner is dropped.
Drop table test_case_attachments ; drop table test_case_groups; drop table test_case_tags; drop table test_cases; drop table test_cases_bugs; drop table test_cases_log; drop table test_cases_log_testers; drop table test_cases_texts; drop table test_plan_attachments; drop table test_plan_cases_tags; drop table test_plan_types; drop table test_plans; drop table test_plans_texts; drop table test_plans_watchers; drop table test_runs; drop table test_runs_testers; drop table testers; drop table testers_components;
3, Apply the corresponding patch before the installation.
Patch -p0 -i Testopia/ patch-3.0
4, To install the Testopia run the following command.
Perl checksetup.pl
The above command will create the table structure for the Testopia .
Test Runner to Testopia migration
1, Let start the database porting from test runner to testopia.
Create two database base
Eg: create database bugdump ; create database newdb;
Note: newdb will be used for port the data from bugsdump database both will be temporary database used for migration.
Note: restore the old bugzilla data in to one database
2, Login to mysql.
Mysql -u root -p bugsdump < "<dumpfile.sql>"
3, login to new bugzilla database and ran the following commands.
Use bugs;
insert into test_case_status (case_status_id,name) values (3,'Disabled');
insert into test_case_status (case_status_id,name) values (1,'proposed');
insert into test_case_status (case_status_id,name) values (2,'Confirmed');
insert into test_builds (build_id,product_id,name) values (1,1,'Dummy data build');
insert into test_environments (environment_id,product_id,name) values (1,1,'Dummy data environment');
insert into test_case_run_status values (1,'idle');
insert into test_case_run_status values (2,'passed');
insert into test_case_run_status values (3,'failed');
4, Following sqlquerys will dump the data into newdb database
use bugsdump;
create table newdb.new_test_case_categories select distinct g.group_id as category_id, test_plans.product_id, concat(g.name, "_",g.group_id),g.description from test_cases, test_case_groups as g , test_plans where test_cases.group_id = g.group_id and test_plans.plan_id = test_cases.plan_id;
create table newdb.new_test_case_tags select test_case_tags.tag_id,test_case_tags.case_id, test_cases.userid from test_case_tags, test_cases where test_cases.case_id = test_case_tags.case_id;
create table newdb.new_test_case_plans select plan_id, case_id from test_cases;
create table newdb.new_test_case_components select case_id, component_id from test_cases;
create table newdb.new_test_case_bugs select bug_id,case_log_id as case_run_id, case_id from test_cases_bugs;
create table newdb.new_test_case_runs select id as case_run_id ,test_run_id as run_id, case_id,runningby as assignee,testedby,if(status=1,1,if(status=2,2,3)) as case_run_status_id, test_case_version,'1' as build_id, runningon as running_date, close_date as close_date, notes,isprivate as iscurrent, seq as sortkey, NULL as environment_id from test_cases_log;
create table newdb.new_test_case_texts select case_id, case_version as case_text_version, '1' as who , creation_ts, action,effect,summary as setup, req_id as breakdown from test_cases_texts;
create table newdb.new_test_plan_types select type_id,name, '' as description from test_plan_types;
create table newdb.new_test_plan_tags select tag_id,plan_id, '1' as userid from test_plan_cases_tags;
create table newdb.new_test_plans select t.plan_id,t.product_id,t.editor as author_id,t.type as type_id ,t.product_version as default_product_version,t.name,t.creation_date,if((t.active= 'T'), 1, 0) as isactive from test_plans t, products p where p.id= t.product_id;
create table newdb.new_test_plan_texts select plan_id, plan_version as plan_text_version, '1' as who, creation_ts, plan_text from test_plans_texts;
create table newdb.new_test_runs select test_run_id as run_id, plan_id, NULL as environment_id , product_version, NULL as build_id, plan_version as plan_text_version, manager as manager_id, NULL as default_tester_id, start_date, stop_date, summary, notes from test_runs;
create table newdb.new_test_cases select test_cases.case_id, if(status=1,1,if(status=2,2,3)) as case_status_id, group_id as category_id, 0 as priority_id,userid as author_id, 0 as default_tester_id, creation_date, 0 as estimated_time, if(strcmp(run_mode,'manual'),1,0) as isautomated,seq as sortkey, script, arguments, test_cases_texts.summary ,'' as requirement, '' as alias from test_cases left join test_cases_texts on (test_cases.case_id=test_cases_texts.case_id) group by test_cases_texts.case_id;
5, Take the dump of each table by table from newdb
6, logout from bugzilla database
7, create a folder name dump inside buzilla installation folder and execute the following command one by one to take the back of table created under newdb database
mysqldump -u root -p newdb new_test_case_categories -t > new_test_case_categories
mysqldump -u root -p newdb new_test_case_components -t > new_test_case_components
mysqldump -u root -p newdb new_test_case_plans -t > new_test_case_plans
mysqldump -u root -p newdb new_test_case_runs -t > new_test_case_runs
mysqldump -u root -p newdb new_test_case_tags -t > new_test_case_tags
mysqldump -u root -p newdb new_test_case_texts -t > new_test_case_texts
mysqldump -u root -p newdb new_test_cases -t > new_test_cases
mysqldump -u root -p newdb new_test_plan_tags -t > new_test_plan_tags
mysqldump -u root -p newdb new_test_plan_texts -t > new_test_plan_texts
mysqldump -u root -p newdb new_test_plan_types -t > new_test_plan_types
mysqldump -u root -p newdb new_test_plans -t > new_test_plans
mysqldump -u root -p newdb new_test_runs -t > new_test_runs
mysqldump -u root -p newdb new_test_case_bugs -t > new_test_case_bugs
8, Open each file and replace the word
:1,$s/new_//g
9, Restore the data into bugs one by one
Mysql -u root -p bugs < new_test_case_components
Mysql -u root -p bugs < new_test_case_plans
Mysql -u root -p bugs < new_test_case_runs
Mysql -u root -p bugs < new_test_case_tags
Mysql -u root -p bugs < new_test_case_texts
Mysql -u root -p bugs < new_test_cases
Mysql -u root -p bugs < new_test_plan_tags
Mysql -u root -p bugs < new_test_plan_texts
Mysql -u root -p bugs < new_test_plan_types
Mysql -u root -p bugs < new_test_plans
Mysql -u root -p bugs < new_test_runs
Mysql -u root -p bugs < new_test_case_categories
10, Login to mysql database
Mysql -u root -p
Use bugs;
update test_case_runs set iscurrent =1;
11, Bugzilla and testopia is ready to test.

View File

@@ -1,51 +1,13 @@
Index: Bugzilla/WebService/User.pm
===================================================================
RCS file: /cvsroot/mozilla/webtools/bugzilla/Bugzilla/WebService/User.pm,v
retrieving revision 1.6.2.2
diff -u -r1.6.2.2 User.pm
--- Bugzilla/WebService/User.pm 26 Nov 2008 01:24:15 -0000 1.6.2.2
+++ Bugzilla/WebService/User.pm 18 Dec 2008 22:33:02 -0000
@@ -125,6 +125,32 @@
return { id => type('int')->value($user->id) };
}
+#################
+# User Lookup #
+#################
+
+sub lookup_login_by_id {
+ my $self = shift;
+ my ($author_id) = @_;
+
+ my $user = new Bugzilla::User($author_id);
+
+ my $result = defined $user ? $user->login : '';
+
+ # Result is user login string or empty string if failed
+ return $result;
+}
+
+sub lookup_id_by_login {
+ my $self = shift;
+ my ($author) = @_;
+
+ my $result = Bugzilla::User::login_to_id($author);
+
+ # Result is user id or 0 if failed
+ return $result;
+}
+
1;
__END__
### Eclipse Workspace Patch 1.0
#P bmo-3.4
Index: Bugzilla/Constants.pm
===================================================================
RCS file: /cvsroot/mozilla/webtools/bugzilla/Bugzilla/Constants.pm,v
retrieving revision 1.92.2.7
diff -u -r1.92.2.7 Constants.pm
--- Bugzilla/Constants.pm 30 Nov 2008 01:34:57 -0000 1.92.2.7
+++ Bugzilla/Constants.pm 18 Dec 2008 22:33:01 -0000
@@ -131,6 +131,7 @@
retrieving revision 1.109.2.12
diff -u -r1.109.2.12 Constants.pm
--- Bugzilla/Constants.pm 5 Nov 2009 18:56:34 -0000 1.109.2.12
+++ Bugzilla/Constants.pm 7 Nov 2009 02:55:47 -0000
@@ -134,6 +134,7 @@
ERROR_MODE_WEBPAGE
ERROR_MODE_DIE
ERROR_MODE_DIE_SOAP_FAULT
@@ -53,7 +15,7 @@ diff -u -r1.92.2.7 Constants.pm
INSTALLATION_MODE_INTERACTIVE
INSTALLATION_MODE_NON_INTERACTIVE
@@ -370,6 +371,7 @@
@@ -386,6 +387,7 @@
use constant ERROR_MODE_WEBPAGE => 0;
use constant ERROR_MODE_DIE => 1;
use constant ERROR_MODE_DIE_SOAP_FAULT => 2;
@@ -61,68 +23,14 @@ diff -u -r1.92.2.7 Constants.pm
# The various modes that checksetup.pl can run in.
use constant INSTALLATION_MODE_INTERACTIVE => 0;
Index: Bugzilla/Bug.pm
===================================================================
RCS file: /cvsroot/mozilla/webtools/bugzilla/Bugzilla/Bug.pm,v
retrieving revision 1.241.2.18
diff -u -r1.241.2.18 Bug.pm
--- Bugzilla/Bug.pm 19 Nov 2008 19:32:57 -0000 1.241.2.18
+++ Bugzilla/Bug.pm 18 Dec 2008 22:33:01 -0000
@@ -2709,6 +2709,14 @@
"SELECT bug_id FROM bugs WHERE alias = ?", undef, $alias);
}
+sub get_test_case_count {
+ my $self = shift;
+ my $dbh = Bugzilla->dbh;
+ my $row_count = $dbh->selectall_arrayref(
+ "SELECT DISTINCT case_id FROM test_case_bugs WHERE bug_id = ?",
+ undef, $self->bug_id);
+ return scalar @$row_count;
+}
#####################################################################
# Subroutines
#####################################################################
Index: Bugzilla/Error.pm
===================================================================
RCS file: /cvsroot/mozilla/webtools/bugzilla/Bugzilla/Error.pm,v
retrieving revision 1.23.2.1
diff -u -r1.23.2.1 Error.pm
--- Bugzilla/Error.pm 27 May 2008 22:11:56 -0000 1.23.2.1
+++ Bugzilla/Error.pm 18 Dec 2008 22:33:01 -0000
@@ -32,6 +32,7 @@
use Bugzilla::WebService::Constants;
use Bugzilla::Util;
use Date::Format;
+use JSON;
# We cannot use $^S to detect if we are in an eval(), because mod_perl
# already eval'uates everything, so $^S = 1 in all cases under mod_perl!
@@ -114,6 +115,16 @@
}
die SOAP::Fault->faultcode($code)->faultstring($message);
}
+ elsif (Bugzilla->error_mode == ERROR_MODE_AJAX) {
+ # JSON can't handle strings across lines.
+ $message =~ s/\n/ /gm;
+ my $err;
+ $err->{'success'} = JSON::false;
+ $err->{'error'} = $error;
+ $err->{'message'} = $message;
+ my $json = new JSON;
+ print $json->encode($err);
+ }
}
exit;
}
Index: Bugzilla/User.pm
===================================================================
RCS file: /cvsroot/mozilla/webtools/bugzilla/Bugzilla/User.pm,v
retrieving revision 1.164.2.4
diff -u -r1.164.2.4 User.pm
--- Bugzilla/User.pm 8 Nov 2008 19:03:32 -0000 1.164.2.4
+++ Bugzilla/User.pm 18 Dec 2008 22:33:02 -0000
@@ -335,6 +335,16 @@
retrieving revision 1.178.2.3
diff -u -r1.178.2.3 User.pm
--- Bugzilla/User.pm 2 Jun 2009 22:04:13 -0000 1.178.2.3
+++ Bugzilla/User.pm 7 Nov 2009 02:55:48 -0000
@@ -339,6 +339,16 @@
return $self->{queries_available};
}
@@ -139,7 +47,7 @@ diff -u -r1.164.2.4 User.pm
sub settings {
my ($self) = @_;
@@ -632,7 +642,7 @@
@@ -657,7 +667,7 @@
my $class_restricted = Bugzilla->params->{'useclassification'} && $class_id;
if (!defined $self->{selectable_products}) {
@@ -148,7 +56,7 @@ diff -u -r1.164.2.4 User.pm
" FROM products " .
"LEFT JOIN group_control_map " .
" ON group_control_map.product_id = products.id ";
@@ -642,10 +652,17 @@
@@ -667,10 +677,17 @@
$query .= " AND group_control_map.membercontrol = " . CONTROLMAPMANDATORY;
}
$query .= " AND group_id NOT IN(" . $self->groups_as_string . ") " .
@@ -169,7 +77,7 @@ diff -u -r1.164.2.4 User.pm
$self->{selectable_products} = Bugzilla::Product->new_from_list($prod_ids);
}
@@ -925,6 +942,33 @@
@@ -948,6 +965,33 @@
$group_delete->execute($id, $group, GRANT_REGEXP) if $present;
}
}
@@ -203,113 +111,67 @@ diff -u -r1.164.2.4 User.pm
}
sub product_responsibilities {
Index: editproducts.cgi
Index: Bugzilla/Bug.pm
===================================================================
RCS file: /cvsroot/mozilla/webtools/bugzilla/editproducts.cgi,v
retrieving revision 1.142.2.1
diff -u -r1.142.2.1 editproducts.cgi
--- editproducts.cgi 21 Oct 2008 21:57:49 -0000 1.142.2.1
+++ editproducts.cgi 18 Dec 2008 22:33:01 -0000
@@ -370,7 +370,9 @@
RCS file: /cvsroot/mozilla/webtools/bugzilla/Bugzilla/Bug.pm,v
retrieving revision 1.276.2.12
diff -u -r1.276.2.12 Bug.pm
--- Bugzilla/Bug.pm 1 Nov 2009 20:14:11 -0000 1.276.2.12
+++ Bugzilla/Bug.pm 7 Nov 2009 02:55:46 -0000
@@ -2939,6 +2939,14 @@
"SELECT bug_id FROM bugs WHERE alias = ?", undef, $alias);
}
$vars->{'product'} = $product;
$vars->{'token'} = issue_session_token('delete_product');
-
+
+ Bugzilla::Hook::process("editproducts-confirm_delete", { vars => $vars });
+
$template->process("admin/products/confirm-delete.html.tmpl", $vars)
|| ThrowTemplateError($template->error());
+sub get_test_case_count {
+ my $self = shift;
+ my $dbh = Bugzilla->dbh;
+ my $row_count = $dbh->selectall_arrayref(
+ "SELECT DISTINCT case_id FROM test_case_bugs WHERE bug_id = ?",
+ undef, $self->bug_id);
+ return scalar @$row_count;
+}
#####################################################################
# Subroutines
#####################################################################
Index: Bugzilla/Error.pm
===================================================================
RCS file: /cvsroot/mozilla/webtools/bugzilla/Bugzilla/Error.pm,v
retrieving revision 1.24
diff -u -r1.24 Error.pm
--- Bugzilla/Error.pm 27 May 2008 22:08:59 -0000 1.24
+++ Bugzilla/Error.pm 7 Nov 2009 02:55:47 -0000
@@ -32,6 +32,7 @@
use Bugzilla::WebService::Constants;
use Bugzilla::Util;
use Date::Format;
+use JSON;
# We cannot use $^S to detect if we are in an eval(), because mod_perl
# already eval'uates everything, so $^S = 1 in all cases under mod_perl!
@@ -114,6 +115,16 @@
}
die SOAP::Fault->faultcode($code)->faultstring($message);
}
+ elsif (Bugzilla->error_mode == ERROR_MODE_AJAX) {
+ # JSON can't handle strings across lines.
+ $message =~ s/\n/ /gm;
+ my $err;
+ $err->{'success'} = JSON::false;
+ $err->{'error'} = $error;
+ $err->{'message'} = $message;
+ my $json = new JSON;
+ print $json->encode($err);
+ }
}
exit;
Index: Bugzilla/DB/Mysql.pm
===================================================================
RCS file: /cvsroot/mozilla/webtools/bugzilla/Bugzilla/DB/Mysql.pm,v
retrieving revision 1.60.2.7
diff -u -r1.60.2.7 Mysql.pm
--- Bugzilla/DB/Mysql.pm 7 Nov 2008 00:10:15 -0000 1.60.2.7
+++ Bugzilla/DB/Mysql.pm 18 Dec 2008 22:33:02 -0000
@@ -690,6 +690,9 @@
$self->bz_drop_index('bugs_fulltext', $index);
}
}
+ if ($table eq 'test_runs' && $name eq 'summary') {
+ $self->bz_drop_index('test_runs', 'test_runs_summary_idx');
+ }
print "Converting $table.$name to be stored as UTF-8...\n";
my $col_info =
Index: Bugzilla/Install/Filesystem.pm
===================================================================
RCS file: /cvsroot/mozilla/webtools/bugzilla/Bugzilla/Install/Filesystem.pm,v
retrieving revision 1.29.2.1
diff -u -r1.29.2.1 Filesystem.pm
--- Bugzilla/Install/Filesystem.pm 13 Jun 2008 20:58:47 -0000 1.29.2.1
+++ Bugzilla/Install/Filesystem.pm 18 Dec 2008 22:33:02 -0000
@@ -111,6 +111,8 @@
'runtests.pl' => { perms => $owner_executable },
'testserver.pl' => { perms => $ws_executable },
'whine.pl' => { perms => $ws_executable },
+ 'tr_csv2xml.pl' => { perms => $ws_executable },
+ 'tr_importxml.pl' => { perms => $ws_executable },
'customfield.pl' => { perms => $owner_executable },
'email_in.pl' => { perms => $ws_executable },
'sanitycheck.pl' => { perms => $ws_executable },
@@ -157,6 +159,8 @@
dirs => $ws_dir_readable },
$extlib => { files => $ws_readable,
dirs => $ws_dir_readable },
+ "$libdir/testopia" => { files => $ws_readable,
+ dirs => $ws_dir_readable },
$templatedir => { files => $ws_readable,
dirs => $ws_dir_readable },
$extensionsdir => { files => $ws_readable,
@@ -171,6 +175,8 @@
dirs => $ws_dir_readable },
t => { files => $owner_readable,
dirs => $owner_dir_readable },
+ 'testopia/t' => { files => $owner_readable,
+ dirs => $owner_dir_readable },
'docs/*/html' => { files => $ws_readable,
dirs => $ws_dir_readable },
'docs/*/pdf' => { files => $ws_readable,
Index: template/en/default/admin/products/confirm-delete.html.tmpl
===================================================================
RCS file: /cvsroot/mozilla/webtools/bugzilla/template/en/default/admin/products/confirm-delete.html.tmpl,v
retrieving revision 1.9
diff -u -r1.9 confirm-delete.html.tmpl
--- template/en/default/admin/products/confirm-delete.html.tmpl 7 Oct 2007 23:18:29 -0000 1.9
+++ template/en/default/admin/products/confirm-delete.html.tmpl 18 Dec 2008 22:33:02 -0000
@@ -255,6 +255,8 @@
[% END %]
+[% Hook.process("additional-product-values") %]
+
[% IF product.bug_count == 0 || Param('allowbugdeletion') %]
<p>Do you really want to delete this product?</p>
Index: template/en/default/global/setting-descs.none.tmpl
===================================================================
RCS file: /cvsroot/mozilla/webtools/bugzilla/template/en/default/global/setting-descs.none.tmpl,v
retrieving revision 1.14
diff -u -r1.14 setting-descs.none.tmpl
--- template/en/default/global/setting-descs.none.tmpl 20 Aug 2007 18:25:04 -0000 1.14
+++ template/en/default/global/setting-descs.none.tmpl 18 Dec 2008 22:33:02 -0000
@@ -40,6 +40,7 @@
"never" => "Never",
"cc_unless_role" => "Only if I have no role on them",
"lang" => "Language used in email",
+ "view_testopia" => "View the Testopia links",
"quote_replies" => "Quote the associated comment when you click on its reply link",
"quoted_reply" => "Quote the full comment",
"simple_reply" => "Reference the comment number only",
}
Index: Bugzilla/Search.pm
===================================================================
RCS file: /cvsroot/mozilla/webtools/bugzilla/Bugzilla/Search.pm,v
retrieving revision 1.173.2.1
diff -u -r1.173.2.1 Search.pm
--- Bugzilla/Search.pm 7 Jul 2009 18:20:08 -0000 1.173.2.1
+++ Bugzilla/Search.pm 21 Aug 2009 21:11:51 -0000
--- Bugzilla/Search.pm 7 Jul 2009 18:20:08 -0000 1.173.2.1
+++ Bugzilla/Search.pm 7 Nov 2009 02:55:47 -0000
@@ -269,6 +269,12 @@
push(@supptables, "LEFT JOIN longdescs AS ldtime " .
"ON ldtime.bug_id = bugs.bug_id");
@@ -323,3 +185,106 @@ diff -u -r1.173.2.1 Search.pm
my $minvotes;
if (defined $params->param('votes')) {
Index: Bugzilla/DB/Mysql.pm
===================================================================
RCS file: /cvsroot/mozilla/webtools/bugzilla/Bugzilla/DB/Mysql.pm,v
retrieving revision 1.72.2.3
diff -u -r1.72.2.3 Mysql.pm
--- Bugzilla/DB/Mysql.pm 20 Sep 2009 22:33:59 -0000 1.72.2.3
+++ Bugzilla/DB/Mysql.pm 7 Nov 2009 02:55:49 -0000
@@ -746,6 +746,9 @@
$self->bz_drop_index('bugs_fulltext', $index);
}
}
+ if ($table eq 'test_runs' && $name eq 'summary') {
+ $self->bz_drop_index('test_runs', 'test_runs_summary_idx');
+ }
my $dropped = $self->bz_drop_related_fks($table, $name);
push(@dropped_fks, @$dropped);
Index: template/en/default/admin/products/confirm-delete.html.tmpl
===================================================================
RCS file: /cvsroot/mozilla/webtools/bugzilla/template/en/default/admin/products/confirm-delete.html.tmpl,v
retrieving revision 1.11
diff -u -r1.11 confirm-delete.html.tmpl
--- template/en/default/admin/products/confirm-delete.html.tmpl 18 Dec 2008 17:18:20 -0000 1.11
+++ template/en/default/admin/products/confirm-delete.html.tmpl 7 Nov 2009 02:55:49 -0000
@@ -243,6 +243,8 @@
[% Hook.process("confirmation") %]
+[% Hook.process("additional-product-values") %]
+
[% IF product.bug_count == 0 || Param('allowbugdeletion') %]
<p>Do you really want to delete this product?</p>
Index: template/en/default/global/setting-descs.none.tmpl
===================================================================
RCS file: /cvsroot/mozilla/webtools/bugzilla/template/en/default/global/setting-descs.none.tmpl,v
retrieving revision 1.15.2.1
diff -u -r1.15.2.1 setting-descs.none.tmpl
--- template/en/default/global/setting-descs.none.tmpl 19 Aug 2009 21:41:45 -0000 1.15.2.1
+++ template/en/default/global/setting-descs.none.tmpl 7 Nov 2009 02:55:49 -0000
@@ -40,6 +40,7 @@
"never" => "Never",
"cc_unless_role" => "Only if I have no role on them",
"lang" => "Language used in email",
+ "view_testopia" => "View the Testopia links",
"quote_replies" => "Quote the associated comment when you click on its reply link",
"quoted_reply" => "Quote the full comment",
"simple_reply" => "Reference the comment number only",
Index: Bugzilla/Install/Filesystem.pm
===================================================================
RCS file: /cvsroot/mozilla/webtools/bugzilla/Bugzilla/Install/Filesystem.pm,v
retrieving revision 1.34
diff -u -r1.34 Filesystem.pm
--- Bugzilla/Install/Filesystem.pm 23 Jan 2009 21:34:42 -0000 1.34
+++ Bugzilla/Install/Filesystem.pm 7 Nov 2009 02:55:49 -0000
@@ -112,6 +112,7 @@
'runtests.pl' => { perms => $owner_executable },
'testserver.pl' => { perms => $ws_executable },
'whine.pl' => { perms => $ws_executable },
+ 'tr_importxml.pl' => { perms => $ws_executable },
'customfield.pl' => { perms => $owner_executable },
'email_in.pl' => { perms => $ws_executable },
'sanitycheck.pl' => { perms => $ws_executable },
Index: Bugzilla/WebService/User.pm
===================================================================
RCS file: /cvsroot/mozilla/webtools/bugzilla/Bugzilla/WebService/User.pm,v
retrieving revision 1.14
diff -u -r1.14 User.pm
--- Bugzilla/WebService/User.pm 26 Jan 2009 20:40:22 -0000 1.14
+++ Bugzilla/WebService/User.pm 7 Nov 2009 02:55:49 -0000
@@ -223,6 +223,32 @@
return { users => \@users };
}
+#################
+# User Lookup #
+#################
+
+sub lookup_login_by_id {
+ my $self = shift;
+ my ($author_id) = @_;
+
+ my $user = new Bugzilla::User($author_id);
+
+ my $result = defined $user ? $user->login : '';
+
+ # Result is user login string or empty string if failed
+ return $result;
+}
+
+sub lookup_id_by_login {
+ my $self = shift;
+ my ($author) = @_;
+
+ my $result = Bugzilla::User::login_to_id($author);
+
+ # Result is user id or 0 if failed
+ return $result;
+}
+
1;
__END__

View File

@@ -92,4 +92,4 @@
[% colsepchar %]
[% END %]
[% END %]
[% END %] \ No newline at end of file
[% END %]

View File

@@ -54,4 +54,4 @@
<tr:completion_time>[% caserun.completion_time FILTER xml %]</tr:completion_time>
<tr:sortkey>[% caserun.sortkey || 0 FILTER xml %]</tr:sortkey>
<tr:bugs>[% caserun.bug_list %]</tr:bugs>
</tr:testcaserun>\ No newline at end of file
</tr:testcaserun>

View File

@@ -26,4 +26,4 @@
[% PROCESS testopia/plan/show.xml.tmpl %]
[% END %]
[% PROCESS testopia/export/xml.footer.tmpl %]\ No newline at end of file
[% PROCESS testopia/export/xml.footer.tmpl %]

View File

@@ -55,4 +55,4 @@
[% FOREACH caserun = run.caseruns %]
[% PROCESS testopia/caserun/show.xml.tmpl %]
[% END %]
</tr:testrun>\ No newline at end of file
</tr:testrun>

View File

@@ -100,16 +100,7 @@ elsif ($action eq 'clone'){
ThrowUserError('missing-plans-list') unless scalar keys %planseen;
my $dbh = Bugzilla->dbh;
my $summary = $cgi->param('new_run_summary');
my $build = $cgi->param('new_run_build');
my $env = $cgi->param('new_run_environment');
trick_taint($summary) if $cgi->param('new_run_summary');
detaint_natural($build) if $cgi->param('new_run_build');
detaint_natural($env) if $cgi->param('new_run_environment');
validate_test_id($build, 'build') if $cgi->param('new_run_build');
validate_test_id($env, 'environment') if $cgi->param('new_run_environment');
my @newruns;
my @failures;
foreach my $run_id (@run_ids){
@@ -118,9 +109,15 @@ elsif ($action eq 'clone'){
my $manager = $cgi->param('keep_run_manager') ? $run->manager->id : Bugzilla->user->id;
$summary ||= $run->summary;
$build ||= $run->build->id;
$env ||= $run->environment->id;
my $summary = $cgi->param('new_run_summary') || $run->summary;
my $build = $cgi->param('new_run_build') || $run->build->id;
my $env = $cgi->param('new_run_environment') || $run->environment->id;
trick_taint($summary) if $cgi->param('new_run_summary');
detaint_natural($build) if $cgi->param('new_run_build');
detaint_natural($env) if $cgi->param('new_run_environment');
validate_test_id($build, 'build') if $cgi->param('new_run_build');
validate_test_id($env, 'environment') if $cgi->param('new_run_environment');
my @caseruns;
if ($cgi->param('copy_cases')){