Skip to content

Commit 6186ccf

Browse files
authored
[Tests] Fix third party tests with Gradle 5.0 (#36302)
* [Tests] Fix third party tests with Gradle 5.0 * apply feedback
1 parent f5fa1f4 commit 6186ccf

File tree

3 files changed

+37
-9
lines changed

3 files changed

+37
-9
lines changed

plugins/repository-gcs/qa/google-cloud-storage/src/test/resources/rest-api-spec/test/repository_gcs/10_repository.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,19 @@ setup:
1313
client: "integration_test"
1414
base_path: "${base_path}"
1515

16+
# Remove the snapshots, if a previous test failed to delete them. This is
17+
# useful for third party tests that runs the test against a real external service.
18+
- do:
19+
snapshot.delete:
20+
repository: repository
21+
snapshot: snapshot-one
22+
ignore: 404
23+
- do:
24+
snapshot.delete:
25+
repository: repository
26+
snapshot: snapshot-two
27+
ignore: 404
28+
1629
---
1730
"Snapshot/Restore with repository-gcs":
1831

plugins/repository-s3/build.gradle

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -106,20 +106,12 @@ String s3ECSBasePath = System.getenv("amazon_s3_base_path_ecs")
106106
// If all these variables are missing then we are testing against the internal fixture instead, which has the following
107107
// credentials hard-coded in.
108108

109-
if (!s3PermanentAccessKey && !s3PermanentSecretKey && !s3PermanentBucket && !s3PermanentBasePath
110-
&& !s3EC2Bucket && !s3EC2BasePath
111-
&& !s3ECSBucket && !s3ECSBasePath) {
109+
if (!s3PermanentAccessKey && !s3PermanentSecretKey && !s3PermanentBucket && !s3PermanentBasePath) {
112110
s3PermanentAccessKey = 's3_integration_test_permanent_access_key'
113111
s3PermanentSecretKey = 's3_integration_test_permanent_secret_key'
114112
s3PermanentBucket = 'permanent-bucket-test'
115113
s3PermanentBasePath = 'integration_test'
116114

117-
s3EC2Bucket = 'ec2-bucket-test'
118-
s3EC2BasePath = 'integration_test'
119-
120-
s3ECSBucket = 'ecs-bucket-test'
121-
s3ECSBasePath = 'integration_test'
122-
123115
useFixture = true
124116

125117
} else if (!s3PermanentAccessKey || !s3PermanentSecretKey || !s3PermanentBucket || !s3PermanentBasePath) {
@@ -137,6 +129,16 @@ if (!s3TemporaryAccessKey && !s3TemporarySecretKey && !s3TemporaryBucket && !s3T
137129
throw new IllegalArgumentException("not all options specified to run against external S3 service as temporary credentials are present")
138130
}
139131

132+
if (!s3EC2Bucket && !s3EC2BasePath && !s3ECSBucket && !s3ECSBasePath) {
133+
s3EC2Bucket = 'ec2-bucket-test'
134+
s3EC2BasePath = 'integration_test'
135+
s3ECSBucket = 'ecs-bucket-test'
136+
s3ECSBasePath = 'integration_test'
137+
} else if (!s3EC2Bucket || !s3EC2BasePath || !s3ECSBucket || !s3ECSBasePath) {
138+
throw new IllegalArgumentException("not all options specified to run EC2/ECS tests are present")
139+
}
140+
141+
140142
final String minioVersion = 'RELEASE.2018-06-22T23-48-46Z'
141143
final String minioBinDir = "${buildDir}/minio/bin"
142144
final String minioDataDir = "${buildDir}/minio/data"

plugins/repository-s3/src/test/resources/rest-api-spec/test/repository_s3/20_repository_permanent_credentials.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,19 @@ setup:
1616
canned_acl: private
1717
storage_class: standard
1818

19+
# Remove the snapshots, if a previous test failed to delete them. This is
20+
# useful for third party tests that runs the test against a real external service.
21+
- do:
22+
snapshot.delete:
23+
repository: repository_permanent
24+
snapshot: snapshot-one
25+
ignore: 404
26+
- do:
27+
snapshot.delete:
28+
repository: repository_permanent
29+
snapshot: snapshot-two
30+
ignore: 404
31+
1932
---
2033
"Snapshot and Restore with repository-s3 using permanent credentials":
2134

0 commit comments

Comments
 (0)