Skip to content

Commit

Permalink
Fix chart trend after moving from default storage to external storage (
Browse files Browse the repository at this point in the history
  • Loading branch information
jonesbusy authored Sep 19, 2023
1 parent 9c259eb commit f9529b8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/main/java/hudson/tasks/test/TestResultProjectAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
import hudson.model.Job;
import hudson.model.Run;
import hudson.tasks.junit.JUnitResultArchiver;
import hudson.tasks.junit.TrendTestResultSummary;
import hudson.tasks.test.TestResultTrendChart.PassedColor;

import io.jenkins.plugins.echarts.AsyncConfigurableTrendChart;
Expand Down Expand Up @@ -131,7 +132,11 @@ private LinesChartModel createChartModel(ChartModelConfiguration configuration,
JunitTestResultStorage storage = JunitTestResultStorage.find();
if (!(storage instanceof FileJunitTestResultStorage)) {
TestResultImpl pluggableStorage = storage.load(lastCompletedBuild.getParent().getFullName(), lastCompletedBuild.getNumber());
return new TestResultTrendChart().create(pluggableStorage.getTrendTestResultSummary(), passedColor);
List<TrendTestResultSummary> summary = pluggableStorage.getTrendTestResultSummary();

Check warning on line 135 in src/main/java/hudson/tasks/test/TestResultProjectAction.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Not covered line

Line 135 is not covered by tests
if (summary.isEmpty()) {

Check warning on line 136 in src/main/java/hudson/tasks/test/TestResultProjectAction.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Partially covered line

Line 136 is only partially covered, 2 branches are missing
return new LinesChartModel();

Check warning on line 137 in src/main/java/hudson/tasks/test/TestResultProjectAction.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Not covered line

Line 137 is not covered by tests
}
return new TestResultTrendChart().create(summary, passedColor);

Check warning on line 139 in src/main/java/hudson/tasks/test/TestResultProjectAction.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Not covered line

Line 139 is not covered by tests
}

TestResultActionIterable buildHistory = createBuildHistory(lastCompletedBuild);
Expand Down

0 comments on commit f9529b8

Please sign in to comment.