Skip to content

Commit

Permalink
Refactor RepositoryCredentialsTests (#45919)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
tlrx committed Aug 26, 2019
1 parent d96469d commit a3d918b
Show file tree
Hide file tree
Showing 3 changed files with 227 additions and 193 deletions.
4 changes: 1 addition & 3 deletions plugins/repository-s3/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,13 @@ bundlePlugin {

task testRepositoryCreds(type: Test) {
include '**/RepositoryCredentialsTests.class'
include '**/S3BlobStoreRepositoryTests.class'
systemProperty 'es.allow_insecure_settings', 'true'
}
check.dependsOn(testRepositoryCreds)

test {
// these are tested explicitly in separate test tasks
exclude '**/*CredentialsTests.class'
exclude '**/S3BlobStoreRepositoryTests.class'
exclude '**/RepositoryCredentialsTests.class'
exclude '**/S3RepositoryThirdPartyTests.class'
}

Expand Down
Loading

0 comments on commit a3d918b

Please sign in to comment.