diff --git a/build.gradle b/build.gradle index 92cb6f19..22ed2c7e 100644 --- a/build.gradle +++ b/build.gradle @@ -213,7 +213,10 @@ task integTestRemote(type: RestIntegTestTask) { } String baseName = "asynSearchCluster" +String bwcVersion = "1.13.0.1" String bwcFilePath = "src/test/resources/org/opensearch/search/asynchronous/bwc/" +String bwcRemoteFile = "https://d3g5vo6xdbdb9a.cloudfront.net/downloads/elasticsearch-plugins/asynchronous-search/opendistro-asynchronous-search-1.13.0.1.zip" +String bwcOpenDistroPlugin = "opendistro-asynchronous-search-1.13.0.1.zip" // Creates two test clusters of previous version and loads opensearch plugin of bwcVersion 2.times { i -> @@ -228,6 +231,14 @@ String bwcFilePath = "src/test/resources/org/opensearch/search/asynchronous/bwc/ return new RegularFile() { @Override File getAsFile() { + File dir = new File(bwcFilePath + bwcVersion) + if (!dir.exists()) { + dir.mkdirs() + } + File f = new File(bwcOpenDistroPlugin, dir) + if (!f.exists()) { + new URL(bwcRemoteFile).withInputStream{ ins -> f.withOutputStream{ it << ins }} + } return fileTree(bwcFilePath + opendistro_plugin_version).getSingleFile() } } diff --git a/src/test/resources/org/opensearch/search/asynchronous/bwc/1.13.0.1/opendistro-asynchronous-search-1.13.0.1.zip b/src/test/resources/org/opensearch/search/asynchronous/bwc/1.13.0.1/opendistro-asynchronous-search-1.13.0.1.zip deleted file mode 100644 index fd401973..00000000 Binary files a/src/test/resources/org/opensearch/search/asynchronous/bwc/1.13.0.1/opendistro-asynchronous-search-1.13.0.1.zip and /dev/null differ