Skip to content

Commit a35116d

Browse files
Fixing integ tests due to missing opensearch-job-scheduler plugin and jayway lib (#1147) (#1150)
* 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]>
1 parent dd3172d commit a35116d

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

Diff for: build.gradle

+7
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,7 @@ def knnJarDirectory = "$buildDir/dependencies/opensearch-knn"
250250

251251
dependencies {
252252
api "org.opensearch:opensearch:${opensearch_version}"
253+
zipArchive group: 'org.opensearch.plugin', name:'opensearch-job-scheduler', version: "${opensearch_build}"
253254
zipArchive group: 'org.opensearch.plugin', name:'opensearch-knn', version: "${opensearch_build}"
254255
zipArchive group: 'org.opensearch.plugin', name:'opensearch-ml-plugin', version: "${opensearch_build}"
255256
secureIntegTestPluginArchive group: 'org.opensearch.plugin', name:'opensearch-security', version: "${opensearch_build}"
@@ -268,6 +269,12 @@ dependencies {
268269
runtimeOnly group: 'org.apache.commons', name: 'commons-text', version: '1.10.0'
269270
runtimeOnly group: 'com.google.code.gson', name: 'gson', version: '2.10.1'
270271
runtimeOnly group: 'org.json', name: 'json', version: '20231013'
272+
// json-path 2.9.0 depends on slf4j 2.0.11, which conflicts with the version used by OpenSearch core.
273+
// Excluding slf4j here since json-path is only used for testing, and logging failures in this context are acceptable.
274+
runtimeOnly('com.jayway.jsonpath:json-path:2.9.0') {
275+
// OpenSearch core is using slf4j 1.7.36. Therefore, we cannot change the version here.
276+
exclude group: 'org.slf4j', module: 'slf4j-api'
277+
}
271278
runtimeOnly("com.fasterxml.jackson.core:jackson-annotations:${versions.jackson}")
272279
runtimeOnly("com.fasterxml.jackson.core:jackson-databind:${versions.jackson_databind}")
273280
testFixturesImplementation "org.opensearch:common-utils:${version}"

Diff for: qa/build.gradle

+17
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,18 @@ def knnJarDirectory = "$rootDir/build/dependencies/opensearch-knn"
2929

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

6673
ext{
6774
plugins = [provider(new Callable<RegularFile>(){
75+
@Override
76+
RegularFile call() throws Exception {
77+
return new RegularFile() {
78+
@Override
79+
File getAsFile() {
80+
return configurations.zipArchive.asFileTree.matching{include "**/opensearch-job-scheduler-${opensearch_build}.zip"}.getSingleFile()
81+
}
82+
}
83+
}
84+
}), provider(new Callable<RegularFile>(){
6885
@Override
6986
RegularFile call() throws Exception {
7087
return new RegularFile() {

0 commit comments

Comments
 (0)