Skip to content

Commit e4667f5

Browse files
authored
Include internalClusterTests in code coverage report (#19165)
Signed-off-by: Divya Madala <[email protected]> Signed-off-by: Divya Madala <[email protected]>
1 parent 01b34a8 commit e4667f5

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
3232
- Remove cap on Java version used by forbidden APIs ([#19163](https://github.com/opensearch-project/OpenSearch/pull/19163))
3333
- Disable pruning for `doc_values` for the wildcard field mapper ([#18568](https://github.com/opensearch-project/OpenSearch/pull/18568))
3434
- Make all methods in Engine.Result public ([#19276](https://github.com/opensearch-project/OpenSearch/pull/19275))
35+
- Create and attach interclusterTest and yamlRestTest code coverage reports to gradle check task([#19165](https://github.com/opensearch-project/OpenSearch/pull/19165))
3536

3637
### Fixed
3738
- Fix unnecessary refreshes on update preparation failures ([#15261](https://github.com/opensearch-project/OpenSearch/issues/15261))

gradle/code-coverage.gradle

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,19 @@ allprojects {
5252
executionDataFiles.add("$buildDir/jacoco/javaRestTest.exec")
5353
sourceSetsList.add(sourceSets.javaRestTest)
5454
}
55+
if (tasks.findByName('yamlRestTest')) {
56+
executionDataFiles.add("$buildDir/jacoco/yamlRestTest.exec")
57+
sourceSetsList.add(sourceSets.yamlRestTest)
58+
}
5559
if (!executionDataFiles.isEmpty()) {
5660
executionData.setFrom(files(executionDataFiles).filter { it.exists() })
5761
sourceSets(*sourceSetsList)
5862
}
5963
onlyIf {
6064
file("$buildDir/jacoco/test.exec").exists() ||
6165
file("$buildDir/jacoco/internalClusterTest.exec").exists() ||
62-
file("$buildDir/jacoco/javaRestTest.exec").exists()
66+
file("$buildDir/jacoco/javaRestTest.exec").exists() ||
67+
file("$buildDir/jacoco/yamlRestTest.exec").exists()
6368
}
6469
}
6570
}
@@ -71,17 +76,25 @@ if (System.getProperty("tests.coverage")) {
7176
testCodeCoverageReport(JacocoCoverageReport) {
7277
testSuiteName = "test"
7378
}
79+
testCodeCoverageReportInternalClusterTest(JacocoCoverageReport) {
80+
testSuiteName = "internalClusterTest"
81+
}
7482
testCodeCoverageReportJavaRestTest(JacocoCoverageReport) {
7583
testSuiteName = "javaRestTest"
7684
}
85+
testCodeCoverageReportYamlRestTest(JacocoCoverageReport) {
86+
testSuiteName = "yamlRestTest"
87+
}
7788
}
7889
}
7990

8091
// Attach code coverage report task to Gradle check task
8192
project.getTasks().named(JavaBasePlugin.CHECK_TASK_NAME).configure {
8293
dependsOn(
8394
tasks.named('testCodeCoverageReport', JacocoReport),
84-
tasks.named('testCodeCoverageReportJavaRestTest', JacocoReport)
95+
tasks.named('testCodeCoverageReportInternalClusterTest', JacocoReport),
96+
tasks.named('testCodeCoverageReportJavaRestTest', JacocoReport),
97+
tasks.named('testCodeCoverageReportYamlRestTest', JacocoReport)
8598
)
8699
}
87100
}

0 commit comments

Comments
 (0)