Skip to content

Commit

Permalink
Show -Dlicense.key value in test repro info (#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
breskeby authored Dec 12, 2020
1 parent 0e8e02f commit 2b2b8a3
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 @@ -102,7 +102,6 @@ public void testFailure(Failure failure) throws Exception {
}
}
b.append("\"");

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

Expand Down Expand Up @@ -181,6 +180,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
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,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 2b2b8a3

Please sign in to comment.