From 98ddf35ef70bfbb792a2f8252a7e361aac6276d2 Mon Sep 17 00:00:00 2001 From: shiziyuan9527 Date: Wed, 8 Sep 2021 18:34:50 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92):=20?= =?UTF-8?q?=E6=80=A7=E8=83=BD=E6=B5=8B=E8=AF=95=E7=94=A8=E4=BE=8B=E5=8F=AF?= =?UTF-8?q?=E4=BB=A5=E8=B0=83=E6=95=B4=E5=8E=8B=E5=8A=9B=E9=85=8D=E7=BD=AE?= =?UTF-8?q?#1001972?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --story=1001972 --user=lyh 性能测试添加到测试计划后,可以重新调整压力配置并不影响原有的配置 https://www.tapd.cn/55049933/s/1044891 --- .../base/domain/TestPlanLoadCase.java | 7 +- .../base/domain/TestPlanLoadCaseExample.java | 70 ++ .../base/mapper/TestPlanLoadCaseMapper.java | 6 + .../base/mapper/TestPlanLoadCaseMapper.xml | 94 ++- .../request/RunTestPlanRequest.java | 11 + .../service/JmeterFileService.java | 27 + .../service/PerformanceTestService.java | 31 +- .../TestPlanLoadCaseController.java | 10 + .../service/TestPlanLoadCaseService.java | 18 + .../track/service/TestPlanService.java | 2 +- .../db/migration/V95__v1.13_release.sql | 7 + .../view/comonents/load/LoadCaseConfig.vue | 92 +++ .../comonents/load/PerformanceLoadConfig.vue | 747 ++++++++++++++++++ .../comonents/load/TestPlanLoadCaseList.vue | 18 +- 14 files changed, 1123 insertions(+), 17 deletions(-) create mode 100644 frontend/src/business/components/track/plan/view/comonents/load/LoadCaseConfig.vue create mode 100644 frontend/src/business/components/track/plan/view/comonents/load/PerformanceLoadConfig.vue diff --git a/backend/src/main/java/io/metersphere/base/domain/TestPlanLoadCase.java b/backend/src/main/java/io/metersphere/base/domain/TestPlanLoadCase.java index 070ff29856..75e6d77e02 100644 --- a/backend/src/main/java/io/metersphere/base/domain/TestPlanLoadCase.java +++ b/backend/src/main/java/io/metersphere/base/domain/TestPlanLoadCase.java @@ -1,8 +1,7 @@ package io.metersphere.base.domain; -import lombok.Data; - import java.io.Serializable; +import lombok.Data; @Data public class TestPlanLoadCase implements Serializable { @@ -22,5 +21,9 @@ public class TestPlanLoadCase implements Serializable { private String createUser; + private String testResourcePoolId; + + private String loadConfiguration; + private static final long serialVersionUID = 1L; } \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/domain/TestPlanLoadCaseExample.java b/backend/src/main/java/io/metersphere/base/domain/TestPlanLoadCaseExample.java index c77ea4d32c..dbf670e22f 100644 --- a/backend/src/main/java/io/metersphere/base/domain/TestPlanLoadCaseExample.java +++ b/backend/src/main/java/io/metersphere/base/domain/TestPlanLoadCaseExample.java @@ -643,6 +643,76 @@ public class TestPlanLoadCaseExample { addCriterion("create_user not between", value1, value2, "createUser"); return (Criteria) this; } + + public Criteria andTestResourcePoolIdIsNull() { + addCriterion("test_resource_pool_id is null"); + return (Criteria) this; + } + + public Criteria andTestResourcePoolIdIsNotNull() { + addCriterion("test_resource_pool_id is not null"); + return (Criteria) this; + } + + public Criteria andTestResourcePoolIdEqualTo(String value) { + addCriterion("test_resource_pool_id =", value, "testResourcePoolId"); + return (Criteria) this; + } + + public Criteria andTestResourcePoolIdNotEqualTo(String value) { + addCriterion("test_resource_pool_id <>", value, "testResourcePoolId"); + return (Criteria) this; + } + + public Criteria andTestResourcePoolIdGreaterThan(String value) { + addCriterion("test_resource_pool_id >", value, "testResourcePoolId"); + return (Criteria) this; + } + + public Criteria andTestResourcePoolIdGreaterThanOrEqualTo(String value) { + addCriterion("test_resource_pool_id >=", value, "testResourcePoolId"); + return (Criteria) this; + } + + public Criteria andTestResourcePoolIdLessThan(String value) { + addCriterion("test_resource_pool_id <", value, "testResourcePoolId"); + return (Criteria) this; + } + + public Criteria andTestResourcePoolIdLessThanOrEqualTo(String value) { + addCriterion("test_resource_pool_id <=", value, "testResourcePoolId"); + return (Criteria) this; + } + + public Criteria andTestResourcePoolIdLike(String value) { + addCriterion("test_resource_pool_id like", value, "testResourcePoolId"); + return (Criteria) this; + } + + public Criteria andTestResourcePoolIdNotLike(String value) { + addCriterion("test_resource_pool_id not like", value, "testResourcePoolId"); + return (Criteria) this; + } + + public Criteria andTestResourcePoolIdIn(List values) { + addCriterion("test_resource_pool_id in", values, "testResourcePoolId"); + return (Criteria) this; + } + + public Criteria andTestResourcePoolIdNotIn(List values) { + addCriterion("test_resource_pool_id not in", values, "testResourcePoolId"); + return (Criteria) this; + } + + public Criteria andTestResourcePoolIdBetween(String value1, String value2) { + addCriterion("test_resource_pool_id between", value1, value2, "testResourcePoolId"); + return (Criteria) this; + } + + public Criteria andTestResourcePoolIdNotBetween(String value1, String value2) { + addCriterion("test_resource_pool_id not between", value1, value2, "testResourcePoolId"); + return (Criteria) this; + } } public static class Criteria extends GeneratedCriteria { diff --git a/backend/src/main/java/io/metersphere/base/mapper/TestPlanLoadCaseMapper.java b/backend/src/main/java/io/metersphere/base/mapper/TestPlanLoadCaseMapper.java index e7e7a608d7..51fa685f66 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/TestPlanLoadCaseMapper.java +++ b/backend/src/main/java/io/metersphere/base/mapper/TestPlanLoadCaseMapper.java @@ -16,15 +16,21 @@ public interface TestPlanLoadCaseMapper { int insertSelective(TestPlanLoadCase record); + List selectByExampleWithBLOBs(TestPlanLoadCaseExample example); + List selectByExample(TestPlanLoadCaseExample example); TestPlanLoadCase selectByPrimaryKey(String id); int updateByExampleSelective(@Param("record") TestPlanLoadCase record, @Param("example") TestPlanLoadCaseExample example); + int updateByExampleWithBLOBs(@Param("record") TestPlanLoadCase record, @Param("example") TestPlanLoadCaseExample example); + int updateByExample(@Param("record") TestPlanLoadCase record, @Param("example") TestPlanLoadCaseExample example); int updateByPrimaryKeySelective(TestPlanLoadCase record); + int updateByPrimaryKeyWithBLOBs(TestPlanLoadCase record); + int updateByPrimaryKey(TestPlanLoadCase record); } \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/mapper/TestPlanLoadCaseMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/TestPlanLoadCaseMapper.xml index 6b4975ef5f..0aaef4056b 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/TestPlanLoadCaseMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/TestPlanLoadCaseMapper.xml @@ -10,6 +10,10 @@ + + + + @@ -71,8 +75,27 @@ id, test_plan_id, load_case_id, load_report_id, `status`, create_time, update_time, - create_user + create_user, test_resource_pool_id + + load_configuration + + - select + , + from test_plan_load_case where id = #{id,jdbcType=VARCHAR} @@ -106,10 +131,12 @@ insert into test_plan_load_case (id, test_plan_id, load_case_id, load_report_id, `status`, create_time, - update_time, create_user) + update_time, create_user, test_resource_pool_id, + load_configuration) values (#{id,jdbcType=VARCHAR}, #{testPlanId,jdbcType=VARCHAR}, #{loadCaseId,jdbcType=VARCHAR}, #{loadReportId,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, - #{updateTime,jdbcType=BIGINT}, #{createUser,jdbcType=VARCHAR}) + #{updateTime,jdbcType=BIGINT}, #{createUser,jdbcType=VARCHAR}, #{testResourcePoolId,jdbcType=VARCHAR}, + #{loadConfiguration,jdbcType=LONGVARCHAR}) insert into test_plan_load_case @@ -138,6 +165,12 @@ create_user, + + test_resource_pool_id, + + + load_configuration, + @@ -164,6 +197,12 @@ #{createUser,jdbcType=VARCHAR}, + + #{testResourcePoolId,jdbcType=VARCHAR}, + + + #{loadConfiguration,jdbcType=LONGVARCHAR}, +