@@ -44,9 +44,9 @@ buildscript {
44
44
opensearch_build + = " -SNAPSHOT"
45
45
}
46
46
if (! isSnapshot) {
47
- opensearch_version = opensearch_version. replace(" -SNAPSHOT" ," " )
47
+ opensearch_version = opensearch_version. replace(" -SNAPSHOT" , " " )
48
48
}
49
- opensearch_no_snapshot = opensearch_version. replace(" -SNAPSHOT" ," " )
49
+ opensearch_no_snapshot = opensearch_version. replace(" -SNAPSHOT" , " " )
50
50
51
51
common_utils_version = System . getProperty(" common_utils.version" , opensearch_build)
52
52
@@ -212,7 +212,7 @@ dependencies {
212
212
testImplementation " org.opensearch.test:framework:${ opensearch_version} "
213
213
testImplementation " org.jetbrains.kotlin:kotlin-test:${ kotlin_version} "
214
214
testImplementation " com.nhaarman.mockitokotlin2:mockito-kotlin:2.2.0"
215
- testImplementation " org.mockito:mockito-core:4.7.0 "
215
+ testImplementation " org.mockito:mockito-core:${ versions.mockito } "
216
216
217
217
add(" ktlint" , " com.pinterest:ktlint:0.45.1" ) {
218
218
attributes {
@@ -222,8 +222,8 @@ dependencies {
222
222
223
223
// https://aws.oss.sonatype.org/content/repositories/snapshots/org/opensearch/plugin/
224
224
opensearchPlugin " org.opensearch.plugin:opensearch-job-scheduler:${ job_scheduler_version} @zip"
225
- opensearchPlugin " org.opensearch.plugin:notifications:${ notifications_version} @zip"
226
225
opensearchPlugin " org.opensearch.plugin:opensearch-notifications-core:${ notifications_version} @zip"
226
+ opensearchPlugin " org.opensearch.plugin:notifications:${ notifications_version} @zip"
227
227
opensearchPlugin " org.opensearch.plugin:opensearch-security:${ security_plugin_version} @zip"
228
228
}
229
229
@@ -282,7 +282,6 @@ ext.resolvePluginFile = { pluginId ->
282
282
return new RegularFile () {
283
283
@Override
284
284
File getAsFile () {
285
- println (" Resolving ${ pluginId} " )
286
285
return configurations. opensearchPlugin. resolvedConfiguration. resolvedArtifacts
287
286
.find { ResolvedArtifact f ->
288
287
f. name. startsWith(pluginId)
@@ -294,13 +293,13 @@ ext.resolvePluginFile = { pluginId ->
294
293
}
295
294
}
296
295
def jobSchedulerFile = resolvePluginFile(" opensearch-job-scheduler" )
297
- def notificationsFile = resolvePluginFile(" notifications" )
298
296
def notificationsCoreFile = resolvePluginFile(" opensearch-notifications-core" )
297
+ def notificationsFile = resolvePluginFile(" notifications" )
299
298
def securityPluginFile = resolvePluginFile(" opensearch-security" )
300
299
301
300
ext. getPluginResource = { download_to_folder , download_from_src ->
302
301
def src_split = download_from_src. split(" /" )
303
- def download_file = src_split[src_split. length- 1 ]
302
+ def download_file = src_split[src_split. length - 1 ]
304
303
if (! fileTree(download_to_folder). contains(new File (" $project . rootDir /$download_to_folder /$download_file " ))) {
305
304
println (" Downloading ${ download_file} " )
306
305
project. delete download_to_folder
@@ -372,8 +371,8 @@ testClusters.integTest {
372
371
}
373
372
374
373
plugin(provider(jobSchedulerFile))
375
- plugin(provider(notificationsFile))
376
374
plugin(provider(notificationsCoreFile))
375
+ plugin(provider(notificationsFile))
377
376
if (securityEnabled) {
378
377
plugin(provider(securityPluginFile))
379
378
}
@@ -488,7 +487,7 @@ def waitForClusterSetup(OpenSearchCluster cluster, Boolean securityEnabled) {
488
487
String unicastUris = cluster. nodes. stream(). flatMap { node ->
489
488
node. getAllTransportPortURI(). stream()
490
489
}. collect(Collectors . joining(" \n " ))
491
- cluster. nodes. forEach {node ->
490
+ cluster. nodes. forEach { node ->
492
491
try {
493
492
Files . write(node. getConfigDir(). resolve(" unicast_hosts.txt" ), unicastUris. getBytes(StandardCharsets . UTF_8 ))
494
493
} catch (IOException e) {
@@ -501,7 +500,7 @@ def waitForClusterSetup(OpenSearchCluster cluster, Boolean securityEnabled) {
501
500
WaitForClusterYellow wait = new WaitForClusterYellow (protocol, cluster. getFirstNode(). getHttpSocketURI(), cluster. nodes. size())
502
501
wait. setUsername(System . getProperty(" user" , " admin" ))
503
502
wait. setPassword(System . getProperty(" password" , " admin" ))
504
- return wait. wait(500 )
503
+ return wait. wait(180000 )
505
504
}
506
505
507
506
cluster. @waitConditions. put(" cluster health yellow" , pred)
@@ -560,7 +559,7 @@ integTest {
560
559
}
561
560
}
562
561
563
- task integTestRemote (type : RestIntegTestTask ) {
562
+ task integTestRemote (type : RestIntegTestTask ) {
564
563
testClassesDirs = sourceSets. test. output. classesDirs
565
564
classpath = sourceSets. test. runtimeClasspath
566
565
systemProperty ' tests.security.manager' , ' false'
@@ -597,12 +596,11 @@ task integTestRemote(type: RestIntegTestTask) {
597
596
598
597
// === Set up BWC tests ===
599
598
600
- String bwcVersionShort = " 2.4 .0"
599
+ String bwcVersionShort = " 2.5 .0"
601
600
String bwcVersion = bwcVersionShort + " .0"
602
- String bwcJobSchedulerVersion = " 1.13.0.0"
603
601
String baseName = " indexmanagementBwcCluster"
604
602
String bwcFilePath = " src/test/resources/bwc/"
605
- String bwc_js_resource_location = bwcFilePath + " job-scheduler/" + bwcJobSchedulerVersion
603
+ String bwc_js_resource_location = bwcFilePath + " job-scheduler/" + bwcVersion
606
604
String bwc_im_resource_location = bwcFilePath + " indexmanagement/" + bwcVersion
607
605
608
606
// Downloads the bwc job scheduler version
@@ -613,13 +611,13 @@ String bwc_js_download_url = 'https://ci.opensearch.org/ci/dbc/distribution-buil
613
611
String bwc_im_download_url = ' https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/' + bwcVersionShort + ' /latest/linux/x64/tar/builds/' +
614
612
' opensearch/plugins/opensearch-index-management-' + bwcVersion + ' .zip'
615
613
616
- 2. times {i ->
614
+ 2. times { i ->
617
615
testClusters {
618
616
" ${ baseName} $i " {
619
617
testDistribution = " ARCHIVE"
620
618
versions = [bwcVersionShort, opensearch_version]
621
619
numberOfNodes = 3
622
- plugin(provider(new Callable<RegularFile > (){
620
+ plugin(provider(new Callable<RegularFile > () {
623
621
@Override
624
622
RegularFile call () throws Exception {
625
623
return new RegularFile () {
@@ -630,8 +628,7 @@ String bwc_im_download_url = 'https://ci.opensearch.org/ci/dbc/distribution-buil
630
628
}
631
629
}
632
630
}))
633
-
634
- plugin(provider(new Callable<RegularFile > (){
631
+ plugin(provider(new Callable<RegularFile > () {
635
632
@Override
636
633
RegularFile call () throws Exception {
637
634
return new RegularFile () {
@@ -656,14 +653,14 @@ task prepareBwcTests {
656
653
dependsOn bundlePlugin
657
654
doLast {
658
655
plugins = [
659
- provider(jobSchedulerFile),
660
- project. getObjects(). fileProperty(). value(project. tasks. bundlePlugin. archiveFile)
656
+ provider(jobSchedulerFile),
657
+ project. getObjects(). fileProperty(). value(project. tasks. bundlePlugin. archiveFile)
661
658
]
662
659
}
663
660
}
664
661
665
662
// Create two test clusters with 3 nodes of the old version
666
- 2. times {i ->
663
+ 2. times { i ->
667
664
task " ${ baseName} #oldVersionClusterTask$i " (type : StandaloneRestIntegTestTask ) {
668
665
dependsOn ' prepareBwcTests'
669
666
useCluster testClusters. " ${ baseName} $i "
@@ -675,17 +672,21 @@ task prepareBwcTests {
675
672
systemProperty ' tests.plugin_bwc_version' , bwcVersion
676
673
nonInputProperties. systemProperty(' tests.rest.cluster' , " ${ -> testClusters."${baseName}$i".allHttpSocketURI.join(",")} " )
677
674
nonInputProperties. systemProperty(' tests.clustername' , " ${ -> testClusters."${baseName}$i".getName()} " )
675
+ systemProperty ' tests.security.manager' , ' false'
678
676
}
679
677
}
680
678
681
679
// Upgrade one node of the old cluster to new OpenSearch version with upgraded plugin version.
682
680
// This results in a mixed cluster with 2 nodes on the old version and 1 upgraded node.
683
681
// This is also used as a one third upgraded cluster for a rolling upgrade.
684
- task " ${ baseName} #mixedClusterTask" (type : StandaloneRestIntegTestTask ) {
685
- useCluster testClusters. " ${ baseName} 0"
682
+ task " ${ baseName} #oneThirdsUpgradeCluster" (type : StandaloneRestIntegTestTask ) {
686
683
dependsOn " ${ baseName} #oldVersionClusterTask0"
684
+ useCluster testClusters. " ${ baseName} 0"
687
685
doFirst {
688
686
testClusters. " ${ baseName} 0" . upgradeNodeAndPluginToNextVersion(plugins)
687
+ getClusters(). forEach { cluster ->
688
+ waitForClusterSetup(cluster, securityEnabled)
689
+ }
689
690
}
690
691
filter {
691
692
includeTestsMatching " org.opensearch.indexmanagement.bwc.*IT"
@@ -695,13 +696,14 @@ task "${baseName}#mixedClusterTask"(type: StandaloneRestIntegTestTask) {
695
696
systemProperty ' tests.plugin_bwc_version' , bwcVersion
696
697
nonInputProperties. systemProperty(' tests.rest.cluster' , " ${ -> testClusters."${baseName}0".allHttpSocketURI.join(",")} " )
697
698
nonInputProperties. systemProperty(' tests.clustername' , " ${ -> testClusters."${baseName}0".getName()} " )
699
+ systemProperty ' tests.security.manager' , ' false'
698
700
}
699
701
700
702
// Upgrade the second node to new OpenSearch version with upgraded plugin version after the first node is upgraded.
701
703
// This results in a mixed cluster with 1 node on the old version and 2 upgraded nodes.
702
704
// This is used for rolling upgrade.
703
705
task " ${ baseName} #twoThirdsUpgradedClusterTask" (type : StandaloneRestIntegTestTask ) {
704
- dependsOn " ${ baseName} #mixedClusterTask "
706
+ dependsOn " ${ baseName} #oneThirdsUpgradeCluster "
705
707
useCluster testClusters. " ${ baseName} 0"
706
708
doFirst {
707
709
testClusters. " ${ baseName} 0" . upgradeNodeAndPluginToNextVersion(plugins)
@@ -714,6 +716,7 @@ task "${baseName}#twoThirdsUpgradedClusterTask"(type: StandaloneRestIntegTestTas
714
716
systemProperty ' tests.plugin_bwc_version' , bwcVersion
715
717
nonInputProperties. systemProperty(' tests.rest.cluster' , " ${ -> testClusters."${baseName}0".allHttpSocketURI.join(",")} " )
716
718
nonInputProperties. systemProperty(' tests.clustername' , " ${ -> testClusters."${baseName}0".getName()} " )
719
+ systemProperty ' tests.security.manager' , ' false'
717
720
}
718
721
719
722
// Upgrade the third node to new OpenSearch version with upgraded plugin version after the second node is upgraded.
@@ -728,12 +731,12 @@ task "${baseName}#rollingUpgradeClusterTask"(type: StandaloneRestIntegTestTask)
728
731
filter {
729
732
includeTestsMatching " org.opensearch.indexmanagement.bwc.*IT"
730
733
}
731
- mustRunAfter " ${ baseName} #mixedClusterTask"
732
- systemProperty ' tests.rest.bwcsuite' , ' mixed_cluster'
734
+ systemProperty ' tests.rest.bwcsuite' , ' upgraded_cluster'
733
735
systemProperty ' tests.rest.bwcsuite_round' , ' third'
734
736
systemProperty ' tests.plugin_bwc_version' , bwcVersion
735
737
nonInputProperties. systemProperty(' tests.rest.cluster' , " ${ -> testClusters."${baseName}0".allHttpSocketURI.join(",")} " )
736
738
nonInputProperties. systemProperty(' tests.clustername' , " ${ -> testClusters."${baseName}0".getName()} " )
739
+ systemProperty ' tests.security.manager' , ' false'
737
740
}
738
741
739
742
// Upgrade all the nodes of the old cluster to new OpenSearch version with upgraded plugin version
@@ -751,13 +754,13 @@ task "${baseName}#fullRestartClusterTask"(type: StandaloneRestIntegTestTask) {
751
754
systemProperty ' tests.plugin_bwc_version' , bwcVersion
752
755
nonInputProperties. systemProperty(' tests.rest.cluster' , " ${ -> testClusters."${baseName}1".allHttpSocketURI.join(",")} " )
753
756
nonInputProperties. systemProperty(' tests.clustername' , " ${ -> testClusters."${baseName}1".getName()} " )
757
+ systemProperty ' tests.security.manager' , ' false'
754
758
}
755
759
756
760
// A bwc test suite which runs all the bwc tasks combined
757
761
task bwcTestSuite (type : StandaloneRestIntegTestTask ) {
758
762
exclude ' **/*Test*'
759
763
exclude ' **/*IT*'
760
- dependsOn tasks. named(" ${ baseName} #mixedClusterTask" )
761
764
dependsOn tasks. named(" ${ baseName} #rollingUpgradeClusterTask" )
762
765
dependsOn tasks. named(" ${ baseName} #fullRestartClusterTask" )
763
766
}
@@ -848,6 +851,6 @@ task updateVersion {
848
851
ext. newVersion = System . getProperty(' newVersion' )
849
852
println " Setting version to ${ newVersion} ."
850
853
// String tokenization to support -SNAPSHOT
851
- ant. replaceregexp(file :' build.gradle' , match : ' "opensearch.version", "\\ d.*"' , replace : ' "opensearch.version", "' + newVersion. tokenize(' -' )[0 ] + ' -SNAPSHOT"' , flags :' g' , byline :true )
854
+ ant. replaceregexp(file : ' build.gradle' , match : ' "opensearch.version", "\\ d.*"' , replace : ' "opensearch.version", "' + newVersion. tokenize(' -' )[0 ] + ' -SNAPSHOT"' , flags : ' g' , byline : true )
852
855
}
853
856
}
0 commit comments