Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
LinuxSuRen
jenkins
提交
66460f95
J
jenkins
项目概览
LinuxSuRen
/
jenkins
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
J
jenkins
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
66460f95
编写于
5月 02, 2017
作者:
A
Andrew Bayer
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Get rid of isBuilding() check on previous build's culprits.
上级
31bc4173
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
16 addition
and
5 deletion
+16
-5
core/src/main/java/jenkins/scm/RunWithSCM.java
core/src/main/java/jenkins/scm/RunWithSCM.java
+1
-3
test/src/test/java/hudson/model/AbstractBuildTest.java
test/src/test/java/hudson/model/AbstractBuildTest.java
+14
-1
test/src/test/java/hudson/tasks/LogRotatorTest.java
test/src/test/java/hudson/tasks/LogRotatorTest.java
+1
-1
未找到文件。
core/src/main/java/jenkins/scm/RunWithSCM.java
浏览文件 @
66460f95
...
...
@@ -117,13 +117,11 @@ public interface RunWithSCM<JobT extends Job<JobT, RunT> & Queue.Task,
default
Set
<
User
>
calculateCulprits
()
{
Set
<
User
>
r
=
new
HashSet
<>();
RunT
p
=
((
RunT
)
this
).
getPreviousCompletedBuild
();
if
(
p
!=
null
&&
((
RunT
)
this
).
isBuilding
()
)
{
if
(
p
!=
null
)
{
Result
pr
=
p
.
getResult
();
if
(
pr
!=
null
&&
pr
.
isWorseThan
(
Result
.
SUCCESS
))
{
// we are still building, so this is just the current latest information,
// but we seems to be failing so far, so inherit culprits from the previous build.
// isBuilding() check is to avoid recursion when loading data from old Hudson, which doesn't record
// this information
r
.
addAll
(
p
.
getCulprits
());
}
}
...
...
test/src/test/java/hudson/model/AbstractBuildTest.java
浏览文件 @
66460f95
...
...
@@ -34,8 +34,12 @@ import java.util.Arrays;
import
java.util.Collections
;
import
java.util.Set
;
import
java.util.TreeSet
;
import
java.util.concurrent.TimeUnit
;
import
static
org
.
hamcrest
.
Matchers
.*;
import
static
org
.
junit
.
Assert
.*;
import
hudson.tasks.LogRotatorTest
;
import
org.junit.Rule
;
import
org.junit.Test
;
import
org.jvnet.hudson.test.CaptureEnvironmentBuilder
;
...
...
@@ -132,6 +136,8 @@ public class AbstractBuildTest {
FakeChangeLogSCM
scm
=
new
FakeChangeLogSCM
();
p
.
setScm
(
scm
);
LogRotatorTest
.
StallBuilder
sync
=
new
LogRotatorTest
.
StallBuilder
();
// 1st build, successful, no culprits
scm
.
addChange
().
withAuthor
(
"alice"
);
FreeStyleBuild
b
=
j
.
buildAndAssertSuccess
(
p
);
...
...
@@ -144,8 +150,15 @@ public class AbstractBuildTest {
assertCulprits
(
b
,
"bob"
);
// 3rd build. bob continues to be in culprit
p
.
getBuildersList
().
add
(
sync
);
scm
.
addChange
().
withAuthor
(
"charlie"
);
b
=
j
.
assertBuildStatus
(
Result
.
FAILURE
,
p
.
scheduleBuild2
(
0
).
get
());
b
=
p
.
scheduleBuild2
(
0
).
waitForStart
();
sync
.
waitFor
(
b
.
getNumber
(),
1
,
TimeUnit
.
SECONDS
);
// Verify that we can get culprits while running.
assertCulprits
(
b
,
"bob"
,
"charlie"
);
sync
.
release
(
b
.
getNumber
());
j
.
assertBuildStatus
(
Result
.
FAILURE
,
j
.
waitForCompletion
(
b
));
assertCulprits
(
b
,
"bob"
,
"charlie"
);
// 4th build, unstable. culprit list should continue
...
...
test/src/test/java/hudson/tasks/LogRotatorTest.java
浏览文件 @
66460f95
...
...
@@ -224,7 +224,7 @@ public class LogRotatorTest {
}
}
static
class
StallBuilder
extends
TestBuilder
{
public
static
class
StallBuilder
extends
TestBuilder
{
private
int
syncBuildNumber
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录