Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

JENKINS-74974 - Adapt Scriptler test to use preferred terminology #1859

Merged
merged 1 commit into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,15 @@
*/
package org.jenkinsci.test.acceptance.plugins.scriptler;

import java.util.List;
import java.util.Objects;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.jenkinsci.test.acceptance.po.Jenkins;
import org.jenkinsci.test.acceptance.po.Node;

public class ScriptResult {
private static final List<String> BUILT_IN_NODE_NAMES = List.of("built-in", "controller", "master");
private final String result;

public ScriptResult(String result) {
Expand All @@ -37,8 +40,15 @@ public ScriptResult(String result) {

public String output(Node node) {
String name = node.getName();
if (node instanceof Jenkins && "(master)".equals(name)) {
name = "(controller)";
if (node instanceof Jenkins) {
// TODO: use the below code once Scriptler versions 390 and up are the only ones tested
// return "(" + node + ")";
return BUILT_IN_NODE_NAMES.stream()
.map(nodeName -> "(" + nodeName + ")")
.map(this::output)
.filter(Objects::nonNull)
.findFirst()
.orElse(null);
}
return output(name);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ public <T extends PageObject> T getPluginPage(Class<T> type) {

@Override
public String getName() {
return "(master)";
return "built-in";
}

@Override
Expand Down
Loading