Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
jenkins
提交
39cb6f70
J
jenkins
项目概览
xxadev
/
jenkins
与 Fork 源项目一致
从无法访问的项目Fork
通知
3
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,发现更多精彩内容 >>
提交
39cb6f70
编写于
4月 25, 2010
作者:
U
unknown
提交者:
Tom Huybrechts
10月 16, 2010
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[HUDSON-4621] limit amount of history shown for junit results
上级
6aa6b171
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
73 addition
and
27 deletion
+73
-27
core/src/main/java/hudson/tasks/junit/History.java
core/src/main/java/hudson/tasks/junit/History.java
+53
-18
core/src/main/resources/hudson/tasks/junit/CaseResult/list.jelly
...c/main/resources/hudson/tasks/junit/CaseResult/list.jelly
+1
-1
core/src/main/resources/hudson/tasks/junit/ClassResult/list.jelly
.../main/resources/hudson/tasks/junit/ClassResult/list.jelly
+1
-1
core/src/main/resources/hudson/tasks/junit/History/index.jelly
...src/main/resources/hudson/tasks/junit/History/index.jelly
+17
-6
core/src/main/resources/hudson/tasks/test/MetaTabulatedResult/list.jelly
...esources/hudson/tasks/test/MetaTabulatedResult/list.jelly
+1
-1
未找到文件。
core/src/main/java/hudson/tasks/junit/History.java
浏览文件 @
39cb6f70
...
...
@@ -25,9 +25,20 @@ package hudson.tasks.junit;
import
hudson.model.AbstractBuild
;
import
hudson.model.Hudson
;
import
hudson.tasks.test.TestResult
;
import
hudson.tasks.test.TestObject
;
import
hudson.util.*
;
import
hudson.tasks.test.TestResult
;
import
hudson.util.ChartUtil
;
import
hudson.util.ColorPalette
;
import
hudson.util.DataSetBuilder
;
import
hudson.util.Graph
;
import
hudson.util.ShiftedCategoryAxis
;
import
hudson.util.StackedAreaRenderer2
;
import
java.awt.Color
;
import
java.awt.Paint
;
import
java.util.ArrayList
;
import
java.util.List
;
import
org.jfree.chart.ChartFactory
;
import
org.jfree.chart.JFreeChart
;
import
org.jfree.chart.axis.CategoryAxis
;
...
...
@@ -38,10 +49,8 @@ import org.jfree.chart.plot.PlotOrientation;
import
org.jfree.chart.renderer.category.StackedAreaRenderer
;
import
org.jfree.data.category.CategoryDataset
;
import
org.jfree.ui.RectangleInsets
;
import
java.awt.*
;
import
java.util.ArrayList
;
import
java.util.List
;
import
org.kohsuke.stapler.Stapler
;
import
org.kohsuke.stapler.StaplerRequest
;
/**
* History of {@link hudson.tasks.test.TestObject} over time.
...
...
@@ -66,9 +75,10 @@ public class History {
return
false
;
}
public
List
<
TestResult
>
getList
(
)
{
public
List
<
TestResult
>
getList
(
int
start
,
int
end
)
{
List
<
TestResult
>
list
=
new
ArrayList
<
TestResult
>();
for
(
AbstractBuild
<?,?>
b:
testObject
.
getOwner
().
getParent
().
getBuilds
())
{
end
=
Math
.
min
(
end
,
testObject
.
getOwner
().
getParent
().
getBuilds
().
size
());
for
(
AbstractBuild
<?,?>
b:
testObject
.
getOwner
().
getParent
().
getBuilds
().
subList
(
start
,
end
))
{
if
(
b
.
isBuilding
())
continue
;
TestResult
o
=
testObject
.
getResultInBuild
(
b
);
if
(
o
!=
null
)
{
...
...
@@ -78,14 +88,29 @@ public class History {
return
list
;
}
public
List
<
TestResult
>
getList
()
{
return
getList
(
0
,
testObject
.
getOwner
().
getParent
().
getBuilds
().
size
());
}
/**
* Graph of duration of tests over time.
*/
public
Graph
getDurationGraph
()
{
return
new
GraphImpl
(
"seconds"
)
{
protected
DataSetBuilder
<
String
,
ChartLabel
>
createDataSet
()
{
DataSetBuilder
<
String
,
ChartLabel
>
data
=
new
DataSetBuilder
<
String
,
ChartLabel
>();
for
(
hudson
.
tasks
.
test
.
TestResult
o:
getList
())
{
List
<
TestResult
>
list
;
try
{
list
=
getList
(
Integer
.
parseInt
(
Stapler
.
getCurrentRequest
().
getParameter
(
"start"
)),
Integer
.
parseInt
(
Stapler
.
getCurrentRequest
().
getParameter
(
"end"
)));
}
catch
(
NumberFormatException
e
)
{
list
=
getList
();
}
for
(
hudson
.
tasks
.
test
.
TestResult
o:
list
)
{
data
.
add
(((
double
)
o
.
getDuration
())
/
(
1000
),
""
,
new
ChartLabel
(
o
)
{
@Override
public
Color
getColor
()
{
...
...
@@ -100,6 +125,7 @@ public class History {
}
return
data
;
}
};
}
...
...
@@ -111,7 +137,16 @@ public class History {
protected
DataSetBuilder
<
String
,
ChartLabel
>
createDataSet
()
{
DataSetBuilder
<
String
,
ChartLabel
>
data
=
new
DataSetBuilder
<
String
,
ChartLabel
>();
for
(
TestResult
o:
getList
())
{
List
<
TestResult
>
list
;
try
{
list
=
getList
(
Integer
.
parseInt
(
Stapler
.
getCurrentRequest
().
getParameter
(
"start"
)),
Integer
.
parseInt
(
Stapler
.
getCurrentRequest
().
getParameter
(
"end"
)));
}
catch
(
NumberFormatException
e
)
{
list
=
getList
();
}
for
(
TestResult
o:
list
)
{
data
.
add
(
o
.
getPassCount
(),
"2Passed"
,
new
ChartLabel
(
o
));
data
.
add
(
o
.
getFailCount
(),
"1Failed"
,
new
ChartLabel
(
o
));
data
.
add
(
o
.
getSkipCount
(),
"0Skipped"
,
new
ChartLabel
(
o
));
...
...
@@ -125,7 +160,7 @@ public class History {
private
final
String
yLabel
;
protected
GraphImpl
(
String
yLabel
)
{
super
(
testObject
.
getOwner
().
getTimestamp
(),
600
,
300
);
super
(
-
1
,
600
,
300
);
// cannot use timestamp, since ranges may change
this
.
yLabel
=
yLabel
;
}
...
...
core/src/main/resources/hudson/tasks/junit/CaseResult/list.jelly
浏览文件 @
39cb6f70
...
...
@@ -35,7 +35,7 @@ THE SOFTWARE.
<td class="pane-header" style="width:5em">${%Test Result}</td>
</tr>
<tbody>
<j:forEach var="b" items="${it.owner.parent.builds}">
<j:forEach var="b" items="${it.owner.parent.builds}"
begin="${start}" end="${end}"
>
<j:set var="test" value="${it.getResultInBuild(b)}"/>
<j:if test="${test != null}">
<tr>
...
...
core/src/main/resources/hudson/tasks/junit/ClassResult/list.jelly
浏览文件 @
39cb6f70
...
...
@@ -34,7 +34,7 @@ THE SOFTWARE.
<td class="pane-header" style="width:5em">${%Total}</td>
</tr>
<tbody>
<j:forEach var="b" items="${it.owner.parent.builds}">
<j:forEach var="b" items="${it.owner.parent.builds}"
begin="${start}" end="${end}"
>
<j:set var="p" value="${it.getResultInBuild(b)}"/>
<j:if test="${p != null}">
<tr>
...
...
core/src/main/resources/hudson/tasks/junit/History/index.jelly
浏览文件 @
39cb6f70
...
...
@@ -25,18 +25,20 @@ THE SOFTWARE.
<!-- Displays the chart that show how long builds are taking -->
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form" xmlns:i="jelly:fmt">
<l:layout title="${%title(it.testObject.displayName)}">
<j:set var="start" value="${request.getParameter('start')?:0}"/>
<j:set var="end" value="${request.getParameter('end')?:start+24}"/>
<j:set var="rangeParameters" value="start=${start}&end=${end+1}"/>
<script type="text/javascript">
function setCount() {
document.getElementById("graph").src = "countGraph/png";
document.getElementById("graph").lazyMap = "countGraph/map";
document.getElementById("graph").src = "countGraph/png
?${rangeParameters}
";
document.getElementById("graph").lazyMap = "countGraph/map
?${rangeParameters}
";
document.getElementById("graph").alt = "[Count graph]";
document.getElementById("duration-link").style.display = "";
document.getElementById("count-link").style.display = "none";
}
function setDuration() {
document.getElementById("graph").src = "durationGraph/png"
document.getElementById("graph").lazyMap = "durationGraph/map"
document.getElementById("graph").src = "durationGraph/png
?${rangeParameters}
"
document.getElementById("graph").lazyMap = "durationGraph/map
?${rangeParameters}
"
document.getElementById("graph").alt = "[Duration graph]";
document.getElementById("duration-link").style.display = "none";
document.getElementById("count-link").style.display = "";
...
...
@@ -49,7 +51,7 @@ THE SOFTWARE.
<j:choose>
<j:when test="${it.historyAvailable()}">
<div align="center">
<img id="graph" src="durationGraph/png
" width="600" height="300" lazymap="durationGraph/map
" alt="[Duration graph]"/>
<img id="graph" src="durationGraph/png
?${rangeParameters}" width="600" height="300" lazymap="durationGraph/map?${rangeParameters}
" alt="[Duration graph]"/>
</div>
<div align="center">
show
...
...
@@ -62,6 +64,15 @@ THE SOFTWARE.
</j:otherwise>
</j:choose>
<st:include from="${it.testObject}" it="${it.testObject}" page="list.jelly" optional="true"/>
<div>
<j:if test="${start > 0}">
<a href="${app.rootUrl}${it.testObject.owner.url}testReport${it.testObject.url}/history${(start-25)>0?'?start='+(start-25):''}">${%Newer}</a>
</j:if>
<j:if test="${it.testObject.owner.project.builds.size() > end}">
<a href="${app.rootUrl}${it.testObject.owner.url}testReport${it.testObject.url}/history?start=${end+1}">${%Older}</a>
</j:if>
</div>
</l:main-panel>
</l:layout>
</j:jelly>
\ No newline at end of file
core/src/main/resources/hudson/tasks/test/MetaTabulatedResult/list.jelly
浏览文件 @
39cb6f70
...
...
@@ -34,7 +34,7 @@ THE SOFTWARE.
<td class="pane-header" style="width:5em">${%Total}</td>
</tr>
<tbody>
<j:forEach var="b" items="${it.owner.parent.builds}">
<j:forEach var="b" items="${it.owner.parent.builds}"
begin="${start}" end="${end}"
>
<j:set var="p" value="${it.getResultInBuild(b)}"/>
<j:if test="${p != null}">
<tr>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录