Skip to content

Commit

Permalink
[FEATURE] add code coverage report for commons and memory modules (#1574
Browse files Browse the repository at this point in the history
)

* Test CI for codecov

Signed-off-by: TrungBui59 <[email protected]>

* Change the gradle files for codecov

Signed-off-by: TrungBui59 <[email protected]>

* Fixing gradle file to support for codecov

Signed-off-by: TrungBui59 <[email protected]>

* change the todo

Signed-off-by: TrungBui59 <[email protected]>

---------

Signed-off-by: TrungBui59 <[email protected]>
  • Loading branch information
TrungBui59 authored Nov 2, 2023
1 parent 882246c commit 510f50b
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 15 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/CI-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,12 @@ jobs:
./gradlew integTest -Dtests.rest.cluster=localhost:9200 -Dtests.cluster=localhost:9200 -Dtests.clustername="docker-cluster"
fi
- name: Upload Coverage Report
uses: codecov/codecov-action@v3
with:
flags: ml-commons
token: ${{ secrets.CODECOV_TOKEN }}

Build-ml-windows:
strategy:
matrix:
Expand Down
4 changes: 3 additions & 1 deletion common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ lombok {

jacocoTestReport {
reports {
html.required = true
xml.getRequired().set(true)
csv.getRequired().set(false)
html.getRequired().set(true)
}

dependsOn test
Expand Down
22 changes: 8 additions & 14 deletions memory/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -46,37 +46,31 @@ test {

jacocoTestReport {
reports {
html.required = true
html.outputLocation = layout.buildDirectory.dir('jacocoHtml')
xml.getRequired().set(true)
csv.getRequired().set(false)
html.getRequired().set(true)
}

dependsOn test
}

List<String> jacocoExclusions = []

jacocoTestCoverageVerification {
violationRules {
rule {
element = 'CLASS'
excludes = jacocoExclusions
limit {
counter = 'BRANCH'
minimum = 0.7 //TODO: change this value to 0.7
counter = 'LINE'
minimum = 0.7 //TODO: increase coverage to 0.8
}
}
rule {
element = 'CLASS'
excludes = jacocoExclusions
limit {
counter = 'LINE'
value = 'COVEREDRATIO'
minimum = 0.8 //TODO: change this value to 0.8
counter = 'BRANCH'
minimum = 0.8 //TODO: increase coverage to 0.9
}
}
}
dependsOn jacocoTestReport
}
check.dependsOn jacocoTestCoverageVerification

spotless {
java {
Expand Down

0 comments on commit 510f50b

Please sign in to comment.