Skip to content

Commit

Permalink
Remove -testJavaArgs (#438)
Browse files Browse the repository at this point in the history
  • Loading branch information
basil committed Feb 6, 2023
1 parent 78e92af commit 117c93a
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 42 deletions.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,6 @@ For example, such mode can be used to run tests with JDK11 starting from Jenkins
Two options can be passed to PCT CLI for such purpose:

* `testJDKHome` - A path to JDK HOME to be used for running tests in plugins
* `testJavaArgs` - Java test arguments to be used for test runs.
This option may be used to pass custom classpath and, in Java 11, additional modules

You can run the example by running the following command:

Expand Down
2 changes: 0 additions & 2 deletions src/main/docker/run-pct.sh
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,6 @@ if [[ "${TEST_JDK_HOME}" == "/opt/java/openjdk" ]] && [[ -n "${JDK_VERSION}" ]]
export JAVA_HOME="${TEST_JDK_HOME}"
export PATH="${JAVA_HOME}/bin:${PATH}"
fi
TEST_JAVA_ARGS="'${TEST_JAVA_ARGS:-} -Xmx768M -Djava.awt.headless=true -Djdk.net.URLClassPath.disableClassPathURLCheck=true'"

pctExitCode=0
echo java ${JAVA_OPTS} ${extra_java_opts[@]} \
Expand All @@ -175,7 +174,6 @@ echo java ${JAVA_OPTS} ${extra_java_opts[@]} \
-includePlugins "${ARTIFACT_ID}" \
-m2SettingsFile "${MVN_SETTINGS_FILE}" \
-testJDKHome "${TEST_JDK_HOME}" \
-testJavaArgs ${TEST_JAVA_ARGS:-} \
"$@" \
"|| echo \$? > /pct/tmp/pct_exit_code" > /pct/tmp/pct_command
chmod +x /pct/tmp/pct_command
Expand Down
11 changes: 0 additions & 11 deletions src/main/java/org/jenkins/tools/test/CliOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,6 @@ public class CliOptions {
description = "A path to JDK HOME to be used for running tests in plugins.")
private File testJDKHome;

@CheckForNull
@Parameter(
names = "-testJavaArgs",
description = "Java test arguments to be used for test runs.")
private String testJavaArgs;

@Parameter(
names = "-workDirectory",
required = true,
Expand Down Expand Up @@ -251,11 +245,6 @@ public File getTestJDKHome() {
return testJDKHome;
}

@CheckForNull
public String getTestJavaArgs() {
return testJavaArgs;
}

public boolean isFailOnError() {
return failOnError;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,6 @@ public static void main(String[] args) throws IOException {
if (options.getTestJDKHome() != null) {
config.setTestJDKHome(options.getTestJDKHome());
}
if (options.getTestJavaArgs() != null && !options.getTestJavaArgs().isEmpty()) {
config.setTestJavaArgs(options.getTestJavaArgs());
}
if (options.getFallbackGitHubOrganization() != null) {
config.setFallbackGitHubOrganization(options.getFallbackGitHubOrganization());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,6 @@ public class PluginCompatTesterConfig {
/** A Java HOME to be used for running tests in plugins. */
@CheckForNull private File testJDKHome;

@CheckForNull private String testJavaArgs;

@CheckForNull private File externalMaven;

// List of plugin artifact ids on which tests will be performed
Expand Down Expand Up @@ -176,11 +174,6 @@ public File getTestJDKHome() {
return testJDKHome;
}

@CheckForNull
public String getTestJavaArgs() {
return testJavaArgs;
}

public List<String> getExcludePlugins() {
return excludePlugins;
}
Expand Down Expand Up @@ -286,19 +279,6 @@ public Map<String, String> retrieveMavenProperties() throws IOException {
res.put("jvm", javaCmdAbsolutePath);
}

// Merge test Java args if needed
if (testJavaArgs != null && !testJavaArgs.isBlank()) {
if (res.containsKey("argLine")) {
LOGGER.log(
Level.WARNING,
"Maven properties already contain the 'argLine' argument; "
+ "merging value from properties and from the command line");
res.put("argLine", res.get("argLine") + " " + testJavaArgs);
} else {
res.put("argLine", testJavaArgs);
}
}

return res;
}

Expand Down Expand Up @@ -421,10 +401,6 @@ public void setTestJDKHome(@CheckForNull File testJDKHome) {
this.testJDKHome = testJDKHome;
}

public void setTestJavaArgs(@CheckForNull String testJavaArgs) {
this.testJavaArgs = testJavaArgs;
}

public File getLocalCheckoutDir() {
return localCheckoutDir;
}
Expand Down

0 comments on commit 117c93a

Please sign in to comment.