TestLink导入需求类测试用例的时候,报下面错误: 
前台页面报的错误 

#0  database->exec_query() called at [C:\xampp\htdocs\testlink\lib\functions\requirement_mgr.class.php:1000]  
#1  requirement_mgr->assign_to_tcase() called at [C:\xampp\htdocs\testlink\lib\testcases\tcImport.php:668]  
#2  processRequirements() called at [C:\xampp\htdocs\testlink\lib\testcases\tcImport.php:453]  
#3  saveImportedTCData() called at [C:\xampp\htdocs\testlink\lib\testcases\tcImport.php:938]  
#4  importTestSuitesFromSimpleXML() called at [C:\xampp\htdocs\testlink\lib\testcases\tcImport.php:945]  
#5  importTestSuitesFromSimpleXML() called at [C:\xampp\htdocs\testlink\lib\testcases\tcImport.php:945]  
#6  importTestSuitesFromSimpleXML() called at [C:\xampp\htdocs\testlink\lib\testcases\tcImport.php:169]  
#7  importTestCaseDataFromXML() called at [C:\xampp\htdocs\testlink\lib\testcases\tcImport.php:76]  

后台日志报的错误:

Query failed: errorcode[1064]  
     errormsg:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''2013-10-21 10:07:18')' at line 1   
     [13/Oct/21 08:07:18][AUDIT][ftp6i7qei5rdhl2aruqrspg3g1][GUI]  
          Requirement with title '编号XQ3' was assigned to the Test Case '需求NO-2编号XQ2--测试第三环节' 


报错是由于插入需求覆盖表req_coverage的SQL有问题,其中author_id传入的字符串 

修改程序: 
testlink\lib\testcases\tcImport.php 668行, 
  $reqMgr->assign_to_tcase($cachedReqSpec[$value[ 'req_spec_title']]['req' ][$value['doc_id']],$tcaseId,1); 
加入传入 author_id 字段,由于项目的需求,默认写成 1 ,为admin用户 

posted on 2013-12-18 16:17  持续集成  阅读(896)  评论(0)    收藏  举报