From 27e2d9d7b07c93aaa6f01eb145c3ed032acbb46b Mon Sep 17 00:00:00 2001 From: Tanguy Leroux Date: Mon, 26 Nov 2018 16:31:29 +0100 Subject: [PATCH 1/2] [Tests] Fix third party tests with Gradle 5.0 --- .../test/repository_gcs/10_repository.yml | 13 +++++++++++++ plugins/repository-s3/build.gradle | 17 ++++++++--------- .../20_repository_permanent_credentials.yml | 13 +++++++++++++ 3 files changed, 34 insertions(+), 9 deletions(-) diff --git a/plugins/repository-gcs/qa/google-cloud-storage/src/test/resources/rest-api-spec/test/repository_gcs/10_repository.yml b/plugins/repository-gcs/qa/google-cloud-storage/src/test/resources/rest-api-spec/test/repository_gcs/10_repository.yml index bb8f148fc8ab1..ac649229001db 100644 --- a/plugins/repository-gcs/qa/google-cloud-storage/src/test/resources/rest-api-spec/test/repository_gcs/10_repository.yml +++ b/plugins/repository-gcs/qa/google-cloud-storage/src/test/resources/rest-api-spec/test/repository_gcs/10_repository.yml @@ -13,6 +13,19 @@ setup: client: "integration_test" base_path: "${base_path}" + # Remove the snapshots, if a previous test failed to delete them. This is + # useful for third party tests that runs the test against a real external service. + - do: + snapshot.delete: + repository: repository + snapshot: snapshot-one + ignore: 404 + - do: + snapshot.delete: + repository: repository + snapshot: snapshot-two + ignore: 404 + --- "Snapshot/Restore with repository-gcs": diff --git a/plugins/repository-s3/build.gradle b/plugins/repository-s3/build.gradle index 48c2a9e6ff1ff..84ede08e39297 100644 --- a/plugins/repository-s3/build.gradle +++ b/plugins/repository-s3/build.gradle @@ -106,20 +106,12 @@ String s3ECSBasePath = System.getenv("amazon_s3_base_path_ecs") // If all these variables are missing then we are testing against the internal fixture instead, which has the following // credentials hard-coded in. -if (!s3PermanentAccessKey && !s3PermanentSecretKey && !s3PermanentBucket && !s3PermanentBasePath - && !s3EC2Bucket && !s3EC2BasePath - && !s3ECSBucket && !s3ECSBasePath) { +if (!s3PermanentAccessKey && !s3PermanentSecretKey && !s3PermanentBucket && !s3PermanentBasePath) { s3PermanentAccessKey = 's3_integration_test_permanent_access_key' s3PermanentSecretKey = 's3_integration_test_permanent_secret_key' s3PermanentBucket = 'permanent-bucket-test' s3PermanentBasePath = 'integration_test' - s3EC2Bucket = 'ec2-bucket-test' - s3EC2BasePath = 'integration_test' - - s3ECSBucket = 'ecs-bucket-test' - s3ECSBasePath = 'integration_test' - useFixture = true } else if (!s3PermanentAccessKey || !s3PermanentSecretKey || !s3PermanentBucket || !s3PermanentBasePath) { @@ -137,6 +129,13 @@ if (!s3TemporaryAccessKey && !s3TemporarySecretKey && !s3TemporaryBucket && !s3T 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-test' + s3EC2BasePath = 'integration_test' + s3ECSBucket = 'ecs-bucket-test' + s3ECSBasePath = 'integration_test' +} + final String minioVersion = 'RELEASE.2018-06-22T23-48-46Z' final String minioBinDir = "${buildDir}/minio/bin" final String minioDataDir = "${buildDir}/minio/data" diff --git a/plugins/repository-s3/src/test/resources/rest-api-spec/test/repository_s3/20_repository_permanent_credentials.yml b/plugins/repository-s3/src/test/resources/rest-api-spec/test/repository_s3/20_repository_permanent_credentials.yml index 275b1fcedd066..1c64b66be3ad2 100644 --- a/plugins/repository-s3/src/test/resources/rest-api-spec/test/repository_s3/20_repository_permanent_credentials.yml +++ b/plugins/repository-s3/src/test/resources/rest-api-spec/test/repository_s3/20_repository_permanent_credentials.yml @@ -16,6 +16,19 @@ setup: canned_acl: private storage_class: standard + # Remove the snapshots, if a previous test failed to delete them. This is + # useful for third party tests that runs the test against a real external service. + - do: + snapshot.delete: + repository: repository_permanent + snapshot: snapshot-one + ignore: 404 + - do: + snapshot.delete: + repository: repository_permanent + snapshot: snapshot-two + ignore: 404 + --- "Snapshot and Restore with repository-s3 using permanent credentials": From bc3c26b72742ad29a95077f0c514e687a139c4bf Mon Sep 17 00:00:00 2001 From: Tanguy Leroux Date: Mon, 26 Nov 2018 16:31:29 +0100 Subject: [PATCH 2/2] apply feedback --- plugins/repository-s3/build.gradle | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/repository-s3/build.gradle b/plugins/repository-s3/build.gradle index 84ede08e39297..fb01fa0a71fda 100644 --- a/plugins/repository-s3/build.gradle +++ b/plugins/repository-s3/build.gradle @@ -134,8 +134,11 @@ if (!s3EC2Bucket && !s3EC2BasePath && !s3ECSBucket && !s3ECSBasePath) { s3EC2BasePath = 'integration_test' s3ECSBucket = 'ecs-bucket-test' s3ECSBasePath = 'integration_test' +} else if (!s3EC2Bucket || !s3EC2BasePath || !s3ECSBucket || !s3ECSBasePath) { + throw new IllegalArgumentException("not all options specified to run EC2/ECS tests are present") } + final String minioVersion = 'RELEASE.2018-06-22T23-48-46Z' final String minioBinDir = "${buildDir}/minio/bin" final String minioDataDir = "${buildDir}/minio/data"