Skip to content

Commit

Permalink
CI: Eliminate redundant file wrapper (#3275)
Browse files Browse the repository at this point in the history
* Plugin file wrapper

Signed-off-by: Andy Kwok <[email protected]>
  • Loading branch information
andy-k-improving authored Jan 31, 2025
1 parent 3bf19ef commit a2cb2a3
Showing 1 changed file with 23 additions and 55 deletions.
78 changes: 23 additions & 55 deletions integ-test/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ ext {
cluster.setting name, value
}

cluster.plugin provider((Callable<RegularFile>) (() -> (RegularFile) (() -> downloadedSecurityPlugin)))
cluster.plugin provider { (RegularFile) (() -> downloadedSecurityPlugin )}
}

bwcOpenSearchJSDownload = 'https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/' + baseVersion + '/latest/linux/x64/tar/builds/' +
Expand Down Expand Up @@ -230,19 +230,11 @@ testClusters.all {
}

def getJobSchedulerPlugin() {
provider(new Callable<RegularFile>() {
@Override
RegularFile call() throws Exception {
return new RegularFile() {
@Override
File getAsFile() {
return configurations.zipArchive.asFileTree.matching {
include '**/opensearch-job-scheduler*'
}.singleFile
}
}
}
})
provider { (RegularFile) (() ->
configurations.zipArchive.asFileTree.matching {
include '**/opensearch-job-scheduler*'
}.singleFile )
}
}

def getGeoSpatialPlugin() {
Expand Down Expand Up @@ -543,37 +535,21 @@ task comparisonTest(type: RestIntegTestTask) {
testDistribution = "ARCHIVE"
versions = [baseVersion, opensearch_version]
numberOfNodes = 3
plugin(provider(new Callable<RegularFile>(){
@Override
RegularFile call() throws Exception {
return new RegularFile() {
@Override
File getAsFile() {
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,
httpusecaches: false)
return fileTree(bwcJobSchedulerPath + bwcVersion).getSingleFile()
}
}
}
}))
plugin(provider(new Callable<RegularFile>(){
@Override
RegularFile call() throws Exception {
return new RegularFile() {
@Override
File getAsFile() {
return configurations.zipArchive.asFileTree.matching {
include '**/opensearch-sql-plugin*'
}.singleFile
}
}
plugin(provider { (RegularFile) (() -> {
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,
httpusecaches: false)
return fileTree(bwcJobSchedulerPath + bwcVersion).getSingleFile()
})})
plugin(provider { (RegularFile) (() -> {
return configurations.zipArchive.asFileTree.matching {
include '**/opensearch-sql-plugin*'
}.singleFile
})})
setting 'path.repo', "${buildDir}/cluster/shared/repo/${baseName}"
setting 'http.content_type.required', 'true'
}
Expand All @@ -582,17 +558,9 @@ task comparisonTest(type: RestIntegTestTask) {

List<Provider<RegularFile>> plugins = [
getJobSchedulerPlugin(),
provider(new Callable<RegularFile>() {
@Override
RegularFile call() throws Exception {
return new RegularFile() {
@Override
File getAsFile() {
return fileTree(bwcFilePath + project.version).getSingleFile()
}
}
}
})
provider { (RegularFile) (() ->
fileTree(bwcFilePath + project.version).getSingleFile())
}
]

// Creates 2 test clusters with 3 nodes of the old version.
Expand Down

0 comments on commit a2cb2a3

Please sign in to comment.