Skip to content

Commit

Permalink
Fix bwcTests to point to correct 2.x version. (#564)
Browse files Browse the repository at this point in the history
This change also removes the requirement to commit plugin zips to the repo and downloads them on demand.

Signed-off-by: Marc Handalian <[email protected]>
Signed-off-by: Marc Handalian <[email protected]>
  • Loading branch information
mch2 authored Apr 30, 2024
1 parent 6a00f98 commit b014140
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ buildscript {
opensearch_group = "org.opensearch"
isSnapshot = "true" == System.getProperty("build.snapshot", "true")
opensearch_version = System.getProperty("opensearch.version", "3.0.0-SNAPSHOT")
opensearch_plugin_version = System.getProperty("bwc.version", "2.12.0.0")
buildVersionQualifier = System.getProperty("build.version_qualifier", "")
// 2.0.0-rc1-SNAPSHOT -> 2.0.0.0-rc1-SNAPSHOT
version_tokens = opensearch_version.tokenize('-')
opensearch_build = version_tokens[0] + '.0'
if (buildVersionQualifier) {
Expand Down Expand Up @@ -261,11 +259,10 @@ ext.getPluginResource = { download_to_folder, download_from_src ->
}

String baseName = "asynSearchCluster"
String bwcVersionShort = "2.12.0"
String bwcVersionShort = "2.14.0"
String bwcVersion = bwcVersionShort + ".0"
String bwcFilePath = "src/test/resources/org/opensearch/search/asynchronous/bwc/"
String bwcRemoteFile = "https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/"+ bwcVersionShort + "/latest/linux/x64/tar/builds/opensearch/plugins/opensearch-asynchronous-search-"+ bwcVersion +".zip"
//getPluginResource(bwcFilePath + bwcVersion, bwcRemoteFile)
// Creates two test clusters of previous version and loads opensearch plugin of bwcVersion
2.times { i ->
testClusters {
Expand All @@ -279,7 +276,11 @@ String bwcRemoteFile = "https://ci.opensearch.org/ci/dbc/distribution-build-open
return new RegularFile() {
@Override
File getAsFile() {
return fileTree(bwcFilePath + opensearch_plugin_version).getSingleFile()
if (new File(bwcFilePath + bwcVersion).exists()) {
project.delete(files(bwcFilePath + bwcVersion))
}
getPluginResource(bwcFilePath + bwcVersion, bwcRemoteFile)
return fileTree(bwcFilePath + bwcVersion).getSingleFile()
}
}
}
Expand Down

0 comments on commit b014140

Please sign in to comment.