|
16 | 16 | import org.elasticsearch.common.regex.Regex; |
17 | 17 | import org.elasticsearch.common.settings.Settings; |
18 | 18 | import org.elasticsearch.common.unit.ByteSizeValue; |
| 19 | +import org.elasticsearch.core.Booleans; |
19 | 20 | import org.elasticsearch.test.cluster.ElasticsearchCluster; |
20 | 21 | import org.elasticsearch.test.cluster.local.distribution.DistributionType; |
21 | 22 |
|
|
26 | 27 | import static org.hamcrest.Matchers.not; |
27 | 28 |
|
28 | 29 | public abstract class AbstractS3RepositoryAnalysisRestTestCase extends AbstractRepositoryAnalysisRestTestCase { |
| 30 | + |
| 31 | + static final boolean USE_FIXTURE = Booleans.parseBoolean(System.getProperty("tests.use.fixture", "true")); |
| 32 | + |
29 | 33 | protected static final Supplier<String> regionSupplier = new DynamicRegionSupplier(); |
30 | 34 |
|
31 | 35 | protected static class RepositoryAnalysisHttpFixture extends S3HttpFixture { |
32 | | - RepositoryAnalysisHttpFixture(boolean enabled) { |
33 | | - super(enabled, "bucket", "base_path_integration_tests", fixedAccessKey("s3_test_access_key", regionSupplier, "s3")); |
| 36 | + RepositoryAnalysisHttpFixture() { |
| 37 | + super(USE_FIXTURE, "bucket", "base_path_integration_tests", fixedAccessKey("s3_test_access_key", regionSupplier, "s3")); |
34 | 38 | } |
35 | 39 |
|
36 | 40 | private volatile boolean repoAnalysisStarted; |
@@ -70,16 +74,16 @@ private void ensurePurposeParameterPresent(S3HttpHandler.S3Request request) { |
70 | 74 |
|
71 | 75 | protected static final String CLIENT_NAME = "repo_test_kit"; |
72 | 76 |
|
73 | | - protected static ElasticsearchCluster buildCluster(S3HttpFixture s3HttpFixture, boolean enabled) { |
| 77 | + protected static ElasticsearchCluster buildCluster(S3HttpFixture s3HttpFixture) { |
74 | 78 | final var clientPrefix = "s3.client." + CLIENT_NAME + "."; |
75 | 79 | return ElasticsearchCluster.local() |
76 | 80 | .distribution(DistributionType.DEFAULT) |
77 | 81 | .keystore(clientPrefix + "access_key", System.getProperty("s3AccessKey")) |
78 | 82 | .keystore(clientPrefix + "secret_key", System.getProperty("s3SecretKey")) |
79 | | - .setting(clientPrefix + "protocol", () -> "http", (n) -> enabled) |
80 | | - .setting(clientPrefix + "region", regionSupplier, (n) -> enabled) |
| 83 | + .setting(clientPrefix + "protocol", () -> "http", n -> USE_FIXTURE) |
| 84 | + .setting(clientPrefix + "region", regionSupplier, n -> USE_FIXTURE) |
81 | 85 | .setting(clientPrefix + "add_purpose_custom_query_parameter", () -> randomFrom("true", "false"), n -> randomBoolean()) |
82 | | - .setting(clientPrefix + "endpoint", s3HttpFixture::getAddress, (n) -> enabled) |
| 86 | + .setting(clientPrefix + "endpoint", s3HttpFixture::getAddress, n -> USE_FIXTURE) |
83 | 87 | .setting( |
84 | 88 | "repository_s3.compare_and_exchange.anti_contention_delay", |
85 | 89 | () -> randomFrom("1s" /* == default */, "1ms"), |
|
0 commit comments