Remove Minio Host Hack in S3 Repository Build (#44491) (#44497)

* Resolving the todo to clean this hackyness up
This commit is contained in:
Armin Braun 2019-07-17 19:59:00 +02:00 committed by GitHub
parent c8b66c549d
commit 65fcaecce1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 18 deletions

View File

@ -167,8 +167,6 @@ if (useFixture) {
'http://127.0.0.1:' + minioPort
}
File minioAddressFile = new File(project.buildDir, 'generated-resources/s3Fixture.address')
normalization {
runtimeClasspath {
// ignore generated address file for the purposes of build avoidance
@ -178,12 +176,7 @@ if (useFixture) {
thirdPartyTest {
dependsOn tasks.bundlePlugin, tasks.postProcessFixture
outputs.file(minioAddressFile)
doFirst {
file(minioAddressFile).text = "${ -> minioAddress.call() }"
}
// TODO: this could be a nonInputProperties.systemProperty so we don't need a file
systemProperty 'test.s3.endpoint', minioAddressFile.name
nonInputProperties.systemProperty 'test.s3.endpoint', "${ -> minioAddress.call() }"
}
task integTestMinio(type: RestIntegTestTask) {

View File

@ -27,12 +27,10 @@ import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.plugins.Plugin;
import org.elasticsearch.repositories.AbstractThirdPartyRepositoryTestCase;
import org.elasticsearch.repositories.blobstore.BlobStoreRepository;
import org.elasticsearch.test.StreamsUtils;
import java.io.IOException;
import java.util.Collection;
import java.util.concurrent.Executor;
import java.util.Map;
import java.util.concurrent.Executor;
import java.util.concurrent.TimeUnit;
import static org.hamcrest.Matchers.blankOrNullString;
@ -63,13 +61,9 @@ public class S3RepositoryThirdPartyTests extends AbstractThirdPartyRepositoryTes
Settings.Builder settings = Settings.builder()
.put("bucket", System.getProperty("test.s3.bucket"))
.put("base_path", System.getProperty("test.s3.base", "testpath"));
final String endpointPath = System.getProperty("test.s3.endpoint");
if (endpointPath != null) {
try {
settings = settings.put("endpoint", StreamsUtils.copyToStringFromClasspath("/" + endpointPath));
} catch (IOException e) {
throw new AssertionError(e);
}
final String endpoint = System.getProperty("test.s3.endpoint");
if (endpoint != null) {
settings = settings.put("endpoint", endpoint);
}
AcknowledgedResponse putRepositoryResponse = client().admin().cluster().preparePutRepository("test-repo")
.setType("s3")