fix(接口测试): 调整数据补充数据

--user=郭雨琦
This commit is contained in:
guoyuqi 2022-03-31 11:17:38 +08:00 committed by 刘瑞斌
parent 398240ebe8
commit 29bb32f99e
3 changed files with 131 additions and 14 deletions

View File

@ -165,6 +165,11 @@ public class ApiExecuteService {
//检查TCP数据结构等其他进行处理 //检查TCP数据结构等其他进行处理
tcpApiParamService.checkTestElement(request.getTestElement()); tcpApiParamService.checkTestElement(request.getTestElement());
String testId = request.getTestElement() != null &&
CollectionUtils.isNotEmpty(request.getTestElement().getHashTree()) &&
CollectionUtils.isNotEmpty(request.getTestElement().getHashTree().get(0).getHashTree()) ?
request.getTestElement().getHashTree().get(0).getHashTree().get(0).getName() : request.getId();
HashTree hashTree = request.getTestElement().generateHashTree(config); HashTree hashTree = request.getTestElement().generateHashTree(config);
if (LoggerUtil.getLogger().isDebugEnabled()) { if (LoggerUtil.getLogger().isDebugEnabled()) {
LoggerUtil.debug("生成执行JMX内容【 " + request.getTestElement().getJmx(hashTree) + ""); LoggerUtil.debug("生成执行JMX内容【 " + request.getTestElement().getJmx(hashTree) + "");
@ -175,10 +180,6 @@ public class ApiExecuteService {
runMode = ApiRunMode.API_PLAN.name(); runMode = ApiRunMode.API_PLAN.name();
} }
String testId = request.getTestElement() != null &&
CollectionUtils.isNotEmpty(request.getTestElement().getHashTree()) &&
CollectionUtils.isNotEmpty(request.getTestElement().getHashTree().get(0).getHashTree()) ?
request.getTestElement().getHashTree().get(0).getHashTree().get(0).getName() : request.getId();
JmeterRunRequestDTO runRequest = new JmeterRunRequestDTO(testId, request.getId(), runMode, hashTree); JmeterRunRequestDTO runRequest = new JmeterRunRequestDTO(testId, request.getId(), runMode, hashTree);
runRequest.setDebug(request.isDebug()); runRequest.setDebug(request.isDebug());
// 开始执行 // 开始执行

View File

@ -1,10 +1,123 @@
ALTER TABLE `test_plan_api_case`
ADD INDEX planIdIndex (`test_plan_id`); DROP PROCEDURE IF EXISTS schema_change_api;
ALTER TABLE `test_plan_api_scenario` DELIMITER //
ADD INDEX planIdIndex (`test_plan_id`); CREATE PROCEDURE schema_change_api() BEGIN
ALTER TABLE `test_plan_load_case` DECLARE CurrentDatabase VARCHAR(100);
ADD INDEX planIdIndex (`test_plan_id`); SELECT DATABASE() INTO CurrentDatabase;
ALTER TABLE `test_case_issues` IF NOT EXISTS (SELECT * FROM information_schema.statistics WHERE table_schema=CurrentDatabase AND table_name = 'test_plan_api_case' AND index_name = 'plan_id_index') THEN
ADD INDEX issues_id_index (`issues_id`); ALTER TABLE `test_plan_api_case` ADD INDEX plan_id_index ( `test_plan_id` );
ALTER TABLE `test_plan_report` END IF;
ADD INDEX planIdIndex (`test_plan_id`); END//
DELIMITER ;
CALL schema_change_api();
DROP PROCEDURE IF EXISTS schema_change_api_one;
DELIMITER //
CREATE PROCEDURE schema_change_api_one() BEGIN
DECLARE CurrentDatabase VARCHAR(100);
SELECT DATABASE() INTO CurrentDatabase;
IF EXISTS (SELECT * FROM information_schema.statistics WHERE table_schema=CurrentDatabase AND table_name = 'test_plan_api_case' AND index_name = 'planIdIndex') THEN
ALTER TABLE `test_plan_api_case` DROP INDEX planIdIndex;
END IF;
END//
DELIMITER ;
CALL schema_change_api_one();
DROP PROCEDURE IF EXISTS schema_change_scenario;
DELIMITER //
CREATE PROCEDURE schema_change_scenario() BEGIN
DECLARE CurrentDatabase VARCHAR(100);
SELECT DATABASE() INTO CurrentDatabase;
IF NOT EXISTS (SELECT * FROM information_schema.statistics WHERE table_schema=CurrentDatabase AND table_name = 'test_plan_api_scenario' AND index_name = 'plan_id_index') THEN
ALTER TABLE `test_plan_api_scenario` ADD INDEX plan_id_index ( `test_plan_id` );
END IF;
END//
DELIMITER ;
CALL schema_change_scenario();
DROP PROCEDURE IF EXISTS schema_change_scenario_one;
DELIMITER //
CREATE PROCEDURE schema_change_scenario_one() BEGIN
DECLARE CurrentDatabase VARCHAR(100);
SELECT DATABASE() INTO CurrentDatabase;
IF EXISTS (SELECT * FROM information_schema.statistics WHERE table_schema=CurrentDatabase AND table_name = 'test_plan_api_scenario' AND index_name = 'planIdIndex') THEN
ALTER TABLE `test_plan_api_scenario` DROP INDEX planIdIndex;
END IF;
END//
DELIMITER ;
CALL schema_change_scenario_one();
DROP PROCEDURE IF EXISTS schema_change_load;
DELIMITER //
CREATE PROCEDURE schema_change_load() BEGIN
DECLARE CurrentDatabase VARCHAR(100);
SELECT DATABASE() INTO CurrentDatabase;
IF NOT EXISTS (SELECT * FROM information_schema.statistics WHERE table_schema=CurrentDatabase AND table_name = 'test_plan_load_case' AND index_name = 'plan_id_index') THEN
ALTER TABLE `test_plan_load_case` ADD INDEX plan_id_index ( `test_plan_id` );
END IF;
END//
DELIMITER ;
CALL schema_change_load();
DROP PROCEDURE IF EXISTS schema_change_load_one;
DELIMITER //
CREATE PROCEDURE schema_change_load_one() BEGIN
DECLARE CurrentDatabase VARCHAR(100);
SELECT DATABASE() INTO CurrentDatabase;
IF EXISTS (SELECT * FROM information_schema.statistics WHERE table_schema=CurrentDatabase AND table_name = 'test_plan_load_case' AND index_name = 'planIdIndex') THEN
ALTER TABLE `test_plan_load_case` DROP INDEX planIdIndex;
END IF;
END//
DELIMITER ;
CALL schema_change_load_one();
DROP PROCEDURE IF EXISTS schema_change_report;
DELIMITER //
CREATE PROCEDURE schema_change_report() BEGIN
DECLARE CurrentDatabase VARCHAR(100);
SELECT DATABASE() INTO CurrentDatabase;
IF NOT EXISTS (SELECT * FROM information_schema.statistics WHERE table_schema=CurrentDatabase AND table_name = 'test_plan_report' AND index_name = 'plan_id_index') THEN
ALTER TABLE `test_plan_report` ADD INDEX plan_id_index ( `test_plan_id` );
END IF;
END//
DELIMITER ;
CALL schema_change_report();
DROP PROCEDURE IF EXISTS schema_change_report_one;
DELIMITER //
CREATE PROCEDURE schema_change_report_one() BEGIN
DECLARE CurrentDatabase VARCHAR(100);
SELECT DATABASE() INTO CurrentDatabase;
IF EXISTS (SELECT * FROM information_schema.statistics WHERE table_schema=CurrentDatabase AND table_name = 'test_plan_report' AND index_name = 'planIdIndex') THEN
ALTER TABLE `test_plan_report` DROP INDEX planIdIndex;
END IF;
END//
DELIMITER ;
CALL schema_change_report_one();
DROP PROCEDURE IF EXISTS schema_change_issue;
DELIMITER //
CREATE PROCEDURE schema_change_issue() BEGIN
DECLARE CurrentDatabase VARCHAR(100);
SELECT DATABASE() INTO CurrentDatabase;
IF NOT EXISTS (SELECT * FROM information_schema.statistics WHERE table_schema=CurrentDatabase AND table_name = 'test_case_issues' AND index_name = 'issues_id_index') THEN
ALTER TABLE `test_case_issues` ADD INDEX issues_id_index ( `issues_id` );
END IF;
END//
DELIMITER ;
CALL schema_change_issue();
DROP PROCEDURE IF EXISTS schema_change;
DELIMITER //
CREATE PROCEDURE schema_change() BEGIN
DECLARE CurrentDatabase VARCHAR(100);
SELECT DATABASE() INTO CurrentDatabase;
IF NOT EXISTS (SELECT * FROM information_schema.statistics WHERE table_schema=CurrentDatabase AND table_name = 'api_scenario_report' AND index_name = 'update_time_index') THEN
ALTER TABLE `api_scenario_report` ADD INDEX update_time_index ( `update_time` );
END IF;
END//
DELIMITER ;
CALL schema_change();

View File

@ -383,6 +383,9 @@ export default {
this.result = getTestReviewTestCase(this.currentPage, this.pageSize, this.condition, (data) => { this.result = getTestReviewTestCase(this.currentPage, this.pageSize, this.condition, (data) => {
this.total = data.itemCount; this.total = data.itemCount;
this.tableData = data.listObject; this.tableData = data.listObject;
setTimeout(() => {
this.$refs.table.reloadTable()
}, 200);
}); });
} }
}, },