Skip to content

Commit

Permalink
Fixing integ tests due to missing opensearch-job-scheduler plugin and…
Browse files Browse the repository at this point in the history
… jayway lib (#1147) (#1151)

* Fixing integ tests due to missing opensearch-job-scheduler plugin

Signed-off-by: Yizhe Liu <[email protected]>

* Add jayway as runtime dependency to fix issue #1145

Signed-off-by: Yizhe Liu <[email protected]>

* Add jayway as runtime dependency to qa/build.gradle to fix issue bwc test

Signed-off-by: Yizhe Liu <[email protected]>

* Exclude Sl4j to make sure jayway lib is being used

Signed-off-by: Yizhe Liu <[email protected]>

---------

Signed-off-by: Yizhe Liu <[email protected]>
(cherry picked from commit 558da1f)

Co-authored-by: Yizhe Liu <[email protected]>
  • Loading branch information
1 parent dd3172d commit 6e7b8ba
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
7 changes: 7 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ def knnJarDirectory = "$buildDir/dependencies/opensearch-knn"

dependencies {
api "org.opensearch:opensearch:${opensearch_version}"
zipArchive group: 'org.opensearch.plugin', name:'opensearch-job-scheduler', version: "${opensearch_build}"
zipArchive group: 'org.opensearch.plugin', name:'opensearch-knn', version: "${opensearch_build}"
zipArchive group: 'org.opensearch.plugin', name:'opensearch-ml-plugin', version: "${opensearch_build}"
secureIntegTestPluginArchive group: 'org.opensearch.plugin', name:'opensearch-security', version: "${opensearch_build}"
Expand All @@ -268,6 +269,12 @@ dependencies {
runtimeOnly group: 'org.apache.commons', name: 'commons-text', version: '1.10.0'
runtimeOnly group: 'com.google.code.gson', name: 'gson', version: '2.10.1'
runtimeOnly group: 'org.json', name: 'json', version: '20231013'
// json-path 2.9.0 depends on slf4j 2.0.11, which conflicts with the version used by OpenSearch core.
// Excluding slf4j here since json-path is only used for testing, and logging failures in this context are acceptable.
runtimeOnly('com.jayway.jsonpath:json-path:2.9.0') {
// OpenSearch core is using slf4j 1.7.36. Therefore, we cannot change the version here.
exclude group: 'org.slf4j', module: 'slf4j-api'
}
runtimeOnly("com.fasterxml.jackson.core:jackson-annotations:${versions.jackson}")
runtimeOnly("com.fasterxml.jackson.core:jackson-databind:${versions.jackson_databind}")
testFixturesImplementation "org.opensearch:common-utils:${version}"
Expand Down
17 changes: 17 additions & 0 deletions qa/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,18 @@ def knnJarDirectory = "$rootDir/build/dependencies/opensearch-knn"

dependencies {
api "org.opensearch:opensearch:${opensearch_version}"
zipArchive group: 'org.opensearch.plugin', name:'opensearch-job-scheduler', version: "${opensearch_build}"
zipArchive group: 'org.opensearch.plugin', name:'opensearch-knn', version: "${opensearch_build}"
zipArchive group: 'org.opensearch.plugin', name:'opensearch-ml-plugin', version: "${opensearch_build}"
compileOnly fileTree(dir: knnJarDirectory, include: "opensearch-knn-${opensearch_build}.jar")
compileOnly group: 'com.google.guava', name: 'guava', version:'32.1.3-jre'
compileOnly group: 'commons-lang', name: 'commons-lang', version: '2.6'
// json-path 2.9.0 depends on slf4j 2.0.11, which conflicts with the version used by OpenSearch core.
// Excluding slf4j here since json-path is only used for testing, and logging failures in this context are acceptable.
testRuntimeOnly('com.jayway.jsonpath:json-path:2.9.0') {
// OpenSearch core is using slf4j 1.7.36. Therefore, we cannot change the version here.
exclude group: 'org.slf4j', module: 'slf4j-api'
}
api "org.apache.logging.log4j:log4j-api:${versions.log4j}"
api "org.apache.logging.log4j:log4j-core:${versions.log4j}"
api "junit:junit:${versions.junit}"
Expand Down Expand Up @@ -65,6 +72,16 @@ if (Os.isFamily(Os.FAMILY_WINDOWS)) {

ext{
plugins = [provider(new Callable<RegularFile>(){
@Override
RegularFile call() throws Exception {
return new RegularFile() {
@Override
File getAsFile() {
return configurations.zipArchive.asFileTree.matching{include "**/opensearch-job-scheduler-${opensearch_build}.zip"}.getSingleFile()
}
}
}
}), provider(new Callable<RegularFile>(){
@Override
RegularFile call() throws Exception {
return new RegularFile() {
Expand Down

0 comments on commit 6e7b8ba

Please sign in to comment.