@@ -315,194 +315,6 @@ testClusters.integTest {
315315 setting ' path.repo' , repo. absolutePath
316316}
317317
318- // For job-scheduler and reports-scheduler, the latest opendistro releases appear to be 1.13.0.0.
319- String bwcVersion = " 1.13.0.0"
320- String baseName = " reportsSchedulerBwcCluster"
321- String bwcFilePath = " src/test/resources/bwc"
322- String bwcJobSchedulerURL = " https://d3g5vo6xdbdb9a.cloudfront.net/downloads/elasticsearch-plugins/opendistro-job-scheduler/opendistro-job-scheduler-" + bwcVersion + " .zip"
323- String bwcReportsSchedulerURL = " https://d3g5vo6xdbdb9a.cloudfront.net/downloads/elasticsearch-plugins/opendistro-reports-scheduler/opendistro-reports-scheduler-" + bwcVersion + " .zip"
324-
325- 2. times {i ->
326- testClusters {
327- " ${ baseName} $i " {
328- testDistribution = " ARCHIVE"
329- versions = [" 7.10.2" , opensearch_version]
330- numberOfNodes = 3
331- plugin(provider(new Callable<RegularFile > (){
332- @Override
333- RegularFile call () throws Exception {
334- return new RegularFile () {
335- @Override
336- File getAsFile () {
337- File dir = new File (bwcFilePath + " /job-scheduler/" + bwcVersion)
338- if (! dir. exists()) {
339- dir. mkdirs()
340- }
341- File file = new File (dir, " opendistro-job-scheduler-" + bwcVersion + " .zip" )
342- if (! file. exists()) {
343- new URL (bwcJobSchedulerURL). withInputStream{ ins -> file. withOutputStream{ it << ins }}
344- }
345- return fileTree(bwcFilePath + " /job-scheduler/" + bwcVersion). getSingleFile()
346- }
347- }
348- }
349- }))
350- plugin(provider(new Callable<RegularFile > (){
351- @Override
352- RegularFile call () throws Exception {
353- return new RegularFile () {
354- @Override
355- File getAsFile () {
356- File dir = new File (bwcFilePath + " /reports-scheduler/" + bwcVersion)
357- if (! dir. exists()) {
358- dir. mkdirs()
359- }
360- File file = new File (dir, " opendistro-reports-scheduler-" + bwcVersion + " .zip" )
361- if (! file. exists()) {
362- new URL (bwcReportsSchedulerURL). withInputStream{ ins -> file. withOutputStream{ it << ins }}
363- }
364- return fileTree(bwcFilePath + " /reports-scheduler/" + bwcVersion). getSingleFile()
365- }
366- }
367- }
368- }))
369- setting ' path.repo' , " ${ buildDir} /cluster/shared/repo/${ baseName} "
370- setting ' http.content_type.required' , ' true'
371- }
372- }
373- }
374-
375- List<Provider<RegularFile > > plugins = []
376-
377- // Ensure the artifact for the current project version is available to be used for the bwc tests
378- task prepareBwcTests {
379- dependsOn bundle
380- doLast {
381- plugins = [
382- provider(new Callable<RegularFile > (){
383- @Override
384- RegularFile call () throws Exception {
385- return new RegularFile () {
386- @Override
387- File getAsFile () {
388- File dir = new File (bwcFilePath + " /job-scheduler/" + project. version)
389- if (! dir. exists()) {
390- dir. mkdirs()
391- }
392- File file = new File (dir, " opendistro-reports-scheduler-" + project. version + " .zip" )
393- if (! file. exists()) {
394- new URL (jobSchedulerURL). withInputStream{ ins -> file. withOutputStream{ it << ins }}
395- }
396- return fileTree(bwcFilePath + " /job-scheduler/" + project. version). getSingleFile()
397- }
398- }
399- }
400- }),
401- project. getObjects(). fileProperty(). value(bundle. getArchiveFile())
402- ]
403- }
404- }
405-
406- // Create two test clusters with 3 nodes of the old version
407- 2. times {i ->
408- task " ${ baseName} #oldVersionClusterTask$i " (type : StandaloneRestIntegTestTask ) {
409- dependsOn ' prepareBwcTests'
410- useCluster testClusters. " ${ baseName} $i "
411- filter {
412- includeTestsMatching " org.opensearch.integTest.bwc.*IT"
413- }
414- systemProperty ' tests.rest.bwcsuite' , ' old_cluster'
415- systemProperty ' tests.rest.bwcsuite_round' , ' old'
416- systemProperty ' tests.plugin_bwc_version' , bwcVersion
417- nonInputProperties. systemProperty(' tests.rest.cluster' , " ${ -> testClusters."${baseName}$i".allHttpSocketURI.join(",")} " )
418- nonInputProperties. systemProperty(' tests.clustername' , " ${ -> testClusters."${baseName}$i".getName()} " )
419- }
420- }
421-
422- // Upgrade one node of the old cluster to new OpenSearch version with upgraded plugin version.
423- // This results in a mixed cluster with 2 nodes on the old version and 1 upgraded node.
424- // This is also used as a one third upgraded cluster for a rolling upgrade.
425- task " ${ baseName} #mixedClusterTask" (type : StandaloneRestIntegTestTask ) {
426- useCluster testClusters. " ${ baseName} 0"
427- dependsOn " ${ baseName} #oldVersionClusterTask0"
428- doFirst {
429- testClusters. " ${ baseName} 0" . upgradeNodeAndPluginToNextVersion(plugins)
430- }
431- filter {
432- includeTestsMatching " org.opensearch.integTest.bwc.*IT"
433- }
434- systemProperty ' tests.rest.bwcsuite' , ' mixed_cluster'
435- systemProperty ' tests.rest.bwcsuite_round' , ' first'
436- systemProperty ' tests.plugin_bwc_version' , bwcVersion
437- nonInputProperties. systemProperty(' tests.rest.cluster' , " ${ -> testClusters."${baseName}0".allHttpSocketURI.join(",")} " )
438- nonInputProperties. systemProperty(' tests.clustername' , " ${ -> testClusters."${baseName}0".getName()} " )
439- }
440-
441- // Upgrade the second node to new OpenSearch version with upgraded plugin version after the first node is upgraded.
442- // This results in a mixed cluster with 1 node on the old version and 2 upgraded nodes.
443- // This is used for rolling upgrade.
444- task " ${ baseName} #twoThirdsUpgradedClusterTask" (type : StandaloneRestIntegTestTask ) {
445- dependsOn " ${ baseName} #mixedClusterTask"
446- useCluster testClusters. " ${ baseName} 0"
447- doFirst {
448- testClusters. " ${ baseName} 0" . upgradeNodeAndPluginToNextVersion(plugins)
449- }
450- filter {
451- includeTestsMatching " org.opensearch.integTest.bwc.*IT"
452- }
453- systemProperty ' tests.rest.bwcsuite' , ' mixed_cluster'
454- systemProperty ' tests.rest.bwcsuite_round' , ' second'
455- systemProperty ' tests.plugin_bwc_version' , bwcVersion
456- nonInputProperties. systemProperty(' tests.rest.cluster' , " ${ -> testClusters."${baseName}0".allHttpSocketURI.join(",")} " )
457- nonInputProperties. systemProperty(' tests.clustername' , " ${ -> testClusters."${baseName}0".getName()} " )
458- }
459-
460- // Upgrade the third node to new OpenSearch version with upgraded plugin version after the second node is upgraded.
461- // This results in a fully upgraded cluster.
462- // This is used for rolling upgrade.
463- task " ${ baseName} #rollingUpgradeClusterTask" (type : StandaloneRestIntegTestTask ) {
464- dependsOn " ${ baseName} #twoThirdsUpgradedClusterTask"
465- useCluster testClusters. " ${ baseName} 0"
466- doFirst {
467- testClusters. " ${ baseName} 0" . upgradeNodeAndPluginToNextVersion(plugins)
468- }
469- filter {
470- includeTestsMatching " org.opensearch.integTest.bwc.*IT"
471- }
472- mustRunAfter " ${ baseName} #mixedClusterTask"
473- systemProperty ' tests.rest.bwcsuite' , ' mixed_cluster'
474- systemProperty ' tests.rest.bwcsuite_round' , ' third'
475- systemProperty ' tests.plugin_bwc_version' , bwcVersion
476- nonInputProperties. systemProperty(' tests.rest.cluster' , " ${ -> testClusters."${baseName}0".allHttpSocketURI.join(",")} " )
477- nonInputProperties. systemProperty(' tests.clustername' , " ${ -> testClusters."${baseName}0".getName()} " )
478- }
479-
480- // Upgrade all the nodes of the old cluster to new OpenSearch version with upgraded plugin version
481- // at the same time resulting in a fully upgraded cluster.
482- task " ${ baseName} #fullRestartClusterTask" (type : StandaloneRestIntegTestTask ) {
483- dependsOn " ${ baseName} #oldVersionClusterTask1"
484- useCluster testClusters. " ${ baseName} 1"
485- doFirst {
486- testClusters. " ${ baseName} 1" . upgradeAllNodesAndPluginsToNextVersion(plugins)
487- }
488- filter {
489- includeTestsMatching " org.opensearch.integTest.bwc.*IT"
490- }
491- systemProperty ' tests.rest.bwcsuite' , ' upgraded_cluster'
492- systemProperty ' tests.plugin_bwc_version' , bwcVersion
493- nonInputProperties. systemProperty(' tests.rest.cluster' , " ${ -> testClusters."${baseName}1".allHttpSocketURI.join(",")} " )
494- nonInputProperties. systemProperty(' tests.clustername' , " ${ -> testClusters."${baseName}1".getName()} " )
495- }
496-
497- // A bwc test suite which runs all the bwc tasks combined
498- task bwcTestSuite (type : StandaloneRestIntegTestTask ) {
499- exclude ' **/*Test*'
500- exclude ' **/*IT*'
501- dependsOn tasks. named(" ${ baseName} #mixedClusterTask" )
502- dependsOn tasks. named(" ${ baseName} #rollingUpgradeClusterTask" )
503- dependsOn tasks. named(" ${ baseName} #fullRestartClusterTask" )
504- }
505-
506318task integTestRemote (type : RestIntegTestTask ) {
507319 testClassesDirs = sourceSets. test. output. classesDirs
508320 classpath = sourceSets. test. runtimeClasspath
0 commit comments