Skip to content

Commit

Permalink
bump bwc test version to 2.7 (opensearch-project#1415)
Browse files Browse the repository at this point in the history
Signed-off-by: Peng Huo <[email protected]>
Signed-off-by: Matthew Wells <[email protected]>
  • Loading branch information
penghuo authored and matthewryanwells committed Mar 10, 2023
1 parent a89b8cd commit 55653d8
Showing 1 changed file with 16 additions and 17 deletions.
33 changes: 16 additions & 17 deletions integ-test/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ apply plugin: 'java'
apply plugin: 'io.freefair.lombok'
apply plugin: 'com.wiredforcode.spawn'

String baseVersion = "2.7.0"
String bwcVersion = baseVersion + ".0";
String baseName = "sqlBwcCluster"
String bwcFilePath = "src/test/resources/bwc/"

repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
Expand Down Expand Up @@ -75,6 +80,10 @@ configurations.all {
resolutionStrategy.force "org.slf4j:slf4j-api:1.7.36"
}

configurations {
zipArchive
}

dependencies {
testImplementation group: 'org.opensearch.test', name: 'framework', version: "${opensearch_version}"
testImplementation group: 'org.opensearch.client', name: 'opensearch-rest-high-level-client', version: "${opensearch_version}"
Expand All @@ -90,6 +99,9 @@ dependencies {
testImplementation group: 'com.h2database', name: 'h2', version: '2.1.214'
testImplementation group: 'org.xerial', name: 'sqlite-jdbc', version: '3.32.3.3'
testImplementation group: 'com.google.code.gson', name: 'gson', version: '2.8.9'

// Needed for BWC tests
zipArchive group: 'org.opensearch.plugin', name:'opensearch-sql-plugin', version: "${bwcVersion}-SNAPSHOT"
}

dependencyLicenses.enabled = false
Expand Down Expand Up @@ -230,34 +242,21 @@ task comparisonTest(type: RestIntegTestTask) {
systemProperty "queries", System.getProperty("queries")
}

String baseVersion = "2.6.0"
String bwcVersion = baseVersion + ".0";
String baseName = "sqlBwcCluster"
String bwcFilePath = "src/test/resources/bwc/"
String bwcSqlPlugin = "opensearch-sql-" + bwcVersion + ".zip"
String bwcRemoteFile = "https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/${baseVersion}/latest/linux/x64/tar/builds/opensearch/plugins/" + bwcSqlPlugin

2.times { i ->
testClusters {
"${baseName}$i" {
testDistribution = "ARCHIVE"
versions = [baseVersion, opensearch_version]
numberOfNodes = 3
plugin(provider(new Callable<RegularFile>() {
plugin(provider(new Callable<RegularFile>(){
@Override
RegularFile call() throws Exception {
return new RegularFile() {
@Override
File getAsFile() {
File dir = new File('./integ-test/' + bwcFilePath + bwcVersion)
if (!dir.exists()) {
dir.mkdirs()
}
File f = new File(dir, bwcSqlPlugin)
if (!f.exists()) {
new URL(bwcRemoteFile).withInputStream{ ins -> f.withOutputStream{ it << ins }}
}
return fileTree(bwcFilePath + bwcVersion).getSingleFile()
return configurations.zipArchive.asFileTree.matching {
include '**/opensearch-sql-plugin*'
}.singleFile
}
}
}
Expand Down

0 comments on commit 55653d8

Please sign in to comment.