From 510f50be4c102027bb05e4f459ea2a9b52f62765 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Trung=20B=C3=B9i?= <70444530+TrungBui59@users.noreply.github.com> Date: Thu, 2 Nov 2023 18:18:41 -0400 Subject: [PATCH] [FEATURE] add code coverage report for commons and memory modules (#1574) * Test CI for codecov Signed-off-by: TrungBui59 * Change the gradle files for codecov Signed-off-by: TrungBui59 * Fixing gradle file to support for codecov Signed-off-by: TrungBui59 * change the todo Signed-off-by: TrungBui59 --------- Signed-off-by: TrungBui59 --- .github/workflows/CI-workflow.yml | 6 ++++++ common/build.gradle | 4 +++- memory/build.gradle | 22 ++++++++-------------- 3 files changed, 17 insertions(+), 15 deletions(-) diff --git a/.github/workflows/CI-workflow.yml b/.github/workflows/CI-workflow.yml index 1933d9840f..f3f446413f 100644 --- a/.github/workflows/CI-workflow.yml +++ b/.github/workflows/CI-workflow.yml @@ -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: diff --git a/common/build.gradle b/common/build.gradle index 474ad9db65..c664aa1f47 100644 --- a/common/build.gradle +++ b/common/build.gradle @@ -29,7 +29,9 @@ lombok { jacocoTestReport { reports { - html.required = true + xml.getRequired().set(true) + csv.getRequired().set(false) + html.getRequired().set(true) } dependsOn test diff --git a/memory/build.gradle b/memory/build.gradle index 3a481507fb..dd7a7fec49 100644 --- a/memory/build.gradle +++ b/memory/build.gradle @@ -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 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 {