提交 39d1a605 编写于 作者: G gcummings 提交者: Kohsuke Kawaguchi

[JENKINS-20974] RunParameter with filtering enabled should not include builds...

[JENKINS-20974] RunParameter with filtering enabled should not include builds which have not completed
上级 cf396b0f
......@@ -122,11 +122,11 @@ public class RunParameterDefinition extends SimpleParameterDefinition {
// use getFilter() method so we dont have to worry about null filter value.
switch (getFilter()) {
case COMPLETED:
return getProject().getBuilds().overThresholdOnly(Result.ABORTED);
return getProject().getBuilds().overThresholdAndCompletedOnly(Result.ABORTED);
case SUCCESSFUL:
return getProject().getBuilds().overThresholdOnly(Result.UNSTABLE);
return getProject().getBuilds().overThresholdAndCompletedOnly(Result.UNSTABLE);
case STABLE :
return getProject().getBuilds().overThresholdOnly(Result.SUCCESS);
return getProject().getBuilds().overThresholdAndCompletedOnly(Result.SUCCESS);
default:
return getProject().getBuilds();
}
......
......@@ -258,6 +258,19 @@ public class RunList<R extends Run> extends AbstractList<R> {
});
}
/**
* Filter the list to completed builds above threshold.
* <em>Warning:</em> this method mutates the original list and then returns it.
* @since 1.545
*/
public RunList<R> overThresholdAndCompletedOnly(final Result threshold) {
return filter(new Predicate<R>() {
public boolean apply(R r) {
return (!r.isBuilding() && r.getResult() != null && r.getResult().isBetterOrEqualTo(threshold));
}
});
}
/**
* Filter the list to builds on a single node only
* <em>Warning:</em> this method mutates the original list and then returns it.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册