Skip to content

Commit

Permalink
[Backport 2.x] Add job scheduler plugin to test cluster (#3047)
Browse files Browse the repository at this point in the history
(cherry picked from commit c1e623d)

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 89f8191 commit 79f9be0
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions plugin/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import java.util.concurrent.Callable

/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
Expand Down Expand Up @@ -113,6 +115,11 @@ configurations.all {
resolutionStrategy.force "org.apache.httpcomponents:httpclient:4.5.14"
resolutionStrategy.force "org.jetbrains.kotlin:kotlin-stdlib-common:1.6.0"
}

configurations {
zipArchive
}

compileJava {
options.compilerArgs.addAll(["-processor", 'lombok.launch.AnnotationProcessorHider$AnnotationProcessor'])
}
Expand Down Expand Up @@ -143,6 +150,8 @@ dependencies {
testImplementation group: 'org.mockito', name: 'mockito-core', version: "${versions.mockito}"
testImplementation group: 'org.mockito', name: 'mockito-junit-jupiter', version: "${versions.mockito}"
testImplementation 'org.junit.jupiter:junit-jupiter:5.9.3'

zipArchive group: 'org.opensearch.plugin', name:'opensearch-job-scheduler', version: "${opensearch_build}"
}

test {
Expand Down Expand Up @@ -252,7 +261,24 @@ afterEvaluate {
}
}

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
}
}
}
})
}

testClusters.integTest {
plugin(getJobSchedulerPlugin())
plugin(project.tasks.bundlePlugin.archiveFile)
testDistribution = "ARCHIVE"

Expand Down

0 comments on commit 79f9be0

Please sign in to comment.