Skip to content

Commit

Permalink
refactor: jenkins job结果关联实际执行结果
Browse files Browse the repository at this point in the history
--story=1010823 --user=刘瑞斌 Jenkins支持获取测试计划执行结果 https://www.tapd.cn/55049933/s/1321971
  • Loading branch information
liuruibin committed Jan 10, 2023
1 parent fd5cbd6 commit 17910fa
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main/java/io/metersphere/MeterSphereBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ public void perform(@Nonnull Run<?, ?> run, @Nonnull FilePath workspace, @Nonnul

if (!first.isPresent()) {
log("测试计划不存在");
run.setResult(Result.FAILURE);
return;
}
result = MeterSphereUtils.runTestPlan(run, client, realProjectId, mode, first.get().getId(), resourcePoolId, openMode);
Expand All @@ -119,6 +120,7 @@ public void perform(@Nonnull Run<?, ?> run, @Nonnull FilePath workspace, @Nonnul
.findFirst();
if (!firstCase.isPresent()) {
log("测试不存在");
run.setResult(Result.FAILURE);
return;
}
result = MeterSphereUtils.getTestStepsBySingle(client, realProjectId, firstCase.get(), testPlanId, resourcePoolId, openMode);
Expand All @@ -133,11 +135,13 @@ public void perform(@Nonnull Run<?, ?> run, @Nonnull FilePath workspace, @Nonnul

if (!firstCase.isPresent()) {
log("测试不存在");
run.setResult(Result.FAILURE);
return;
}
result = MeterSphereUtils.getTestStepsBySingle(client, realProjectId, firstCase.get(), testPlanId, resourcePoolId, openMode);
break;
default:
run.setResult(Result.FAILURE);
log("测试用例不存在");
}
// 使用case的结果
Expand Down

0 comments on commit 17910fa

Please sign in to comment.