From 891b6b8efa94d88dcbd4545cd1d0aad63ed71543 Mon Sep 17 00:00:00 2001 From: "Captain.B" Date: Mon, 2 Nov 2020 17:11:36 +0800 Subject: [PATCH 1/5] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8Dflyway?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../db/migration/V39__modify_message_task_create_time.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/src/main/resources/db/migration/V39__modify_message_task_create_time.sql b/backend/src/main/resources/db/migration/V39__modify_message_task_create_time.sql index 3235c4246d..74ecfc6196 100644 --- a/backend/src/main/resources/db/migration/V39__modify_message_task_create_time.sql +++ b/backend/src/main/resources/db/migration/V39__modify_message_task_create_time.sql @@ -1,2 +1,2 @@ -alter table message_task - add create_time bigint(13) null; \ No newline at end of file +ALTER TABLE message_task + ADD create_time bigint(13) DEFAULT 0; \ No newline at end of file From 6c1721baefb78c059c86a92d765cd3e14f96ebea Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Tue, 3 Nov 2020 10:07:15 +0800 Subject: [PATCH 2/5] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):?= =?UTF-8?q?=20TCP=20=E9=A1=B5=E9=9D=A2=E7=A9=BA=E7=99=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/api/test/components/request/ApiRequestForm.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/business/components/api/test/components/request/ApiRequestForm.vue b/frontend/src/business/components/api/test/components/request/ApiRequestForm.vue index 41d1dcf1a0..3efe8a7e8b 100644 --- a/frontend/src/business/components/api/test/components/request/ApiRequestForm.vue +++ b/frontend/src/business/components/api/test/components/request/ApiRequestForm.vue @@ -18,7 +18,7 @@ export default { name: "MsApiRequestForm", - components: {MsApiSqlRequestForm, MsRequestResultTail, MsScenarioResults, MsApiDubboRequestForm, MsApiHttpRequestForm}, + components: {MsApiSqlRequestForm, MsRequestResultTail, MsScenarioResults, MsApiDubboRequestForm, MsApiHttpRequestForm, MsApiTcpRequestForm}, props: { scenario: Scenario, request: Request, From 7e9afdac387fc8fa714d44a3b5a05f20eb477b50 Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Tue, 3 Nov 2020 14:32:35 +0800 Subject: [PATCH 3/5] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):?= =?UTF-8?q?=20=E7=8E=AF=E5=A2=83=E8=AF=B7=E6=B1=82=E5=A4=B4=E5=92=8C?= =?UTF-8?q?=E5=8F=98=E9=87=8F=E5=BC=95=E7=94=A8=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/test/model/ScenarioModel.js | 50 +++++++++++-------- 1 file changed, 28 insertions(+), 22 deletions(-) diff --git a/frontend/src/business/components/api/test/model/ScenarioModel.js b/frontend/src/business/components/api/test/model/ScenarioModel.js index 60c738a149..f638e962ac 100644 --- a/frontend/src/business/components/api/test/model/ScenarioModel.js +++ b/frontend/src/business/components/api/test/model/ScenarioModel.js @@ -1139,17 +1139,18 @@ class JMXGenerator { sampler = new DubboSample(request.name || "", new JMXDubboRequest(request, scenario.dubboConfig)); } else if (request instanceof HttpRequest) { sampler = new HTTPSamplerProxy(request.name || "", new JMXHttpRequest(request, scenario.environment)); - this.addRequestHeader(sampler, request); + this.addRequestHeader(sampler, request, scenario); this.addRequestArguments(sampler, request); this.addRequestBody(sampler, request, testId); } else if (request instanceof SqlRequest) { request.dataSource = scenario.databaseConfigMap.get(request.dataSource); sampler = new JDBCSampler(request.name || "", request); - this.addRequestVariables(sampler, request); } else if (request instanceof TCPRequest) { sampler = new TCPSampler(request.name || "", new JMXTCPRequest(request, scenario)); } + this.addRequestVariables(sampler, request, scenario); + this.addDNSCacheManager(sampler, scenario.environment, request.useEnvironment); this.addRequestExtractor(sampler, request); @@ -1186,20 +1187,13 @@ class JMXGenerator { envArray = JSON.parse(environments); } envArray.forEach(item => { - if (item.name && !keys.has(item.name)) { + if (item.enable != false && item.name && !keys.has(item.name)) { target.push(new KeyValue({name: item.name, value: item.value})); } }) } addScenarioVariables(threadGroup, scenario) { - if (scenario.environment) { - let config = scenario.environment.config; - if (!(scenario.environment.config instanceof Object)) { - config = JSON.parse(scenario.environment.config); - } - this.addEnvironments(config.commonConfig.variables, scenario.variables) - } let args = this.filterKV(scenario.variables); if (args.length > 0) { let name = scenario.name + " Variables"; @@ -1207,11 +1201,23 @@ class JMXGenerator { } } - addRequestVariables(httpSamplerProxy, request) { + addRequestVariables(httpSamplerProxy, request, scenario) { + if (request.useEnvironment && scenario.environment) { + let config = scenario.environment.config; + if (!(scenario.environment.config instanceof Object)) { + config = JSON.parse(scenario.environment.config); + } + if (!request.variables) { + request.variables = []; + } + this.addEnvironments(config.commonConfig.variables, request.variables) + } let name = request.name + " Variables"; - let variables = this.filterKV(request.variables); - if (variables && variables.length > 0) { - httpSamplerProxy.put(new Arguments(name, variables)); + if (request.variables) { + let variables = this.filterKV(request.variables); + if (variables && variables.length > 0) { + httpSamplerProxy.put(new Arguments(name, variables)); + } } } @@ -1272,13 +1278,6 @@ class JMXGenerator { } addScenarioHeaders(threadGroup, scenario) { - if (scenario.environment) { - let config = scenario.environment.config; - if (!(scenario.environment.config instanceof Object)) { - config = JSON.parse(scenario.environment.config); - } - this.addEnvironments(config.httpConfig.headers, scenario.headers) - } let headers = this.filterKV(scenario.headers); if (headers.length > 0) { let name = scenario.name + " Headers"; @@ -1286,7 +1285,14 @@ class JMXGenerator { } } - addRequestHeader(httpSamplerProxy, request) { + addRequestHeader(httpSamplerProxy, request, scenario) { + if (request.useEnvironment && scenario.environment) { + let config = scenario.environment.config; + if (!(scenario.environment.config instanceof Object)) { + config = JSON.parse(scenario.environment.config); + } + this.addEnvironments(config.httpConfig.headers, request.headers) + } let name = request.name + " Headers"; this.addBodyFormat(request); let headers = this.filterKV(request.headers); From 021fef49803e46441a6953651dd19ab5484ffb7f Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Tue, 3 Nov 2020 17:13:56 +0800 Subject: [PATCH 4/5] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):?= =?UTF-8?q?=20get=E8=AF=B7=E6=B1=82=E6=97=A0=E6=B3=95=E8=BF=BD=E5=8A=A0url?= =?UTF-8?q?=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/business/components/api/test/model/ScenarioModel.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/frontend/src/business/components/api/test/model/ScenarioModel.js b/frontend/src/business/components/api/test/model/ScenarioModel.js index f638e962ac..c37693a87f 100644 --- a/frontend/src/business/components/api/test/model/ScenarioModel.js +++ b/frontend/src/business/components/api/test/model/ScenarioModel.js @@ -1001,7 +1001,8 @@ class JMXHttpRequest { this.domain = environment.config.httpConfig.domain; this.port = environment.config.httpConfig.port; this.protocol = environment.config.httpConfig.protocol; - let envPath = environment.config.httpConfig.protocol + "://" + environment.config.httpConfig.socket; + let url = new URL(environment.config.httpConfig.protocol + "://" + environment.config.httpConfig.socket); + let envPath = url.pathname === '/' ? '' : url.pathname; this.path = this.getPostQueryParameters(request, decodeURIComponent(envPath + (request.path ? request.path : ''))); } this.connectTimeout = request.connectTimeout; @@ -1397,11 +1398,11 @@ class JMXGenerator { body = this.filterKV(request.body.kvs); this.addRequestBodyFile(httpSamplerProxy, request, testId); } else { - httpSamplerProxy.boolProp('HTTPSampler.postBodyRaw', true); body.push({name: '', value: request.body.raw, encode: false, enable: true}); } if (request.method !== 'GET') { + httpSamplerProxy.boolProp('HTTPSampler.postBodyRaw', true); httpSamplerProxy.add(new HTTPSamplerArguments(body)); } } From bd577770a494326174b8424559949f82128277db Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Tue, 3 Nov 2020 17:23:01 +0800 Subject: [PATCH 5/5] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=B7=9F=E8=B8=AA):?= =?UTF-8?q?=20=E5=88=87=E6=8D=A2=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E5=85=B3=E8=81=94=E7=94=A8=E4=BE=8B=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E4=B8=8D=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/track/plan/view/comonents/TestCaseRelevance.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/src/business/components/track/plan/view/comonents/TestCaseRelevance.vue b/frontend/src/business/components/track/plan/view/comonents/TestCaseRelevance.vue index 387dd66c6f..5d979498d4 100644 --- a/frontend/src/business/components/track/plan/view/comonents/TestCaseRelevance.vue +++ b/frontend/src/business/components/track/plan/view/comonents/TestCaseRelevance.vue @@ -286,12 +286,13 @@ }, getProject() { if (this.planId) { - this.$post("/test/plan/project/", {planId: this.planId}, res => { + this.result = this.$post("/test/plan/project/", {planId: this.planId}, res => { let data = res.data; if (data) { this.projects = data; this.projectId = data[0].id; this.projectName = data[0].name; + this.search(); } }) }