Skip to content

Commit a3d918b

Browse files
committed
Refactor RepositoryCredentialsTests (#45919)
This commit refactors the S3 credentials tests in RepositoryCredentialsTests so that it now uses a single node (ESSingleNodeTestCase) to test how secure/insecure credentials are overriding each other. Using a single node makes it much easier to understand what each test is actually testing and IMO better reflect how things are initialized. It also allows to fold into this class the test testInsecureRepositoryCredentials which was wrongly located in S3BlobStoreRepositoryTests. By moving this test away, the S3BlobStoreRepositoryTests class does not need the allow_insecure_settings option anymore and thus can be executed as part of the usual gradle test task.
1 parent d96469d commit a3d918b

File tree

3 files changed

+227
-193
lines changed

3 files changed

+227
-193
lines changed

plugins/repository-s3/build.gradle

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,13 @@ bundlePlugin {
6767

6868
task testRepositoryCreds(type: Test) {
6969
include '**/RepositoryCredentialsTests.class'
70-
include '**/S3BlobStoreRepositoryTests.class'
7170
systemProperty 'es.allow_insecure_settings', 'true'
7271
}
7372
check.dependsOn(testRepositoryCreds)
7473

7574
test {
7675
// these are tested explicitly in separate test tasks
77-
exclude '**/*CredentialsTests.class'
78-
exclude '**/S3BlobStoreRepositoryTests.class'
76+
exclude '**/RepositoryCredentialsTests.class'
7977
exclude '**/S3RepositoryThirdPartyTests.class'
8078
}
8179

0 commit comments

Comments
 (0)