From 43853e8a71b82f5f43b6f5bea3093b7de0079d19 Mon Sep 17 00:00:00 2001 From: Thilina Shashimal Senarath Date: Thu, 4 Jul 2024 11:03:25 +0530 Subject: [PATCH 1/4] add codecov --- .github/workflows/pr-builder.yml | 7 +++++++ codecov.yml | 15 +++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 codecov.yml diff --git a/.github/workflows/pr-builder.yml b/.github/workflows/pr-builder.yml index 513f25c8ccd..f0dfdf9f6f0 100644 --- a/.github/workflows/pr-builder.yml +++ b/.github/workflows/pr-builder.yml @@ -46,5 +46,12 @@ jobs: ${{ runner.os }}- - name: Build with Maven run: mvn clean install -U -B + - name: Generate coverage report + run: mvn test jacoco:report + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v4.0.1 + with: + token: ${{ secrets.CODECOV_TOKEN }} + fail_ci_if_error: true # Optional: Specify if the CI build should fail when Codecov fails. - name: Delete SNAPSHOT artifacts run: find ~/.m2/repository/ -name "*-SNAPSHOT" -type d -print -prune -exec rm -r {} + diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 00000000000..59da661f5b3 --- /dev/null +++ b/codecov.yml @@ -0,0 +1,15 @@ +codecov: + require_ci_to_pass: yes + notify: + wait_for_ci: yes +coverage: + status: + project: # checks the effect for the overall code coverage rate of the repository. + default: + enabled: yes + threshold: null + target: auto + patch: # This status indicates the extent of code coverage achieved by the pull request. + default: + target: 80% + threshold: 40% # With a target of 80% and a threshold of 50%, the acceptable coverage range is 50% to 80%. From 59e901b024c197c19c988ae3958c9ce8de43d5be Mon Sep 17 00:00:00 2001 From: Thilina Shashimal Senarath Date: Thu, 4 Jul 2024 11:40:53 +0530 Subject: [PATCH 2/4] add missing plugins --- pom.xml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/pom.xml b/pom.xml index f12bb9828ac..b2c51805a7e 100644 --- a/pom.xml +++ b/pom.xml @@ -880,6 +880,25 @@ com.github.spotbugs spotbugs-maven-plugin + + org.jacoco + jacoco-maven-plugin + ${jacoco.version} + + + + prepare-agent + + + + generate-report + test + + report + + + + @@ -1024,6 +1043,7 @@ 5.7.0 5.1.1.RELEASE + 0.8.7 1.10.1 From e11b8c187ba1cff2713196eeabb963b77b9c7e2f Mon Sep 17 00:00:00 2001 From: Thilina Shashimal Senarath Date: Thu, 4 Jul 2024 13:40:25 +0530 Subject: [PATCH 3/4] add missing plugins --- pom.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/pom.xml b/pom.xml index b2c51805a7e..f7d87b49090 100644 --- a/pom.xml +++ b/pom.xml @@ -1043,7 +1043,6 @@ 5.7.0 5.1.1.RELEASE - 0.8.7 1.10.1 From 70240496bdaa749d370f0c0a9fe607dd9f6f66b9 Mon Sep 17 00:00:00 2001 From: Thilina Shashimal Senarath Date: Mon, 8 Jul 2024 10:30:37 +0530 Subject: [PATCH 4/4] remove instrument --- .../org.wso2.carbon.identity.discovery/pom.xml | 12 ------------ .../org.wso2.carbon.identity.oauth.ciba/pom.xml | 12 ------------ .../org.wso2.carbon.identity.oauth.dcr/pom.xml | 12 ------------ .../org.wso2.carbon.identity.oauth.endpoint/pom.xml | 12 ------------ .../org.wso2.carbon.identity.oauth.par/pom.xml | 12 ------------ components/org.wso2.carbon.identity.oauth/pom.xml | 12 ------------ 6 files changed, 72 deletions(-) diff --git a/components/org.wso2.carbon.identity.discovery/pom.xml b/components/org.wso2.carbon.identity.discovery/pom.xml index cf1df7e56e7..b2940f6fd7a 100644 --- a/components/org.wso2.carbon.identity.discovery/pom.xml +++ b/components/org.wso2.carbon.identity.discovery/pom.xml @@ -159,18 +159,6 @@ jacoco-maven-plugin ${jacoco.version} - - default-instrument - - instrument - - - - default-restore-instrumented-classes - - restore-instrumented-classes - - default-report prepare-package diff --git a/components/org.wso2.carbon.identity.oauth.ciba/pom.xml b/components/org.wso2.carbon.identity.oauth.ciba/pom.xml index 96763496f6a..07260aa89b8 100644 --- a/components/org.wso2.carbon.identity.oauth.ciba/pom.xml +++ b/components/org.wso2.carbon.identity.oauth.ciba/pom.xml @@ -177,18 +177,6 @@ jacoco-maven-plugin ${jacoco.version} - - default-instrument - - instrument - - - - default-restore-instrumented-classes - - restore-instrumented-classes - - default-report prepare-package diff --git a/components/org.wso2.carbon.identity.oauth.dcr/pom.xml b/components/org.wso2.carbon.identity.oauth.dcr/pom.xml index 73b08d95c51..4d30c4ebace 100644 --- a/components/org.wso2.carbon.identity.oauth.dcr/pom.xml +++ b/components/org.wso2.carbon.identity.oauth.dcr/pom.xml @@ -217,18 +217,6 @@ jacoco-maven-plugin ${jacoco.version} - - default-instrument - - instrument - - - - default-restore-instrumented-classes - - restore-instrumented-classes - - default-report prepare-package diff --git a/components/org.wso2.carbon.identity.oauth.endpoint/pom.xml b/components/org.wso2.carbon.identity.oauth.endpoint/pom.xml index 900e14579ce..9c18ef47e2e 100644 --- a/components/org.wso2.carbon.identity.oauth.endpoint/pom.xml +++ b/components/org.wso2.carbon.identity.oauth.endpoint/pom.xml @@ -297,18 +297,6 @@ - - default-instrument - - instrument - - - - default-restore-instrumented-classes - - restore-instrumented-classes - - default-report prepare-package diff --git a/components/org.wso2.carbon.identity.oauth.par/pom.xml b/components/org.wso2.carbon.identity.oauth.par/pom.xml index 0b75f4ceb94..cf342f5ae85 100644 --- a/components/org.wso2.carbon.identity.oauth.par/pom.xml +++ b/components/org.wso2.carbon.identity.oauth.par/pom.xml @@ -200,18 +200,6 @@ jacoco-maven-plugin ${jacoco.version} - - default-instrument - - instrument - - - - default-restore-instrumented-classes - - restore-instrumented-classes - - default-report prepare-package diff --git a/components/org.wso2.carbon.identity.oauth/pom.xml b/components/org.wso2.carbon.identity.oauth/pom.xml index 9a0c04b5bf8..e1521f05c4d 100644 --- a/components/org.wso2.carbon.identity.oauth/pom.xml +++ b/components/org.wso2.carbon.identity.oauth/pom.xml @@ -509,18 +509,6 @@ jacoco-maven-plugin ${jacoco.version} - - default-instrument - - instrument - - - - default-restore-instrumented-classes - - restore-instrumented-classes - - default-report prepare-package