Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Replace centos:8 with almalinux:8 since centos docker images are deprecated ([#19154](https://github.com/opensearch-project/OpenSearch/pull/19154))
- Add CompletionStage variants to IndicesAdminClient as an alternative to ActionListener ([#19161](https://github.com/opensearch-project/OpenSearch/pull/19161))
- Remove cap on Java version used by forbidden APIs ([#19163](https://github.com/opensearch-project/OpenSearch/pull/19163))
- Create and attach interclusterTest and yamlRestTest code coverage reports to gradle check task([#19165](https://github.com/opensearch-project/OpenSearch/pull/19165))

### Fixed
- Fix unnecessary refreshes on update preparation failures ([#15261](https://github.com/opensearch-project/OpenSearch/issues/15261))
Expand Down
17 changes: 15 additions & 2 deletions gradle/code-coverage.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,19 @@ allprojects {
executionDataFiles.add("$buildDir/jacoco/javaRestTest.exec")
sourceSetsList.add(sourceSets.javaRestTest)
}
if (tasks.findByName('yamlRestTest')) {
executionDataFiles.add("$buildDir/jacoco/yamlRestTest.exec")
sourceSetsList.add(sourceSets.yamlRestTest)
}
if (!executionDataFiles.isEmpty()) {
executionData.setFrom(files(executionDataFiles).filter { it.exists() })
sourceSets(*sourceSetsList)
}
onlyIf {
file("$buildDir/jacoco/test.exec").exists() ||
file("$buildDir/jacoco/internalClusterTest.exec").exists() ||
file("$buildDir/jacoco/javaRestTest.exec").exists()
file("$buildDir/jacoco/javaRestTest.exec").exists() ||
file("$buildDir/jacoco/yamlRestTest.exec").exists()
}
}
}
Expand All @@ -71,17 +76,25 @@ if (System.getProperty("tests.coverage")) {
testCodeCoverageReport(JacocoCoverageReport) {
testSuiteName = "test"
}
testCodeCoverageReportInternalClusterTest(JacocoCoverageReport) {
testSuiteName = "internalClusterTest"
}
testCodeCoverageReportJavaRestTest(JacocoCoverageReport) {
testSuiteName = "javaRestTest"
}
testCodeCoverageReportYamlRestTest(JacocoCoverageReport) {
testSuiteName = "yamlRestTest"
}
}
}

// Attach code coverage report task to Gradle check task
project.getTasks().named(JavaBasePlugin.CHECK_TASK_NAME).configure {
dependsOn(
tasks.named('testCodeCoverageReport', JacocoReport),
tasks.named('testCodeCoverageReportJavaRestTest', JacocoReport)
tasks.named('testCodeCoverageReportInternalClusterTest', JacocoReport),
tasks.named('testCodeCoverageReportJavaRestTest', JacocoReport),
tasks.named('testCodeCoverageReportYamlRestTest', JacocoReport)
)
}
}
Loading