Skip to content

Commit

Permalink
Fix :integ-test:sqlBwcCluster#fullRestartClusterTask on 2.x (#2900) (#…
Browse files Browse the repository at this point in the history
…2996)

* Fix :integ-test:sqlBwcCluster#fullRestartClusterTask on 2.x



* Test fix



---------


(cherry picked from commit 87564d2)

Signed-off-by: Louis Chu <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
1 parent 1cd4099 commit 9683ff6
Showing 1 changed file with 26 additions and 19 deletions.
45 changes: 26 additions & 19 deletions integ-test/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -137,17 +137,7 @@ ext {
}

bwcFilePath = "src/test/resources/bwc/"
bwcMinVersion = "1.1.0.0"
bwcBundleVersion = "1.3.2.0"
bwcBundleTest = (project.findProperty('customDistributionDownloadType') != null &&
project.properties['customDistributionDownloadType'] == "bundle");
bwcVersion = bwcBundleTest ? bwcBundleVersion : bwcMinVersion
// Create bwcVersionShort without the last digit
bwcVersionShort = bwcVersion.substring(0, bwcVersion.lastIndexOf('.'))

bwcOpenSearchJSDownload = 'https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/' + bwcVersionShort + '/latest/linux/x64/tar/builds/' +
'opensearch/plugins/opensearch-job-scheduler-' + bwcVersion + '.zip'
bwcJobSchedulerPath = bwcFilePath + "job-scheduler/"
bwcJSPluginPath = bwcFilePath + "job-scheduler/"
}

tasks.withType(licenseHeaders.class) {
Expand Down Expand Up @@ -198,7 +188,6 @@ dependencies {
testImplementation group: 'com.google.code.gson', name: 'gson', version: '2.8.9'
testCompileOnly 'org.apiguardian:apiguardian-api:1.1.2'

// Needed for BWC tests
zipArchive group: 'org.opensearch.plugin', name:'opensearch-job-scheduler', version: "${opensearch_build}"
}

Expand Down Expand Up @@ -519,10 +508,18 @@ task comparisonTest(type: RestIntegTestTask) {
systemProperty "queries", System.getProperty("queries")
}

String bwcMinVersion = "1.1.0.0"
String bwcBundleVersion = "1.3.2.0"
Boolean bwcBundleTest = (project.findProperty('customDistributionDownloadType') != null &&
project.properties['customDistributionDownloadType'] == "bundle");
String bwcVersion = bwcBundleTest ? bwcBundleVersion : bwcMinVersion
String currentVersion = opensearch_version.replace("-SNAPSHOT","")
String baseName = "sqlBwcCluster"
String bwcSqlPlugin = "opensearch-sql-" + bwcVersion + ".zip"
String bwcRemoteFile = "https://ci.opensearch.org/ci/dbc/bundle-build/1.1.0/20210930/linux/x64/builds/opensearch/plugins/" + bwcSqlPlugin
String bwcJSPlugin = "opensearch-job-scheduler-" + bwcVersion + ".zip"
String bwcRemoteFileRoot = "https://ci.opensearch.org/ci/dbc/bundle-build/1.1.0/20210930/linux/x64/builds/opensearch/plugins/"
String bwcRemoteFileSqlPlugin = bwcRemoteFileRoot + bwcSqlPlugin
String bwcRemoteFileJSPlugin = bwcRemoteFileRoot + bwcJSPlugin

2.times { i ->
testClusters {
Expand Down Expand Up @@ -566,11 +563,11 @@ String bwcRemoteFile = "https://ci.opensearch.org/ci/dbc/bundle-build/1.1.0/2021
if (new File("$project.rootDir/$bwcFilePath/job-scheduler/$bwcVersion").exists()) {
project.delete(files("$project.rootDir/$bwcFilePath/job-scheduler/$bwcVersion"))
}
project.mkdir bwcJobSchedulerPath + bwcVersion
ant.get(src: bwcOpenSearchJSDownload,
dest: bwcJobSchedulerPath + bwcVersion,
project.mkdir bwcJSPluginPath + bwcVersion
ant.get(src: bwcRemoteFileJSPlugin,
dest: bwcJSPluginPath + bwcVersion,
httpusecaches: false)
return fileTree(bwcJobSchedulerPath + bwcVersion).getSingleFile()
return fileTree(bwcJSPluginPath + bwcVersion).getSingleFile()
}
}
}
Expand All @@ -587,7 +584,7 @@ String bwcRemoteFile = "https://ci.opensearch.org/ci/dbc/bundle-build/1.1.0/2021
}
File f = new File(dir, bwcSqlPlugin)
if (!f.exists()) {
new URL(bwcRemoteFile).withInputStream{ ins -> f.withOutputStream{ it << ins }}
new URL(bwcRemoteFileSqlPlugin).withInputStream{ ins -> f.withOutputStream{ it << ins }}
}
return fileTree(bwcFilePath + bwcVersion).getSingleFile()
}
Expand All @@ -602,7 +599,17 @@ String bwcRemoteFile = "https://ci.opensearch.org/ci/dbc/bundle-build/1.1.0/2021
}

List<Provider<RegularFile>> plugins = [
getJobSchedulerPlugin(),
provider(new Callable<RegularFile>(){
@Override
RegularFile call() throws Exception {
return new RegularFile() {
@Override
File getAsFile() {
return configurations.zipArchive.asFileTree.getSingleFile()
}
}
}
}),
provider(new Callable<RegularFile>() {
@Override
RegularFile call() throws Exception {
Expand Down

0 comments on commit 9683ff6

Please sign in to comment.