Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
FIY695
jenkins
提交
7871cb19
J
jenkins
项目概览
FIY695
/
jenkins
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
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,发现更多精彩内容 >>
提交
7871cb19
编写于
12月 23, 2013
作者:
C
CloudBees DEV@Cloud
浏览文件
操作
浏览文件
下载
差异文件
Merge commit '
fd97a2f5
'
上级
e292366f
fd97a2f5
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
17 addition
and
2 deletion
+17
-2
core/src/main/java/hudson/tasks/BuildTrigger.java
core/src/main/java/hudson/tasks/BuildTrigger.java
+1
-0
core/src/main/java/jenkins/model/Jenkins.java
core/src/main/java/jenkins/model/Jenkins.java
+2
-2
test/src/test/java/hudson/tasks/FingerprinterTest.java
test/src/test/java/hudson/tasks/FingerprinterTest.java
+14
-0
未找到文件。
core/src/main/java/hudson/tasks/BuildTrigger.java
浏览文件 @
7871cb19
...
...
@@ -192,6 +192,7 @@ public class BuildTrigger extends Recorder implements DependencyDeclarer {
public
static
boolean
execute
(
AbstractBuild
build
,
BuildListener
listener
)
{
PrintStream
logger
=
listener
.
getLogger
();
// Check all downstream Project of the project, not just those defined by BuildTrigger
// TODO this may not yet be up to date if rebuildDependencyGraphAsync has been used; need a method to wait for the last call made before now to finish
final
DependencyGraph
graph
=
Jenkins
.
getInstance
().
getDependencyGraph
();
List
<
Dependency
>
downstreamProjects
=
new
ArrayList
<
Dependency
>(
graph
.
getDownstreamDependencies
(
build
.
getProject
()));
...
...
core/src/main/java/jenkins/model/Jenkins.java
浏览文件 @
7871cb19
...
...
@@ -3625,7 +3625,7 @@ public class Jenkins extends AbstractCIBase implements ModifiableTopLevelItemGro
*/
public
Future
<
DependencyGraph
>
rebuildDependencyGraphAsync
()
{
dependencyGraphDirty
.
set
(
true
);
return
Timer
.
get
().
s
ubmit
(
new
java
.
util
.
concurrent
.
Callable
<
DependencyGraph
>()
{
return
Timer
.
get
().
s
chedule
(
new
java
.
util
.
concurrent
.
Callable
<
DependencyGraph
>()
{
@Override
public
DependencyGraph
call
()
throws
Exception
{
if
(
dependencyGraphDirty
.
get
())
{
...
...
@@ -3633,7 +3633,7 @@ public class Jenkins extends AbstractCIBase implements ModifiableTopLevelItemGro
}
return
dependencyGraph
;
}
});
}
,
500
,
TimeUnit
.
MILLISECONDS
);
}
public
DependencyGraph
getDependencyGraph
()
{
...
...
test/src/test/java/hudson/tasks/FingerprinterTest.java
浏览文件 @
7871cb19
...
...
@@ -100,6 +100,8 @@ public class FingerprinterTest {
j
.
assertBuildStatusSuccess
(
upstream
.
scheduleBuild2
(
0
).
get
());
j
.
assertBuildStatusSuccess
(
downstream
.
scheduleBuild2
(
0
).
get
());
j
.
jenkins
.
rebuildDependencyGraph
();
List
<
AbstractProject
>
downstreamProjects
=
upstream
.
getDownstreamProjects
();
List
<
AbstractProject
>
upstreamProjects
=
downstream
.
getUpstreamProjects
();
...
...
@@ -118,6 +120,8 @@ public class FingerprinterTest {
j
.
assertBuildStatusSuccess
(
upstream2
.
scheduleBuild2
(
0
).
get
());
j
.
assertBuildStatusSuccess
(
downstream
.
scheduleBuild2
(
0
).
get
());
j
.
jenkins
.
rebuildDependencyGraph
();
List
<
AbstractProject
>
downstreamProjects
=
upstream
.
getDownstreamProjects
();
List
<
AbstractProject
>
downstreamProjects2
=
upstream2
.
getDownstreamProjects
();
List
<
AbstractProject
>
upstreamProjects
=
downstream
.
getUpstreamProjects
();
...
...
@@ -139,6 +143,8 @@ public class FingerprinterTest {
j
.
assertBuildStatusSuccess
(
downstream
.
scheduleBuild2
(
0
).
get
());
j
.
assertBuildStatusSuccess
(
downstream2
.
scheduleBuild2
(
0
).
get
());
j
.
jenkins
.
rebuildDependencyGraph
();
List
<
AbstractProject
>
downstreamProjects
=
upstream
.
getDownstreamProjects
();
List
<
AbstractProject
>
upstreamProjects
=
downstream
.
getUpstreamProjects
();
List
<
AbstractProject
>
upstreamProjects2
=
downstream2
.
getUpstreamProjects
();
...
...
@@ -176,6 +182,8 @@ public class FingerprinterTest {
j
.
assertBuildStatusSuccess
(
p
.
scheduleBuild2
(
0
).
get
());
j
.
assertBuildStatusSuccess
(
p
.
scheduleBuild2
(
0
).
get
());
Jenkins
.
getInstance
().
rebuildDependencyGraph
();
List
<
AbstractProject
>
upstreamProjects
=
p
.
getUpstreamProjects
();
List
<
AbstractProject
>
downstreamProjects
=
p
.
getDownstreamProjects
();
...
...
@@ -195,6 +203,8 @@ public class FingerprinterTest {
j
.
buildAndAssertSuccess
(
freestyleProject
);
j
.
waitUntilNoActivity
();
j
.
jenkins
.
rebuildDependencyGraph
();
RunList
<
FreeStyleBuild
>
builds
=
freestyleProject
.
getBuilds
();
assertEquals
(
"There should only be one FreestyleBuild"
,
1
,
builds
.
size
());
FreeStyleBuild
build
=
builds
.
iterator
().
next
();
...
...
@@ -300,6 +310,8 @@ public class FingerprinterTest {
Fingerprint
f
=
j
.
jenkins
.
_getFingerprint
(
Util
.
getDigestOf
(
singleContents
[
0
]+
"\n"
));
assertEquals
(
3
,
f
.
getUsages
().
size
());
j
.
jenkins
.
rebuildDependencyGraph
();
assertEquals
(
Arrays
.
asList
(
p1
),
p2
.
getUpstreamProjects
());
assertEquals
(
Arrays
.
asList
(
p1
),
p3
.
getUpstreamProjects
());
assertEquals
(
new
HashSet
(
Arrays
.
asList
(
p2
,
p3
)),
new
HashSet
(
p1
.
getDownstreamProjects
()));
...
...
@@ -308,6 +320,8 @@ public class FingerprinterTest {
p3
.
delete
();
new
FingerprintCleanupThread
().
execute
(
StreamTaskListener
.
fromStdout
());
j
.
jenkins
.
rebuildDependencyGraph
();
// records for p3 should have been deleted now
assertEquals
(
2
,
f
.
getUsages
().
size
());
assertEquals
(
Arrays
.
asList
(
p1
),
p2
.
getUpstreamProjects
());
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录