@@ -37,6 +37,11 @@ apply plugin: 'java'
3737apply plugin : ' io.freefair.lombok'
3838apply plugin : ' com.wiredforcode.spawn'
3939
40+ String baseVersion = " 2.7.0"
41+ String bwcVersion = baseVersion + " .0" ;
42+ String baseName = " sqlBwcCluster"
43+ String bwcFilePath = " src/test/resources/bwc/"
44+
4045repositories {
4146 mavenCentral()
4247 maven { url ' https://jitpack.io' }
@@ -75,6 +80,10 @@ configurations.all {
7580 resolutionStrategy. force " org.slf4j:slf4j-api:1.7.36"
7681}
7782
83+ configurations {
84+ zipArchive
85+ }
86+
7887dependencies {
7988 testImplementation group : ' org.opensearch.test' , name : ' framework' , version : " ${ opensearch_version} "
8089 testImplementation group : ' org.opensearch.client' , name : ' opensearch-rest-high-level-client' , version : " ${ opensearch_version} "
@@ -90,6 +99,9 @@ dependencies {
9099 testImplementation group : ' com.h2database' , name : ' h2' , version : ' 2.1.214'
91100 testImplementation group : ' org.xerial' , name : ' sqlite-jdbc' , version : ' 3.32.3.3'
92101 testImplementation group : ' com.google.code.gson' , name : ' gson' , version : ' 2.8.9'
102+
103+ // Needed for BWC tests
104+ zipArchive group : ' org.opensearch.plugin' , name :' opensearch-sql-plugin' , version : " ${ bwcVersion} -SNAPSHOT"
93105}
94106
95107dependencyLicenses. enabled = false
@@ -230,34 +242,21 @@ task comparisonTest(type: RestIntegTestTask) {
230242 systemProperty " queries" , System . getProperty(" queries" )
231243}
232244
233- String baseVersion = " 2.6.0"
234- String bwcVersion = baseVersion + " .0" ;
235- String baseName = " sqlBwcCluster"
236- String bwcFilePath = " src/test/resources/bwc/"
237- String bwcSqlPlugin = " opensearch-sql-" + bwcVersion + " .zip"
238- String bwcRemoteFile = " https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/${ baseVersion} /latest/linux/x64/tar/builds/opensearch/plugins/" + bwcSqlPlugin
239-
2402452. times { i ->
241246 testClusters {
242247 " ${ baseName} $i " {
243248 testDistribution = " ARCHIVE"
244249 versions = [baseVersion, opensearch_version]
245250 numberOfNodes = 3
246- plugin(provider(new Callable<RegularFile > () {
251+ plugin(provider(new Callable<RegularFile > (){
247252 @Override
248253 RegularFile call () throws Exception {
249254 return new RegularFile () {
250255 @Override
251256 File getAsFile () {
252- File dir = new File (' ./integ-test/' + bwcFilePath + bwcVersion)
253- if (! dir. exists()) {
254- dir. mkdirs()
255- }
256- File f = new File (dir, bwcSqlPlugin)
257- if (! f. exists()) {
258- new URL (bwcRemoteFile). withInputStream{ ins -> f. withOutputStream{ it << ins }}
259- }
260- return fileTree(bwcFilePath + bwcVersion). getSingleFile()
257+ return configurations. zipArchive. asFileTree. matching {
258+ include ' **/opensearch-sql-plugin*'
259+ }. singleFile
261260 }
262261 }
263262 }
0 commit comments