Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Sep 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading