Skip to content

Commit 510f50b

Browse files
authored
[FEATURE] add code coverage report for commons and memory modules (opensearch-project#1574)
* Test CI for codecov Signed-off-by: TrungBui59 <bui23@purdue.edu> * Change the gradle files for codecov Signed-off-by: TrungBui59 <bui23@purdue.edu> * Fixing gradle file to support for codecov Signed-off-by: TrungBui59 <bui23@purdue.edu> * change the todo Signed-off-by: TrungBui59 <bui23@purdue.edu> --------- Signed-off-by: TrungBui59 <bui23@purdue.edu>
1 parent 882246c commit 510f50b

File tree

3 files changed

+17
-15
lines changed

3 files changed

+17
-15
lines changed

.github/workflows/CI-workflow.yml

+6
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,12 @@ jobs:
164164
./gradlew integTest -Dtests.rest.cluster=localhost:9200 -Dtests.cluster=localhost:9200 -Dtests.clustername="docker-cluster"
165165
fi
166166
167+
- name: Upload Coverage Report
168+
uses: codecov/codecov-action@v3
169+
with:
170+
flags: ml-commons
171+
token: ${{ secrets.CODECOV_TOKEN }}
172+
167173
Build-ml-windows:
168174
strategy:
169175
matrix:

common/build.gradle

+3-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ lombok {
2929

3030
jacocoTestReport {
3131
reports {
32-
html.required = true
32+
xml.getRequired().set(true)
33+
csv.getRequired().set(false)
34+
html.getRequired().set(true)
3335
}
3436

3537
dependsOn test

memory/build.gradle

+8-14
Original file line numberDiff line numberDiff line change
@@ -46,37 +46,31 @@ test {
4646

4747
jacocoTestReport {
4848
reports {
49-
html.required = true
50-
html.outputLocation = layout.buildDirectory.dir('jacocoHtml')
49+
xml.getRequired().set(true)
50+
csv.getRequired().set(false)
51+
html.getRequired().set(true)
5152
}
5253

5354
dependsOn test
5455
}
5556

56-
List<String> jacocoExclusions = []
5757

5858
jacocoTestCoverageVerification {
5959
violationRules {
6060
rule {
61-
element = 'CLASS'
62-
excludes = jacocoExclusions
6361
limit {
64-
counter = 'BRANCH'
65-
minimum = 0.7 //TODO: change this value to 0.7
62+
counter = 'LINE'
63+
minimum = 0.7 //TODO: increase coverage to 0.8
6664
}
67-
}
68-
rule {
69-
element = 'CLASS'
70-
excludes = jacocoExclusions
7165
limit {
72-
counter = 'LINE'
73-
value = 'COVEREDRATIO'
74-
minimum = 0.8 //TODO: change this value to 0.8
66+
counter = 'BRANCH'
67+
minimum = 0.8 //TODO: increase coverage to 0.9
7568
}
7669
}
7770
}
7871
dependsOn jacocoTestReport
7972
}
73+
check.dependsOn jacocoTestCoverageVerification
8074

8175
spotless {
8276
java {

0 commit comments

Comments
 (0)