@@ -64,8 +64,8 @@ buildscript {
64
64
}
65
65
66
66
plugins {
67
- id ' nebula.ospackage' version " 8.3 .0" apply false
68
- id " com.diffplug.gradle. spotless" version " 3.26.1 "
67
+ id ' com.netflix. nebula.ospackage' version " 11.0 .0"
68
+ id " com.diffplug.spotless" version " 6.18.0 "
69
69
id ' java-library'
70
70
// Gradle 7.6 support was added in test-retry 1.4.0.
71
71
id ' org.gradle.test-retry' version ' 1.4.1'
@@ -149,22 +149,17 @@ dependencies {
149
149
}
150
150
151
151
testImplementation group : ' pl.pragmatists' , name : ' JUnitParams' , version : ' 1.1.1'
152
- testImplementation group : ' org.mockito' , name : ' mockito-core' , version : ' 2.25.0'
153
- testImplementation group : ' org.powermock' , name : ' powermock-api-mockito2' , version : ' 2.0.2'
154
- testImplementation group : ' org.powermock' , name : ' powermock-module-junit4' , version : ' 2.0.2'
155
- testImplementation group : ' org.powermock' , name : ' powermock-module-junit4-common' , version : ' 2.0.2'
156
- testImplementation group : ' org.powermock' , name : ' powermock-core' , version : ' 2.0.2'
157
- testImplementation group : ' org.powermock' , name : ' powermock-api-support' , version : ' 2.0.2'
158
- testImplementation group : ' org.powermock' , name : ' powermock-reflect' , version : ' 2.0.2'
152
+ testImplementation group : ' org.mockito' , name : ' mockito-core' , version : ' 5.3.1'
159
153
testImplementation group : ' org.objenesis' , name : ' objenesis' , version : ' 3.0.1'
160
- testImplementation group : ' net.bytebuddy' , name : ' byte-buddy' , version : ' 1.9.15 '
161
- testImplementation group : ' net.bytebuddy' , name : ' byte-buddy-agent' , version : ' 1.9.15 '
154
+ testImplementation group : ' net.bytebuddy' , name : ' byte-buddy' , version : ' 1.14.6 '
155
+ testImplementation group : ' net.bytebuddy' , name : ' byte-buddy-agent' , version : ' 1.14.6 '
162
156
testCompileOnly ' org.apiguardian:apiguardian-api:1.1.0'
163
- testImplementation ' org.junit.jupiter:junit-jupiter-api:5.7.2'
164
- testImplementation ' org.junit.jupiter:junit-jupiter-params:5.7.2'
165
- testImplementation ' org.junit.jupiter:junit-jupiter-engine:5.7.2'
157
+ // jupiter is required to run unit tests not inherited from OpenSearchTestCase (e.g., PreviousValueImputerTests)
158
+ testImplementation ' org.junit.jupiter:junit-jupiter-api:5.8.2'
159
+ testImplementation ' org.junit.jupiter:junit-jupiter-params:5.8.2'
160
+ testImplementation ' org.junit.jupiter:junit-jupiter-engine:5.8.2'
166
161
testImplementation " org.opensearch:opensearch-core:${ opensearch_version} "
167
- testRuntimeOnly ' org.junit.vintage:junit-vintage-engine:5.7 .2'
162
+ testRuntimeOnly ' org.junit.vintage:junit-vintage-engine:5.8 .2'
168
163
testCompileOnly ' junit:junit:4.13.2'
169
164
}
170
165
@@ -187,11 +182,16 @@ allprojects {
187
182
188
183
version = " ${ opensearch_build} "
189
184
190
- plugins. withId(' java ' ) {
191
- sourceCompatibility = targetCompatibility = JavaVersion . VERSION_11
185
+ plugins. withId(' jacoco ' ) {
186
+ jacoco . toolVersion = ' 0.8.10 '
192
187
}
193
188
}
194
189
190
+ java {
191
+ targetCompatibility = JavaVersion . VERSION_11
192
+ sourceCompatibility = JavaVersion . VERSION_11
193
+ }
194
+
195
195
ext {
196
196
projectSubstitutions = [:]
197
197
licenseFile = rootProject. file(' LICENSE.txt' )
@@ -215,10 +215,10 @@ configurations.all {
215
215
force " org.apache.httpcomponents.client5:httpclient5:${ versions.httpclient5} "
216
216
force " commons-codec:commons-codec:${ versions.commonscodec} "
217
217
218
- force " org.mockito:mockito-core:2.25.0 "
218
+ force " org.mockito:mockito-core:5.3.1 "
219
219
force " org.objenesis:objenesis:3.0.1"
220
- force " net.bytebuddy:byte-buddy:1.9.15 "
221
- force " net.bytebuddy:byte-buddy-agent:1.9.15 "
220
+ force " net.bytebuddy:byte-buddy:1.14.6 "
221
+ force " net.bytebuddy:byte-buddy-agent:1.14.6 "
222
222
force " com.google.code.gson:gson:2.8.9"
223
223
force " junit:junit:4.13.2"
224
224
}
@@ -302,6 +302,14 @@ test {
302
302
excludeTestsMatching " org.opensearch.ad.ml.HCADModelPerfTests"
303
303
}
304
304
}
305
+
306
+ /* Gradle 8 is including some of its own internal JARs into the test classpath, and there's
307
+ overlap with the dependencies org.junit.vintage:junit-vintage-engine pulling in. To prevent
308
+ jar hell, exclude these problematic JARs. */
309
+ classpath = classpath. filter {
310
+ ! it. toString(). contains(" junit-platform-engine-1.8.2.jar" ) &&
311
+ ! it. toString(). contains(" junit-platform-commons-1.8.2.jar" )
312
+ }
305
313
}
306
314
307
315
task integTest (type : RestIntegTestTask ) {
@@ -711,8 +719,8 @@ jacocoTestCoverageVerification {
711
719
712
720
jacocoTestReport {
713
721
reports {
714
- xml. enabled = true
715
- html. enabled = true
722
+ xml. required = true // for coverlay
723
+ html. required = true // human readable
716
724
}
717
725
}
718
726
@@ -722,10 +730,11 @@ jacocoTestCoverageVerification.dependsOn jacocoTestReport
722
730
compileJava. options. compilerArgs << " -Xlint:-deprecation,-rawtypes,-serial,-try,-unchecked"
723
731
724
732
test {
733
+ // required to run unit tests not inherited from OpenSearchTestCase (e.g., PreviousValueImputerTests)
725
734
useJUnitPlatform()
726
735
}
727
736
728
- apply plugin : ' nebula.ospackage'
737
+ apply plugin : ' com.netflix. nebula.ospackage'
729
738
730
739
// This is afterEvaluate because the bundlePlugin ZIP task is updated afterEvaluate and changes the ZIP name to match the plugin name
731
740
afterEvaluate {
@@ -735,7 +744,7 @@ afterEvaluate {
735
744
version = " ${ project.version} " - " -SNAPSHOT"
736
745
737
746
into ' /usr/share/opensearch/plugins'
738
- from(zipTree(bundlePlugin. archivePath )) {
747
+ from(zipTree(bundlePlugin. archiveFile )) {
739
748
into opensearchplugin. name
740
749
}
741
750
@@ -766,9 +775,8 @@ afterEvaluate {
766
775
task renameRpm(type : Copy ) {
767
776
from(" $buildDir /distributions" )
768
777
into(" $buildDir /distributions" )
769
- include archiveName
770
- rename archiveName, " ${ packageName} -${ version} .rpm"
771
- doLast { delete file(" $buildDir /distributions/$archiveName " ) }
778
+ rename " $archiveFileName " , " ${ packageName} -${ archiveVersion} .rpm"
779
+ doLast { delete file(" $buildDir /distributions/$archiveFileName " ) }
772
780
}
773
781
}
774
782
@@ -779,9 +787,8 @@ afterEvaluate {
779
787
task renameDeb(type : Copy ) {
780
788
from(" $buildDir /distributions" )
781
789
into(" $buildDir /distributions" )
782
- include archiveName
783
- rename archiveName, " ${ packageName} -${ version} .deb"
784
- doLast { delete file(" $buildDir /distributions/$archiveName " ) }
790
+ rename " $archiveFileName " , " ${ packageName} -${ archiveVersion} .deb"
791
+ doLast { delete file(" $buildDir /distributions/$archiveFileName " ) }
785
792
}
786
793
}
787
794
0 commit comments