diff --git a/reports-scheduler/build.gradle b/reports-scheduler/build.gradle index 026e4c3e..115e4811 100644 --- a/reports-scheduler/build.gradle +++ b/reports-scheduler/build.gradle @@ -318,33 +318,55 @@ String bwcFilePath = "src/test/resources/bwc" } List> plugins = [ - provider(new Callable(){ - @Override - RegularFile call() throws Exception { - return new RegularFile() { - @Override - File getAsFile() { - return fileTree(bwcFilePath + "/job-scheduler/" + project.version).getSingleFile() - } - } - } - }), - provider(new Callable(){ - @Override - RegularFile call() throws Exception { - return new RegularFile() { +// provider(new Callable(){ +// @Override +// RegularFile call() throws Exception { +// return new RegularFile() { +// @Override +// File getAsFile() { +// return fileTree(bwcFilePath + "/job-scheduler/" + project.version).getSingleFile() +// } +// } +// } +// }), +// provider(new Callable(){ +// @Override +// RegularFile call() throws Exception { +// return new RegularFile() { +// @Override +// File getAsFile() { +// return fileTree(bwcFilePath + "/reports-scheduler/" + project.version).getSingleFile() +// } +// } +// } +// }) +] + +// Ensure the artifact for the current project version is available to be used for the bwc tests +task prepareBwcTests { + dependsOn bundle + doLast { + plugins = [ + provider(new Callable(){ @Override - File getAsFile() { - return fileTree(bwcFilePath + "/reports-scheduler/" + project.version).getSingleFile() + RegularFile call() throws Exception { + return new RegularFile() { + @Override + File getAsFile() { + return fileTree(bwcFilePath + "/job-scheduler/" + project.version).getSingleFile() + } + } } - } - } - }) -] + }), + project.getObjects().fileProperty().value(bundle.getArchiveFile()) + ] + } +} // Create two test clusters with 3 nodes of the old version 2.times {i -> task "${baseName}#oldVersionClusterTask$i"(type: StandaloneRestIntegTestTask) { + dependsOn 'prepareBwcTests' useCluster testClusters."${baseName}$i" filter { includeTestsMatching "org.opensearch.reportsscheduler.bwc.*IT" diff --git a/reports-scheduler/src/test/kotlin/org/opensearch/reportsscheduler/bwc/ReportsSchedulerBackwardsCompatibilityIT.kt b/reports-scheduler/src/test/kotlin/org/opensearch/reportsscheduler/bwc/ReportsSchedulerBackwardsCompatibilityIT.kt index 0c258dfd..571b4d45 100644 --- a/reports-scheduler/src/test/kotlin/org/opensearch/reportsscheduler/bwc/ReportsSchedulerBackwardsCompatibilityIT.kt +++ b/reports-scheduler/src/test/kotlin/org/opensearch/reportsscheduler/bwc/ReportsSchedulerBackwardsCompatibilityIT.kt @@ -128,6 +128,8 @@ class ReportsSchedulerBackwardsCompatibilityIT : PluginRestTestCase() { ) val legacyReportDefinitionId = legacyReportDefinitionResponse.get("reportDefinitionId").asString Assert.assertNotNull("reportDefinitionId should be generated", legacyReportDefinitionId) + // adding this wait time for the scheduler to create a report instance in the report-instance index, + // based on this report definition Thread.sleep(610000) }