Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
MeterSphere
metersphere
提交
caec40d1
M
metersphere
项目概览
MeterSphere
/
metersphere
上一次同步 3 年多
通知
25
Star
1
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
metersphere
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
caec40d1
编写于
4月 26, 2021
作者:
W
wenyann
提交者:
刘瑞斌
4月 26, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: 部分缺陷
上级
a0db3535
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
30 addition
and
9 deletion
+30
-9
backend/src/main/java/io/metersphere/api/jmeter/APIBackendListenerClient.java
...a/io/metersphere/api/jmeter/APIBackendListenerClient.java
+6
-6
backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanLoadCaseMapper.java
...etersphere/base/mapper/ext/ExtTestPlanLoadCaseMapper.java
+3
-0
backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanLoadCaseMapper.xml
...metersphere/base/mapper/ext/ExtTestPlanLoadCaseMapper.xml
+9
-3
backend/src/main/java/io/metersphere/track/controller/TestPlanLoadCaseController.java
...ersphere/track/controller/TestPlanLoadCaseController.java
+5
-0
backend/src/main/java/io/metersphere/track/service/TestPlanLoadCaseService.java
...io/metersphere/track/service/TestPlanLoadCaseService.java
+7
-0
未找到文件。
backend/src/main/java/io/metersphere/api/jmeter/APIBackendListenerClient.java
浏览文件 @
caec40d1
...
...
@@ -208,7 +208,7 @@ public class APIBackendListenerClient extends AbstractBackendListenerClient impl
//环境
String
name
=
apiAutomationService
.
get
(
debugReportId
).
getName
();
//时间
Long
time
=
apiTestCaseWithBLOBs
.
get
Upd
ateTime
();
Long
time
=
apiTestCaseWithBLOBs
.
get
Cre
ateTime
();
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
String
executionTime
=
null
;
String
time_
=
String
.
valueOf
(
time
);
...
...
@@ -286,7 +286,7 @@ public class APIBackendListenerClient extends AbstractBackendListenerClient impl
String
executionEnvironment
=
apiScenario
.
getScenarioDefinition
();
JSONObject
json
=
JSONObject
.
parseObject
(
executionEnvironment
);
String
name
=
""
;
if
(
json
.
getString
(
"environmentMap"
).
length
()
>
0
)
{
if
(
json
.
getString
(
"environmentMap"
).
length
()
>
2
)
{
JSONObject
environment
=
JSONObject
.
parseObject
(
json
.
getString
(
"environmentMap"
));
String
environmentId
=
environment
.
get
(
apiScenario
.
getProjectId
()).
toString
();
name
=
apiAutomationService
.
get
(
environmentId
).
getName
();
...
...
@@ -363,13 +363,13 @@ public class APIBackendListenerClient extends AbstractBackendListenerClient impl
String
subject
=
""
;
String
event
=
""
;
if
(
StringUtils
.
equals
(
ReportTriggerMode
.
API
.
name
(),
report
.
getTriggerMode
()))
{
successContext
=
"接口测试 API任务通知:'"
+
report
.
getExecutor
()
+
"所执行的"
+
report
.
getName
()
+
"'执行成功"
+
"\n"
+
"执行环境:"
+
report
.
getExecutionEnvironment
()
+
"\n"
+
"
【接口定义暂无报告链接】"
+
"\n"
+
"请点击下面链接进入测试报告页面"
+
"\n"
+
"(旧版)接口测)
路径"
+
url
+
"\n"
+
"(新版)接口测试路径"
+
url2
;
failedContext
=
"接口测试 API任务通知:'"
+
report
.
getExecutor
()
+
"所执行的"
+
report
.
getName
()
+
"'执行失败"
+
"\n"
+
"执行环境:"
+
report
.
getExecutionEnvironment
()
+
"\n"
+
"
【接口定义暂无报告链接】
"
+
"\n"
+
"请点击下面链接进入测试报告页面"
+
"\n"
+
"(旧版)接口测试路径"
+
url
+
"\n"
+
"(新版)接口测试路径"
+
url2
;
successContext
=
"接口测试 API任务通知:'"
+
report
.
getExecutor
()
+
"所执行的"
+
report
.
getName
()
+
"'执行成功"
+
"\n"
+
"执行环境:"
+
report
.
getExecutionEnvironment
()
+
"\n"
+
"
[接口定义暂无报告链接]"
+
"\n"
+
"请点击下面链接进入测试报告页面"
+
"\n"
+
"(旧版)接口测试
路径"
+
url
+
"\n"
+
"(新版)接口测试路径"
+
url2
;
failedContext
=
"接口测试 API任务通知:'"
+
report
.
getExecutor
()
+
"所执行的"
+
report
.
getName
()
+
"'执行失败"
+
"\n"
+
"执行环境:"
+
report
.
getExecutionEnvironment
()
+
"\n"
+
"
[接口定义暂无报告链接]
"
+
"\n"
+
"请点击下面链接进入测试报告页面"
+
"\n"
+
"(旧版)接口测试路径"
+
url
+
"\n"
+
"(新版)接口测试路径"
+
url2
;
subject
=
Translator
.
get
(
"task_notification_jenkins"
);
}
if
(
StringUtils
.
equals
(
ReportTriggerMode
.
SCHEDULE
.
name
(),
report
.
getTriggerMode
()))
{
successContext
=
"接口测试定时任务通知:'"
+
report
.
getExecutor
()
+
"所执行的"
+
report
.
getName
()
+
"'执行成功"
+
"\n"
+
"执行环境:"
+
report
.
getExecutionEnvironment
()
+
"\n"
+
"
【接口定义暂无报告链接】
"
+
"\n"
+
"请点击下面链接进入测试报告页面"
+
"\n"
+
"(旧版)接口测试路径"
+
url
+
"\n"
+
"(新版)接口测试路径"
+
url2
;
failedContext
=
"接口测试定时任务通知:'"
+
report
.
getExecutor
()
+
"所执行的"
+
report
.
getName
()
+
"'执行失败"
+
"\n"
+
"执行环境:"
+
report
.
getExecutionEnvironment
()
+
"\n"
+
"
【接口定义暂无报告链接】
"
+
"\n"
+
"请点击下面链接进入测试报告页面"
+
"\n"
+
"(旧版)接口测试路径"
+
url
+
"\n"
+
"(新版)接口测试路径"
+
url2
;
successContext
=
"接口测试定时任务通知:'"
+
report
.
getExecutor
()
+
"所执行的"
+
report
.
getName
()
+
"'执行成功"
+
"\n"
+
"执行环境:"
+
report
.
getExecutionEnvironment
()
+
"\n"
+
"
[接口定义暂无报告链接]
"
+
"\n"
+
"请点击下面链接进入测试报告页面"
+
"\n"
+
"(旧版)接口测试路径"
+
url
+
"\n"
+
"(新版)接口测试路径"
+
url2
;
failedContext
=
"接口测试定时任务通知:'"
+
report
.
getExecutor
()
+
"所执行的"
+
report
.
getName
()
+
"'执行失败"
+
"\n"
+
"执行环境:"
+
report
.
getExecutionEnvironment
()
+
"\n"
+
"
[接口定义暂无报告链接]
"
+
"\n"
+
"请点击下面链接进入测试报告页面"
+
"\n"
+
"(旧版)接口测试路径"
+
url
+
"\n"
+
"(新版)接口测试路径"
+
url2
;
subject
=
Translator
.
get
(
"task_notification"
);
}
if
(
StringUtils
.
equals
(
"Success"
,
report
.
getStatus
()))
{
...
...
backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanLoadCaseMapper.java
浏览文件 @
caec40d1
...
...
@@ -14,6 +14,9 @@ public interface ExtTestPlanLoadCaseMapper {
List
<
TestPlanLoadCaseDTO
>
selectByIdIn
(
@Param
(
"request"
)
LoadCaseRequest
request
);
void
updateCaseStatus
(
@Param
(
"reportId"
)
String
reportId
,
@Param
(
"status"
)
String
status
);
void
updateCaseStatusByApi
(
@Param
(
"testPlanId"
)
String
testPlanId
,
@Param
(
"loadCaseId"
)
String
loadCaseId
,
@Param
(
"status"
)
String
status
);
List
<
String
>
getStatusByTestPlanId
(
@Param
(
"planId"
)
String
planId
);
List
<
String
>
selectTestPlanLoadCaseId
(
@Param
(
"request"
)
LoadCaseRequest
request
);
...
...
backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanLoadCaseMapper.xml
浏览文件 @
caec40d1
...
...
@@ -6,16 +6,22 @@
set status = #{status}
where tplc.load_report_id = #{reportId}
</update>
<update
id=
"updateCaseStatusByApi"
>
update test_plan_load_case tplc
set status = #{status}
where tplc.load_case_id = #{loadCaseId}
and tplc.test_plan_id = #{testPlanId}
</update>
<select
id=
"selectIdsNotInPlan"
resultType=
"java.lang.String"
>
select load_test.id
from load_test
where load_test.project_id = #{request.projectId}
<if
test=
"request.name != null and request.name != ''"
>
and load_test.name like CONCAT('%', #{request.name},'%')
and load_test.name like CONCAT('%', #{request.name},'%')
</if>
and load_test.id not in (
select tplc.load_case_id from test_plan_load_case tplc where tplc.test_plan_id = #{request.testPlanId}
and load_test.id not in (
select tplc.load_case_id from test_plan_load_case tplc where tplc.test_plan_id = #{request.testPlanId}
)
</select>
<select
id=
"selectTestPlanLoadCaseList"
resultType=
"io.metersphere.track.dto.TestPlanLoadCaseDTO"
>
...
...
backend/src/main/java/io/metersphere/track/controller/TestPlanLoadCaseController.java
浏览文件 @
caec40d1
...
...
@@ -76,4 +76,9 @@ public class TestPlanLoadCaseController {
public
void
update
(
@RequestBody
TestPlanLoadCase
testPlanLoadCase
)
{
testPlanLoadCaseService
.
update
(
testPlanLoadCase
);
}
@PostMapping
(
"/update/api"
)
public
void
updateByApi
(
@RequestBody
TestPlanLoadCase
testPlanLoadCase
)
{
testPlanLoadCaseService
.
updateByApi
(
testPlanLoadCase
);
}
}
backend/src/main/java/io/metersphere/track/service/TestPlanLoadCaseService.java
浏览文件 @
caec40d1
...
...
@@ -221,6 +221,13 @@ public class TestPlanLoadCaseService {
}
}
public
void
updateByApi
(
TestPlanLoadCase
testPlanLoadCase
)
{
String
testPlanId
=
testPlanLoadCase
.
getTestPlanId
();
String
loadCaseId
=
testPlanLoadCase
.
getLoadCaseId
();
String
status
=
testPlanLoadCase
.
getStatus
();
extTestPlanLoadCaseMapper
.
updateCaseStatusByApi
(
testPlanId
,
loadCaseId
,
status
);
}
public
List
<
String
>
getStatus
(
String
planId
)
{
return
extTestPlanLoadCaseMapper
.
getStatusByTestPlanId
(
planId
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录