4
4
* you may not use this file except in compliance with the Elastic License.
5
5
*/
6
6
apply plugin : ' elasticsearch.build'
7
+ apply plugin : ' elasticsearch.test.fixtures'
7
8
8
9
dependencies {
9
10
compile project(" :plugins:repository-s3" )
@@ -26,9 +27,9 @@ String s3PermanentBucket = System.getenv("amazon_s3_bucket")
26
27
String s3PermanentBasePath = System . getenv(" amazon_s3_base_path" )
27
28
28
29
if (! s3PermanentAccessKey && ! s3PermanentSecretKey && ! s3PermanentBucket && ! s3PermanentBasePath) {
29
- s3PermanentAccessKey = ' s3_integration_test_permanent_access_key '
30
- s3PermanentSecretKey = ' s3_integration_test_permanent_secret_key '
31
- s3PermanentBucket = ' permanent- bucket-test '
30
+ s3PermanentAccessKey = ' sn_tool_access_key '
31
+ s3PermanentSecretKey = ' sn_tool_secret_key '
32
+ s3PermanentBucket = ' bucket'
32
33
s3PermanentBasePath = ' integration_test'
33
34
34
35
useS3Fixture = true
@@ -48,48 +49,26 @@ task thirdPartyTest(type: Test) {
48
49
}
49
50
50
51
if (useS3Fixture) {
51
- thirdPartyTest. enabled = false ;
52
52
testingConventions. enabled = false ;
53
- /*
54
-
55
- See: https://github.com/elastic/elasticsearch/issues/46813 Fails with --parallel
56
-
57
- apply plugin: 'elasticsearch.test.fixtures'
58
-
59
- task writeDockerFile {
60
- File minioDockerfile = new File("${project.buildDir}/minio-docker/Dockerfile")
61
- outputs.file(minioDockerfile)
62
- doLast {
63
- minioDockerfile.parentFile.mkdirs()
64
- minioDockerfile.text =
65
- "FROM minio/minio:RELEASE.2019-01-23T23-18-58Z\n" +
66
- "RUN mkdir -p /minio/data/${s3PermanentBucket}\n" +
67
- "ENV MINIO_ACCESS_KEY ${s3PermanentAccessKey}\n" +
68
- "ENV MINIO_SECRET_KEY ${s3PermanentSecretKey}"
69
- }
70
- }
71
-
72
- preProcessFixture {
73
- dependsOn(writeDockerFile)
74
- }
53
+ testFixtures. useFixture(' :test:fixtures:minio-fixture' , " minio-fixture-for-snapshot-tool" )
75
54
76
55
def minioAddress = {
77
- int minioPort = postProcessFixture.ext."test.fixtures.minio-fixture.tcp.9000"
78
- assert minioPort > 0
79
- 'http://127.0.0.1:' + minioPort
56
+ int minioPort = project( ' :test:fixtures:minio-fixture ' ) . postProcessFixture. ext. " test.fixtures.minio-fixture-for-snapshot-tool .tcp.9000"
57
+ assert minioPort > 0
58
+ ' http://127.0.0.1:' + minioPort
80
59
}
81
60
82
61
thirdPartyTest {
83
- dependsOn tasks .postProcessFixture
84
- nonInputProperties.systemProperty 'test.s3.endpoint', "${ -> minioAddress.call() }"
62
+ dependsOn project( ' :test:fixtures:minio-fixture ' ) . postProcessFixture
63
+ nonInputProperties. systemProperty ' test.s3.endpoint' , " ${ -> minioAddress.call()} "
85
64
}
86
65
87
66
gradle. taskGraph. whenReady {
88
- if (it.hasTask(s3ThirdPartyTests)) {
89
- throw new IllegalStateException("Tried to run third party tests but not all of the necessary environment variables 'amazon_s3_access_key', " +
90
- "'amazon_s3_secret_key', 'amazon_s3_bucket', and 'amazon_s3_base_path' are set.");
91
- }
92
- }*/
67
+ if (it. hasTask(s3ThirdPartyTests)) {
68
+ throw new IllegalStateException (" Tried to run third party tests but not all of the necessary environment variables 'amazon_s3_access_key', " +
69
+ " 'amazon_s3_secret_key', 'amazon_s3_bucket', and 'amazon_s3_base_path' are set." );
70
+ }
71
+ }
93
72
}
94
73
95
74
check. dependsOn(thirdPartyTest)
0 commit comments