Skip to content

Commit f9529b8

Browse files
authored
Fix chart trend after moving from default storage to external storage (#571)
1 parent 9c259eb commit f9529b8

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/main/java/hudson/tasks/test/TestResultProjectAction.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
import hudson.model.Job;
4444
import hudson.model.Run;
4545
import hudson.tasks.junit.JUnitResultArchiver;
46+
import hudson.tasks.junit.TrendTestResultSummary;
4647
import hudson.tasks.test.TestResultTrendChart.PassedColor;
4748

4849
import io.jenkins.plugins.echarts.AsyncConfigurableTrendChart;
@@ -131,7 +132,11 @@ private LinesChartModel createChartModel(ChartModelConfiguration configuration,
131132
JunitTestResultStorage storage = JunitTestResultStorage.find();
132133
if (!(storage instanceof FileJunitTestResultStorage)) {
133134
TestResultImpl pluggableStorage = storage.load(lastCompletedBuild.getParent().getFullName(), lastCompletedBuild.getNumber());
134-
return new TestResultTrendChart().create(pluggableStorage.getTrendTestResultSummary(), passedColor);
135+
List<TrendTestResultSummary> summary = pluggableStorage.getTrendTestResultSummary();
136+
if (summary.isEmpty()) {
137+
return new LinesChartModel();
138+
}
139+
return new TestResultTrendChart().create(summary, passedColor);
135140
}
136141

137142
TestResultActionIterable buildHistory = createBuildHistory(lastCompletedBuild);

0 commit comments

Comments
 (0)