用例编排功能优化

This commit is contained in:
liangdaliang
2025-03-19 13:09:01 +08:00
parent 8c676dc30a
commit ad3e95bd73
5 changed files with 81 additions and 16 deletions

View File

@@ -17,6 +17,7 @@ import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.concurrent.CompletableFuture;
/**
* 用例Controller
@@ -87,6 +88,10 @@ public class TestCaseController extends BaseController {
@PostMapping("/run")
public AjaxResult run(@RequestBody IDQO qo) {
log.info("执行用例 id:{}, jmeterHomePath:{}", qo.getId(), jmeterHomePath);
return success(testCaseService.executeTestCaseById(qo.getId(), jmeterHomePath));
// 异步执行任务
CompletableFuture.runAsync(() -> {
testCaseService.executeTestCaseById(qo.getId(), jmeterHomePath);
});
return toAjax(true);
}
}