解决测试计划性能测试相关bug
This commit is contained in:
@@ -1,8 +1,12 @@
|
||||
package com.test.test.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.test.common.annotation.Log;
|
||||
import com.test.common.core.controller.BaseController;
|
||||
import com.test.common.core.domain.AjaxResult;
|
||||
import com.test.common.core.page.TableDataInfo;
|
||||
import com.test.common.enums.BusinessType;
|
||||
import com.test.common.utils.StringUtils;
|
||||
import com.test.common.utils.poi.ExcelUtil;
|
||||
import com.test.test.domain.PerformanceTest;
|
||||
import com.test.test.domain.TestCase;
|
||||
import com.test.test.domain.qo.PerformanceTestQO;
|
||||
@@ -13,16 +17,12 @@ import com.test.test.service.ITestCaseService;
|
||||
import com.test.test.task.DynamicTaskManager;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.test.common.annotation.Log;
|
||||
import com.test.common.core.controller.BaseController;
|
||||
import com.test.common.core.domain.AjaxResult;
|
||||
import com.test.common.enums.BusinessType;
|
||||
import com.test.common.utils.poi.ExcelUtil;
|
||||
import com.test.common.core.page.TableDataInfo;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
/**
|
||||
* 性能测试Controller
|
||||
@@ -134,8 +134,12 @@ public class PerformanceTestController extends BaseController {
|
||||
}
|
||||
// 执行性能测试
|
||||
try {
|
||||
Long l1 = performanceTestCaseReportService.executePerformanceTestAndReport(l, jmeterHomePath, 2);
|
||||
return success(l1);
|
||||
CompletableFuture.runAsync(() -> {
|
||||
performanceTestCaseReportService.executePerformanceTestAndReport(l, jmeterHomePath, 2);
|
||||
});
|
||||
return toAjax(true);
|
||||
// Long l1 = performanceTestCaseReportService.executePerformanceTestAndReport(l, jmeterHomePath, 2);
|
||||
// return success(l1);
|
||||
} catch (Exception e) {
|
||||
log.error("执行失败!", e);
|
||||
return error("执行失败!");
|
||||
@@ -195,8 +199,12 @@ public class PerformanceTestController extends BaseController {
|
||||
dynamicTaskManager.updateTask(entity);
|
||||
}
|
||||
try {
|
||||
Long l1 = performanceTestCaseReportService.executePerformanceTestAndReport(l, jmeterHomePath, 2);
|
||||
return success(l1);
|
||||
CompletableFuture.runAsync(() -> {
|
||||
performanceTestCaseReportService.executePerformanceTestAndReport(l, jmeterHomePath, 2);
|
||||
});
|
||||
return toAjax(true);
|
||||
// Long l1 = performanceTestCaseReportService.executePerformanceTestAndReport(l, jmeterHomePath, 2);
|
||||
// return success(l1);
|
||||
} catch (Exception e) {
|
||||
log.error("执行失败!", e);
|
||||
return error("执行失败!");
|
||||
@@ -224,7 +232,11 @@ public class PerformanceTestController extends BaseController {
|
||||
// @PreAuthorize("@ss.hasPermi('system:test:remove')")
|
||||
@GetMapping("/executeNow")
|
||||
public AjaxResult executeNow(@RequestParam Long id) {
|
||||
Long l1 = performanceTestCaseReportService.executePerformanceTestAndReport(id, jmeterHomePath, 2);
|
||||
return success(l1);
|
||||
CompletableFuture.runAsync(() -> {
|
||||
performanceTestCaseReportService.executePerformanceTestAndReport(id, jmeterHomePath, 2);
|
||||
});
|
||||
return toAjax(true);
|
||||
// Long l1 = performanceTestCaseReportService.executePerformanceTestAndReport(id, jmeterHomePath, 2);
|
||||
// return success(l1);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user