Skip to content

Commit

Permalink
Show -Dlicense.key value in test repro info (elastic#66179)
Browse files Browse the repository at this point in the history
- When a -Dlicense.key sys property is passed to the build we want to consider
this in the test reproduction info message
- Absolute Paths tried to be converted to relative paths relative to workspace
root to allow simply copy & paste
- Also fixes a inconsistency for checking license existence in x-pack plugin core build
  • Loading branch information
mushao999 committed Oct 28, 2024
1 parent 5205da6 commit 0230ef9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ public void testFailure(Failure failure) throws Exception {
String task = System.getProperty("tests.task");
// TODO: enforce (intellij still runs the runner?) or use default "test" but that won't work for integ
b.append("'" + task + "'");

GradleMessageBuilder gradleMessageBuilder = new GradleMessageBuilder(b);
gradleMessageBuilder.appendAllOpts(failure.getDescription());

Expand Down Expand Up @@ -159,6 +158,7 @@ public ReproduceErrorMessageBuilder appendESProperties() {
appendOpt("tests.distribution", System.getProperty("tests.distribution"));
appendOpt("compiler.java", System.getProperty("compiler.java"));
appendOpt("runtime.java", System.getProperty("runtime.java"));
appendOpt("license.key", System.getProperty("licence.key"));
appendOpt("javax.net.ssl.keyStorePassword", System.getProperty("javax.net.ssl.keyStorePassword"));
appendOpt("javax.net.ssl.trustStorePassword", System.getProperty("javax.net.ssl.trustStorePassword"));
return this;
Expand Down
5 changes: 3 additions & 2 deletions x-pack/plugin/core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,11 @@ processResources {
} else {
throw new IllegalArgumentException('Property license.key must be set for release build')
}
if (Files.exists(Paths.get(licenseKey)) == false) {
File licenseKeyFile = rootProject.file(licenseKey)
if (licenseKeyFile.exists() == false) {
throw new IllegalArgumentException('license.key at specified path [' + licenseKey + '] does not exist')
}
from(licenseKey) {
from(licenseKeyFile) {
rename { String filename -> 'public.key' }
}
}
Expand Down

0 comments on commit 0230ef9

Please sign in to comment.