Skip to content

Commit

Permalink
address comment
Browse files Browse the repository at this point in the history
  • Loading branch information
zhongnansu committed Dec 7, 2021
1 parent 187305e commit 5906446
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 21 deletions.
64 changes: 43 additions & 21 deletions reports-scheduler/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -318,33 +318,55 @@ String bwcFilePath = "src/test/resources/bwc"
}

List<Provider<RegularFile>> plugins = [
provider(new Callable<RegularFile>(){
@Override
RegularFile call() throws Exception {
return new RegularFile() {
@Override
File getAsFile() {
return fileTree(bwcFilePath + "/job-scheduler/" + project.version).getSingleFile()
}
}
}
}),
provider(new Callable<RegularFile>(){
@Override
RegularFile call() throws Exception {
return new RegularFile() {
// provider(new Callable<RegularFile>(){
// @Override
// RegularFile call() throws Exception {
// return new RegularFile() {
// @Override
// File getAsFile() {
// return fileTree(bwcFilePath + "/job-scheduler/" + project.version).getSingleFile()
// }
// }
// }
// }),
// provider(new Callable<RegularFile>(){
// @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<RegularFile>(){
@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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down

0 comments on commit 5906446

Please sign in to comment.