Skip to content

Commit

Permalink
Merge pull request #822 from jglick/javaOptions
Browse files Browse the repository at this point in the history
`javaOptions` for `InboundAgentRule`
  • Loading branch information
jglick authored Aug 30, 2024
2 parents a3529e2 + 8341a45 commit 3da49c8
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/main/java/org/jvnet/hudson/test/InboundAgentRule.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ public static final class Options implements Serializable {
private boolean secret;
private boolean webSocket;
@CheckForNull private String tunnel;
private List<String> javaOptions = new ArrayList<>();
private boolean start = true;
private final LinkedHashMap<String, Level> loggers = new LinkedHashMap<>();
private String label;
Expand Down Expand Up @@ -207,6 +208,11 @@ public Builder tunnel(String tunnel) {
return this;
}

public Builder javaOptions(String... opts) {
options.javaOptions.addAll(List.of(opts));
return this;
}

/**
* Skip starting the agent.
*
Expand Down Expand Up @@ -331,6 +337,7 @@ public void start(AgentArguments agentArguments, Options options) throws Excepti
cmd.add("-Xdebug");
cmd.add("Xrunjdwp:transport=dt_socket,server=y,address=" + (JenkinsRule.SLAVE_DEBUG_PORT + agentArguments.numberOfNodes - 1));
}
cmd.addAll(options.javaOptions);
cmd.addAll(List.of("-jar", agentArguments.agentJar.getAbsolutePath()));
var m = Pattern.compile("(.+)computer/([^/]+)/slave-agent[.]jnlp").matcher(agentArguments.agentJnlpUrl);
if (m.matches() && remotingVersion(agentArguments.agentJar).isNewerThanOrEqualTo(new VersionNumber("3186.vc3b_7249b_87eb_"))) {
Expand Down

0 comments on commit 3da49c8

Please sign in to comment.