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,41 +49,17 @@ 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
- testFixtures.useFixture()
60
-
61
- task writeDockerFile {
62
- File minioDockerfile = new File("${project.buildDir}/minio-docker/Dockerfile")
63
- outputs.file(minioDockerfile)
64
- doLast {
65
- minioDockerfile.parentFile.mkdirs()
66
- minioDockerfile.text =
67
- "FROM minio/minio:RELEASE.2019-01-23T23-18-58Z\n" +
68
- "RUN mkdir -p /minio/data/${s3PermanentBucket}\n" +
69
- "ENV MINIO_ACCESS_KEY ${s3PermanentAccessKey}\n" +
70
- "ENV MINIO_SECRET_KEY ${s3PermanentSecretKey}"
71
- }
72
- }
73
-
74
- preProcessFixture {
75
- dependsOn(writeDockerFile)
76
- }
53
+ testFixtures. useFixture(' :test:fixtures:minio-fixture' , " minio-fixture-for-snapshot-tool" )
77
54
78
55
def minioAddress = {
79
- int minioPort = postProcessFixture.ext."test.fixtures.minio-fixture.tcp.9000"
56
+ int minioPort = project( ' :test:fixtures:minio-fixture ' ) . postProcessFixture. ext. " test.fixtures.minio-fixture-for-snapshot-tool .tcp.9000"
80
57
assert minioPort > 0
81
58
' http://127.0.0.1:' + minioPort
82
59
}
83
60
84
61
thirdPartyTest {
85
- dependsOn tasks .postProcessFixture
62
+ dependsOn project( ' :test:fixtures:minio-fixture ' ) . postProcessFixture
86
63
nonInputProperties. systemProperty ' test.s3.endpoint' , " ${ -> minioAddress.call()} "
87
64
}
88
65
@@ -91,7 +68,7 @@ if (useS3Fixture) {
91
68
throw new IllegalStateException (" Tried to run third party tests but not all of the necessary environment variables 'amazon_s3_access_key', " +
92
69
" 'amazon_s3_secret_key', 'amazon_s3_bucket', and 'amazon_s3_base_path' are set." );
93
70
}
94
- }*/
71
+ }
95
72
}
96
73
97
74
check. dependsOn(thirdPartyTest)
0 commit comments