diff --git a/backend/src/main/java/io/metersphere/api/dto/definition/request/MsTestElement.java b/backend/src/main/java/io/metersphere/api/dto/definition/request/MsTestElement.java index fb30feb4b1..e287a189ed 100644 --- a/backend/src/main/java/io/metersphere/api/dto/definition/request/MsTestElement.java +++ b/backend/src/main/java/io/metersphere/api/dto/definition/request/MsTestElement.java @@ -41,7 +41,6 @@ import org.apache.jmeter.config.Arguments; import org.apache.jmeter.config.CSVDataSet; import org.apache.jmeter.config.RandomVariableConfig; import org.apache.jmeter.modifiers.CounterConfig; -import org.apache.jmeter.protocol.http.control.AuthManager; import org.apache.jmeter.save.SaveService; import org.apache.jmeter.testelement.TestElement; import org.apache.jorphan.collections.HashTree; @@ -75,7 +74,7 @@ import java.util.stream.Collectors; }) @JSONType(seeAlso = {MsHTTPSamplerProxy.class, MsHeaderManager.class, MsJSR223Processor.class, MsJSR223PostProcessor.class, - MsJSR223PreProcessor.class, MsTestPlan.class, MsThreadGroup.class, AuthManager.class, MsAssertions.class, + MsJSR223PreProcessor.class, MsTestPlan.class, MsThreadGroup.class, MsAuthManager.class, MsAssertions.class, MsExtract.class, MsTCPSampler.class, MsDubboSampler.class, MsJDBCSampler.class, MsConstantTimer.class, MsIfController.class, MsScenario.class, MsLoopController.class, MsJmeterElement.class}, typeKey = "type") @Data public abstract class MsTestElement { diff --git a/backend/src/main/java/io/metersphere/commons/utils/ShiroUtils.java b/backend/src/main/java/io/metersphere/commons/utils/ShiroUtils.java index 27430e98ae..78c1d168fc 100644 --- a/backend/src/main/java/io/metersphere/commons/utils/ShiroUtils.java +++ b/backend/src/main/java/io/metersphere/commons/utils/ShiroUtils.java @@ -25,6 +25,7 @@ public class ShiroUtils { filterChainDefinitionMap.put("/favicon.ico", "anon"); filterChainDefinitionMap.put("/display/file/**", "anon"); filterChainDefinitionMap.put("/jmeter/download/**", "anon"); + filterChainDefinitionMap.put("/jmeter/ping", "anon"); filterChainDefinitionMap.put("/authsource/list/allenable", "anon"); filterChainDefinitionMap.put("/sso/signin", "anon"); filterChainDefinitionMap.put("/sso/callback", "anon"); diff --git a/backend/src/main/java/io/metersphere/performance/controller/JmeterFileController.java b/backend/src/main/java/io/metersphere/performance/controller/JmeterFileController.java index f39070d3b8..6ad3c39089 100644 --- a/backend/src/main/java/io/metersphere/performance/controller/JmeterFileController.java +++ b/backend/src/main/java/io/metersphere/performance/controller/JmeterFileController.java @@ -18,6 +18,11 @@ public class JmeterFileController { @Resource private JmeterFileService jmeterFileService; + @GetMapping("ping") + public String checkStatus() { + return "PONG"; + } + @GetMapping("download") public ResponseEntity downloadJmeterFiles(@RequestParam("testId") String testId, @RequestParam("resourceId") String resourceId, @RequestParam("ratio") double ratio, @RequestParam("startTime") long startTime, diff --git a/backend/src/main/java/io/metersphere/performance/engine/docker/DockerTestEngine.java b/backend/src/main/java/io/metersphere/performance/engine/docker/DockerTestEngine.java index c59a8664e1..eb28578592 100644 --- a/backend/src/main/java/io/metersphere/performance/engine/docker/DockerTestEngine.java +++ b/backend/src/main/java/io/metersphere/performance/engine/docker/DockerTestEngine.java @@ -74,14 +74,14 @@ public class DockerTestEngine extends AbstractEngine { BaseSystemConfigDTO baseInfo = CommonBeanFactory.getBean(SystemParameterService.class).getBaseInfo(); KafkaProperties kafkaProperties = CommonBeanFactory.getBean(KafkaProperties.class); JmeterProperties jmeterProperties = CommonBeanFactory.getBean(JmeterProperties.class); - String metersphereUrl = "http://localhost:8081"; + String metersphereUrl = "http://localhost:8081"; // 占位符 if (baseInfo != null) { metersphereUrl = baseInfo.getUrl(); } - + String jmeterPingUrl = metersphereUrl + "/jmeter/ping"; // 检查下载地址是否正确 // docker 不能从 localhost 中下载文件 if (StringUtils.contains(metersphereUrl, "http://localhost") - || !UrlTestUtils.testUrlWithTimeOut(metersphereUrl, 1000)) { + || !UrlTestUtils.testUrlWithTimeOut(jmeterPingUrl, 1000)) { MSException.throwException(Translator.get("run_load_test_file_init_error")); } diff --git a/backend/src/main/java/io/metersphere/performance/parse/xml/reader/jmx/JmeterDocumentParser.java b/backend/src/main/java/io/metersphere/performance/parse/xml/reader/jmx/JmeterDocumentParser.java index 73f401036e..349563c8f2 100644 --- a/backend/src/main/java/io/metersphere/performance/parse/xml/reader/jmx/JmeterDocumentParser.java +++ b/backend/src/main/java/io/metersphere/performance/parse/xml/reader/jmx/JmeterDocumentParser.java @@ -90,7 +90,6 @@ public class JmeterDocumentParser implements DocumentParser { parseHashTree(ele); } else if (nodeNameEquals(ele, TEST_PLAN)) { processSetupTestPlan(ele); - processTearDownTestPlan(ele); processCheckoutConfigTestElement(ele); processCheckoutDnsCacheManager(ele); processCheckoutArguments(ele); @@ -566,105 +565,18 @@ public class JmeterDocumentParser implements DocumentParser { } } - private void processTearDownTestPlan(Element ele) { - /*true*/ - Document document = ele.getOwnerDocument(); - Element tearDownSwitch = createBoolProp(document, "TestPlan.tearDown_on_shutdown", true); - ele.appendChild(tearDownSwitch); - - Node hashTree = ele.getNextSibling(); - while (!(hashTree instanceof Element)) { - hashTree = hashTree.getNextSibling(); - } - /* - - continue - - false - 1 - - 1 - 1 - false - - - true - - */ - Element tearDownElement = document.createElement("PostThreadGroup"); - tearDownElement.setAttribute("guiclass", "PostThreadGroupGui"); - tearDownElement.setAttribute("testclass", "PostThreadGroup"); - tearDownElement.setAttribute("testname", "tearDown Thread Group"); - tearDownElement.setAttribute("enabled", "true"); - tearDownElement.appendChild(createStringProp(document, "ThreadGroup.on_sample_error", "continue")); - tearDownElement.appendChild(createStringProp(document, "ThreadGroup.num_threads", "1")); - tearDownElement.appendChild(createStringProp(document, "ThreadGroup.ramp_time", "1")); - tearDownElement.appendChild(createStringProp(document, "ThreadGroup.duration", "")); - tearDownElement.appendChild(createStringProp(document, "ThreadGroup.delay", "")); - tearDownElement.appendChild(createBoolProp(document, "ThreadGroup.scheduler", false)); - tearDownElement.appendChild(createBoolProp(document, "ThreadGroup.same_user_on_next_iteration", true)); - Element elementProp = document.createElement("elementProp"); - elementProp.setAttribute("name", "ThreadGroup.main_controller"); - elementProp.setAttribute("elementType", "LoopController"); - elementProp.setAttribute("guiclass", "LoopControlPanel"); - elementProp.setAttribute("testclass", "LoopController"); - elementProp.setAttribute("testname", "Loop Controller"); - elementProp.setAttribute("enabled", "true"); - elementProp.appendChild(createBoolProp(document, "LoopController.continue_forever", false)); - elementProp.appendChild(createStringProp(document, "LoopController.loops", "1")); - tearDownElement.appendChild(elementProp); - hashTree.appendChild(tearDownElement); - - Element tearDownHashTree = document.createElement(HASH_TREE_ELEMENT); - /* - - */ - Element onceOnlyController = document.createElement("OnceOnlyController"); - onceOnlyController.setAttribute("guiclass", "OnceOnlyControllerGui"); - onceOnlyController.setAttribute("testclass", "OnceOnlyController"); - onceOnlyController.setAttribute("testname", "Once Only Controller"); - onceOnlyController.setAttribute("enabled", "true"); - tearDownHashTree.appendChild(onceOnlyController); - /* - - - false - true - false - - - - */ - Element onceOnlyHashTree = document.createElement(HASH_TREE_ELEMENT); - Element debugSampler = document.createElement("DebugSampler"); - debugSampler.setAttribute("guiclass", "TestBeanGUI"); - debugSampler.setAttribute("testclass", "DebugSampler"); - debugSampler.setAttribute("testname", "Debug Sampler"); - debugSampler.setAttribute("enabled", "true"); - debugSampler.appendChild(createBoolProp(document, "displayJMeterProperties", false)); - debugSampler.appendChild(createBoolProp(document, "displayJMeterVariables", true)); - debugSampler.appendChild(createBoolProp(document, "displaySystemProperties", false)); - onceOnlyHashTree.appendChild(debugSampler); - // 添加空的 hashTree - onceOnlyHashTree.appendChild(document.createElement(HASH_TREE_ELEMENT)); - tearDownHashTree.appendChild(onceOnlyHashTree); - hashTree.appendChild(tearDownHashTree); - // 添加backend listener - processCheckoutBackendListener(tearDownElement); - } - private Element createBoolProp(Document document, String name, boolean value) { - Element tearDownSwitch = document.createElement("boolProp"); - tearDownSwitch.setAttribute("name", name); - tearDownSwitch.appendChild(document.createTextNode(String.valueOf(value))); - return tearDownSwitch; + Element boolProp = document.createElement("boolProp"); + boolProp.setAttribute("name", name); + boolProp.appendChild(document.createTextNode(String.valueOf(value))); + return boolProp; } private Element createIntProp(Document document, String name, int value) { - Element tearDownSwitch = document.createElement("intProp"); - tearDownSwitch.setAttribute("name", name); - tearDownSwitch.appendChild(document.createTextNode(String.valueOf(value))); - return tearDownSwitch; + Element intProp = document.createElement("intProp"); + intProp.setAttribute("name", name); + intProp.appendChild(document.createTextNode(String.valueOf(value))); + return intProp; } private void processBackendListener(Element backendListener) { diff --git a/backend/src/main/java/io/metersphere/xpack b/backend/src/main/java/io/metersphere/xpack index b9042074b7..611c38a8b0 160000 --- a/backend/src/main/java/io/metersphere/xpack +++ b/backend/src/main/java/io/metersphere/xpack @@ -1 +1 @@ -Subproject commit b9042074b780205e275c674f64417799110519fd +Subproject commit 611c38a8b0db7180ea4d4c8ace749ac25499672d diff --git a/frontend/src/business/components/api/automation/scenario/ApiScenarioList.vue b/frontend/src/business/components/api/automation/scenario/ApiScenarioList.vue index 0514b8985e..1d88e26b71 100644 --- a/frontend/src/business/components/api/automation/scenario/ApiScenarioList.vue +++ b/frontend/src/business/components/api/automation/scenario/ApiScenarioList.vue @@ -68,9 +68,7 @@ diff --git a/frontend/src/business/components/api/definition/components/list/ApiList.vue b/frontend/src/business/components/api/definition/components/list/ApiList.vue index ffc4b81641..9de7672e5a 100644 --- a/frontend/src/business/components/api/definition/components/list/ApiList.vue +++ b/frontend/src/business/components/api/definition/components/list/ApiList.vue @@ -114,13 +114,10 @@ v-if="item.id == 'tags'" prop="tags" :label="$t('commons.tag')" - min-width="80px" - :key="index" - > + min-width="120px" + :key="index"> @@ -225,7 +222,7 @@ import MsBottomContainer from "../BottomContainer"; import ShowMoreBtn from "../../../../track/case/components/ShowMoreBtn"; import MsBatchEdit from "../basis/BatchEdit"; import {API_METHOD_COLOUR, API_STATUS, DUBBO_METHOD, REQ_METHOD, SQL_METHOD, TCP_METHOD} from "../../model/JsonData"; -import {downloadFile, getUUID} from "@/common/js/utils"; +import {downloadFile} from "@/common/js/utils"; import {PROJECT_NAME} from '@/common/js/constants'; import {getCurrentProjectID, getCurrentUser} from "@/common/js/utils"; import {API_LIST, TEST_CASE_LIST, WORKSPACE_ID} from '@/common/js/constants'; @@ -246,7 +243,6 @@ import { import {_filter, _sort} from "@/common/js/tableUtils"; import {Api_List, Track_Test_Case} from "@/business/components/common/model/JsonData"; import HeaderCustom from "@/business/components/common/head/HeaderCustom"; -import {createComponent} from "@/business/components/api/definition/components/jmeter/components"; export default { @@ -273,7 +269,6 @@ export default { }, data() { return { - basisData: {}, type: API_LIST, headerItems: Api_List, tableLabel: Api_List, @@ -739,36 +734,36 @@ export default { diff --git a/frontend/src/business/components/track/case/components/TestCaseList.vue b/frontend/src/business/components/track/case/components/TestCaseList.vue index d0140ce774..e5f891f255 100644 --- a/frontend/src/business/components/track/case/components/TestCaseList.vue +++ b/frontend/src/business/components/track/case/components/TestCaseList.vue @@ -135,9 +135,7 @@ diff --git a/frontend/src/business/components/track/plan/view/comonents/api/RelevanceScenarioList.vue b/frontend/src/business/components/track/plan/view/comonents/api/RelevanceScenarioList.vue index 976e6d1ef3..3f40e57480 100644 --- a/frontend/src/business/components/track/plan/view/comonents/api/RelevanceScenarioList.vue +++ b/frontend/src/business/components/track/plan/view/comonents/api/RelevanceScenarioList.vue @@ -17,11 +17,9 @@ - + diff --git a/frontend/src/business/components/track/plan/view/comonents/api/TestPlanApiCaseList.vue b/frontend/src/business/components/track/plan/view/comonents/api/TestPlanApiCaseList.vue index 62422a5db6..685d3f6aaf 100644 --- a/frontend/src/business/components/track/plan/view/comonents/api/TestPlanApiCaseList.vue +++ b/frontend/src/business/components/track/plan/view/comonents/api/TestPlanApiCaseList.vue @@ -80,9 +80,7 @@ :label="$t('commons.tag')" :key="index"> diff --git a/frontend/src/business/components/track/plan/view/comonents/api/TestPlanApiScenarioList.vue b/frontend/src/business/components/track/plan/view/comonents/api/TestPlanApiScenarioList.vue index e2fa9fbca6..d5e51c5d58 100644 --- a/frontend/src/business/components/track/plan/view/comonents/api/TestPlanApiScenarioList.vue +++ b/frontend/src/business/components/track/plan/view/comonents/api/TestPlanApiScenarioList.vue @@ -37,9 +37,7 @@ diff --git a/frontend/src/business/components/track/plan/view/comonents/report/TemplateComponent/component/ScenarioFailureCasesList.vue b/frontend/src/business/components/track/plan/view/comonents/report/TemplateComponent/component/ScenarioFailureCasesList.vue index 20431cf5de..f9430218bf 100644 --- a/frontend/src/business/components/track/plan/view/comonents/report/TemplateComponent/component/ScenarioFailureCasesList.vue +++ b/frontend/src/business/components/track/plan/view/comonents/report/TemplateComponent/component/ScenarioFailureCasesList.vue @@ -20,9 +20,7 @@