|
14 | 14 | import hudson.tasks.junit.TestDataPublisher; |
15 | 15 | import hudson.util.DescribableList; |
16 | 16 | import hudson.util.FormValidation; |
| 17 | +import hudson.util.ListBoxModel; |
| 18 | +import java.util.Arrays; |
17 | 19 | import java.util.Collections; |
18 | 20 | import java.util.HashSet; |
19 | 21 | import java.util.List; |
|
27 | 29 | import org.kohsuke.stapler.DataBoundConstructor; |
28 | 30 | import org.kohsuke.stapler.DataBoundSetter; |
29 | 31 | import org.kohsuke.stapler.QueryParameter; |
| 32 | +import org.kohsuke.stapler.verb.POST; |
30 | 33 |
|
31 | 34 | public class JUnitResultsStep extends Step implements JUnitTask { |
32 | 35 | /** |
@@ -259,6 +262,21 @@ public Set<? extends Class<?>> getRequiredContext() { |
259 | 262 | return Collections.unmodifiableSet(context); |
260 | 263 | } |
261 | 264 |
|
| 265 | + @POST |
| 266 | + @SuppressWarnings("unused") |
| 267 | + public ListBoxModel doFillStdioRetentionItems() { |
| 268 | + ListBoxModel options = new ListBoxModel(); |
| 269 | + options.add(StdioRetention.DEFAULT.getDisplayName(), StdioRetention.DEFAULT.name()); |
| 270 | + |
| 271 | + List<ListBoxModel.Option> stdioRetentions = Arrays.stream(StdioRetention.values()) |
| 272 | + .filter(retention -> retention != StdioRetention.DEFAULT) |
| 273 | + .map(option -> new ListBoxModel.Option(option.getDisplayName(), option.name())) |
| 274 | + .toList(); |
| 275 | + options.addAll(stdioRetentions); |
| 276 | + |
| 277 | + return options; |
| 278 | + } |
| 279 | + |
262 | 280 | public FormValidation doCheckHealthScaleFactor(@QueryParameter double value) { |
263 | 281 | if (value < 1e-7) { |
264 | 282 | return FormValidation.warning("Test health reporting disabled"); |
|
0 commit comments