@@ -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
@@ -190,6 +185,9 @@ allprojects {
190
185
plugins. withId(' java' ) {
191
186
sourceCompatibility = targetCompatibility = JavaVersion . VERSION_11
192
187
}
188
+ plugins. withId(' jacoco' ) {
189
+ jacoco. toolVersion = ' 0.8.10'
190
+ }
193
191
}
194
192
195
193
ext {
@@ -215,10 +213,10 @@ configurations.all {
215
213
force " org.apache.httpcomponents.client5:httpclient5:${ versions.httpclient5} "
216
214
force " commons-codec:commons-codec:${ versions.commonscodec} "
217
215
218
- force " org.mockito:mockito-core:2.25.0 "
216
+ force " org.mockito:mockito-core:5.3.1 "
219
217
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 "
218
+ force " net.bytebuddy:byte-buddy:1.14.6 "
219
+ force " net.bytebuddy:byte-buddy-agent:1.14.6 "
222
220
force " com.google.code.gson:gson:2.8.9"
223
221
force " junit:junit:4.13.2"
224
222
}
@@ -302,6 +300,14 @@ test {
302
300
excludeTestsMatching " org.opensearch.ad.ml.HCADModelPerfTests"
303
301
}
304
302
}
303
+
304
+ /* Gradle 8 is including some of its own internal JARs into the test classpath, and there's
305
+ overlap with the dependencies org.junit.vintage:junit-vintage-engine pulling in. To prevent
306
+ jar hell, exclude these problematic JARs. */
307
+ classpath = classpath. filter {
308
+ ! it. toString(). contains(" junit-platform-engine-1.8.2.jar" ) &&
309
+ ! it. toString(). contains(" junit-platform-commons-1.8.2.jar" )
310
+ }
305
311
}
306
312
307
313
task integTest (type : RestIntegTestTask ) {
@@ -711,8 +717,8 @@ jacocoTestCoverageVerification {
711
717
712
718
jacocoTestReport {
713
719
reports {
714
- xml. enabled = true
715
- html. enabled = true
720
+ xml. required = true // for coverlay
721
+ html. required = true // human readable
716
722
}
717
723
}
718
724
@@ -722,10 +728,11 @@ jacocoTestCoverageVerification.dependsOn jacocoTestReport
722
728
compileJava. options. compilerArgs << " -Xlint:-deprecation,-rawtypes,-serial,-try,-unchecked"
723
729
724
730
test {
731
+ // required to run unit tests not inherited from OpenSearchTestCase (e.g., PreviousValueImputerTests)
725
732
useJUnitPlatform()
726
733
}
727
734
728
- apply plugin : ' nebula.ospackage'
735
+ apply plugin : ' com.netflix. nebula.ospackage'
729
736
730
737
// This is afterEvaluate because the bundlePlugin ZIP task is updated afterEvaluate and changes the ZIP name to match the plugin name
731
738
afterEvaluate {
@@ -735,7 +742,7 @@ afterEvaluate {
735
742
version = " ${ project.version} " - " -SNAPSHOT"
736
743
737
744
into ' /usr/share/opensearch/plugins'
738
- from(zipTree(bundlePlugin. archivePath )) {
745
+ from(zipTree(bundlePlugin. archiveFile )) {
739
746
into opensearchplugin. name
740
747
}
741
748
@@ -766,9 +773,8 @@ afterEvaluate {
766
773
task renameRpm(type : Copy ) {
767
774
from(" $buildDir /distributions" )
768
775
into(" $buildDir /distributions" )
769
- include archiveName
770
- rename archiveName, " ${ packageName} -${ version} .rpm"
771
- doLast { delete file(" $buildDir /distributions/$archiveName " ) }
776
+ rename " $archiveFileName " , " ${ packageName} -${ archiveVersion} .rpm"
777
+ doLast { delete file(" $buildDir /distributions/$archiveFileName " ) }
772
778
}
773
779
}
774
780
@@ -779,9 +785,8 @@ afterEvaluate {
779
785
task renameDeb(type : Copy ) {
780
786
from(" $buildDir /distributions" )
781
787
into(" $buildDir /distributions" )
782
- include archiveName
783
- rename archiveName, " ${ packageName} -${ version} .deb"
784
- doLast { delete file(" $buildDir /distributions/$archiveName " ) }
788
+ rename " $archiveFileName " , " ${ packageName} -${ archiveVersion} .deb"
789
+ doLast { delete file(" $buildDir /distributions/$archiveFileName " ) }
785
790
}
786
791
}
787
792
0 commit comments