Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
breskeby committed Nov 22, 2023
1 parent 2a7db19 commit 0d70671
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 15 deletions.
16 changes: 2 additions & 14 deletions modules/repository-s3/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -118,38 +118,25 @@ if (!s3PermanentAccessKey && !s3PermanentSecretKey && !s3PermanentBucket && !s3P
s3PermanentSecretKey = 's3_test_secret_key'
s3PermanentBucket = 'bucket'
s3PermanentBasePath = 'base_path'

useFixture = true

} else if (!s3PermanentAccessKey || !s3PermanentSecretKey || !s3PermanentBucket || !s3PermanentBasePath) {
throw new IllegalArgumentException("not all options specified to run against external S3 service as permanent credentials are present")
}

if (!s3TemporaryAccessKey && !s3TemporarySecretKey && !s3TemporaryBucket && !s3TemporaryBasePath && !s3TemporarySessionToken) {
s3TemporaryAccessKey = 'session_token_access_key'
s3TemporarySecretKey = 'session_token_secret_key'
s3TemporaryBucket = 'session_token_bucket'
s3TemporaryBasePath = 'session_token_base_path'
s3TemporarySessionToken = 'session_token'

} else if (!s3TemporaryAccessKey || !s3TemporarySecretKey || !s3TemporaryBucket || !s3TemporaryBasePath || !s3TemporarySessionToken) {
throw new IllegalArgumentException("not all options specified to run against external S3 service as temporary credentials are present")
}

if (!s3EC2Bucket && !s3EC2BasePath && !s3ECSBucket && !s3ECSBasePath) {
s3EC2Bucket = 'ec2_bucket'
s3EC2BasePath = 'ec2_base_path'
s3ECSBucket = 'ecs_bucket'
s3ECSBasePath = 'ecs_base_path'
} else if (!s3EC2Bucket || !s3EC2BasePath || !s3ECSBucket || !s3ECSBasePath) {
throw new IllegalArgumentException("not all options specified to run EC2/ECS tests are present")
}

if (!s3STSBucket && !s3STSBasePath) {
s3STSBucket = 'sts_bucket'
s3STSBasePath = 'sts_base_path'
} else if (!s3STSBucket || !s3STSBasePath) {
throw new IllegalArgumentException("not all options specified to run STS tests are present")
}

tasks.named("processYamlRestTestResources").configure {
Expand Down Expand Up @@ -179,7 +166,6 @@ tasks.named("internalClusterTest").configure {
}

tasks.named("yamlRestTest").configure {
systemProperty("tests.use.fixture", Boolean.toString(useFixture))
systemProperty("s3PermanentAccessKey", s3PermanentAccessKey)
systemProperty("s3PermanentSecretKey", s3PermanentSecretKey)
systemProperty("s3TemporaryAccessKey", s3TemporaryAccessKey)
Expand All @@ -201,6 +187,8 @@ tasks.register("s3ThirdPartyTest", Test) {
setTestClassesDirs(internalTestSourceSet.getOutput().getClassesDirs())
setClasspath(internalTestSourceSet.getRuntimeClasspath())
include '**/S3RepositoryThirdPartyTests.class'
systemProperty("tests.use.fixture", Boolean.toString(useFixture))

// test container accesses ~/.testcontainers.properties read
systemProperty "tests.security.manager", "false"
systemProperty 'test.s3.account', s3PermanentAccessKey
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import org.elasticsearch.test.fixtures.minio.MinioTestContainer;
import org.elasticsearch.test.fixtures.testcontainers.TestContainersThreadFilter;
import org.elasticsearch.test.rest.yaml.ClientYamlTestCandidate;
import org.junit.BeforeClass;
import org.junit.ClassRule;
import org.junit.rules.RuleChain;
import org.junit.rules.TestRule;
Expand Down

0 comments on commit 0d70671

Please sign in to comment.