Skip to content

Commit

Permalink
Show -Dlicense.key value in test repro info (#66179) (#89404)
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
breskeby committed Aug 17, 2022
1 parent de01d4b commit 6002a5e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Expand Up @@ -89,7 +89,6 @@ public void testFailure(Failure failure) throws Exception {
}
}
b.append("\"");

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

Expand Down Expand Up @@ -171,6 +170,7 @@ private ReproduceErrorMessageBuilder appendESProperties() {
appendOpt("tests.timezone", TimeZone.getDefault().getID());
appendOpt("tests.distribution", System.getProperty("tests.distribution"));
appendOpt("runtime.java", Integer.toString(JavaVersion.current().getVersion().get(0)));
appendOpt("license.key", System.getProperty("licence.key"));
appendOpt(ESTestCase.FIPS_SYSPROP, System.getProperty(ESTestCase.FIPS_SYSPROP));
return this;
}
Expand Down
5 changes: 3 additions & 2 deletions x-pack/plugin/core/build.gradle
Expand Up @@ -86,10 +86,11 @@ tasks.named("processResources").configure {
} 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 6002a5e

Please sign in to comment.