From 2b1ae249b7e365a32ad6f7bb405c7fad790192db Mon Sep 17 00:00:00 2001 From: Darshana Gunawardana Date: Mon, 2 Sep 2024 16:23:02 +0530 Subject: [PATCH 1/2] Revert "Revert "[Automated PR]Add Codecov and JaCoCo configurations"" --- .github/workflows/pr-builder.yml | 8 +++ codecov.yml | 16 +++++ .../org.wso2.carbon.email.mgt.ui/pom.xml | 24 +++++++ .../org.wso2.carbon.email.mgt/pom.xml | 24 +++++++ .../pom.xml | 24 +++++++ .../pom.xml | 45 +++++++++++- .../org.wso2.carbon.email.mgt.feature/pom.xml | 24 +++++++ .../pom.xml | 24 +++++++ .../pom.xml | 24 +++++++ .../pom.xml | 24 +++++++ pom.xml | 71 ++++++++++++++++++- .../org.wso2.carbon.email.mgt.stub/pom.xml | 24 +++++++ 12 files changed, 330 insertions(+), 2 deletions(-) create mode 100644 codecov.yml diff --git a/.github/workflows/pr-builder.yml b/.github/workflows/pr-builder.yml index c09cbf5f..6a96372f 100644 --- a/.github/workflows/pr-builder.yml +++ b/.github/workflows/pr-builder.yml @@ -39,3 +39,11 @@ jobs: - 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 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files : target/site/jacoco/jacoco.xml diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 00000000..9571a5f2 --- /dev/null +++ b/codecov.yml @@ -0,0 +1,16 @@ + +codecov: + require_ci_to_pass: yes + notify: + wait_for_ci: yes +coverage: + status: + project: + default: + enabled: yes + threshold: null + target: auto + patch: + default: + target: 80% + threshold: 40% diff --git a/components/email-mgt/org.wso2.carbon.email.mgt.ui/pom.xml b/components/email-mgt/org.wso2.carbon.email.mgt.ui/pom.xml index 1ae98f10..4ac715d0 100644 --- a/components/email-mgt/org.wso2.carbon.email.mgt.ui/pom.xml +++ b/components/email-mgt/org.wso2.carbon.email.mgt.ui/pom.xml @@ -59,6 +59,11 @@ org.wso2.orbit.org.owasp.encoder encoder + + org.jacoco + jacoco-maven-plugin + ${jacoco.version} + @@ -87,6 +92,25 @@ + + org.jacoco + jacoco-maven-plugin + ${jacoco.version} + + + + prepare-agent + + + + report + test + + report + + + + diff --git a/components/email-mgt/org.wso2.carbon.email.mgt/pom.xml b/components/email-mgt/org.wso2.carbon.email.mgt/pom.xml index 72bfbd12..444f3154 100644 --- a/components/email-mgt/org.wso2.carbon.email.mgt/pom.xml +++ b/components/email-mgt/org.wso2.carbon.email.mgt/pom.xml @@ -107,6 +107,11 @@ powermock-api-mockito2 test + + org.jacoco + jacoco-maven-plugin + ${jacoco.version} + @@ -239,6 +244,25 @@ 8 + + org.jacoco + jacoco-maven-plugin + ${jacoco.version} + + + + prepare-agent + + + + report + test + + report + + + + diff --git a/components/event-handler-notification/org.wso2.carbon.identity.event.handler.notification/pom.xml b/components/event-handler-notification/org.wso2.carbon.identity.event.handler.notification/pom.xml index ec4119a4..91d823db 100644 --- a/components/event-handler-notification/org.wso2.carbon.identity.event.handler.notification/pom.xml +++ b/components/event-handler-notification/org.wso2.carbon.identity.event.handler.notification/pom.xml @@ -126,6 +126,11 @@ mockito-core test + + org.jacoco + jacoco-maven-plugin + ${jacoco.version} + @@ -195,6 +200,25 @@ + + org.jacoco + jacoco-maven-plugin + ${jacoco.version} + + + + prepare-agent + + + + report + test + + report + + + + diff --git a/components/notification-sender-config/org.wso2.carbon.identity.notification.sender.tenant.config/pom.xml b/components/notification-sender-config/org.wso2.carbon.identity.notification.sender.tenant.config/pom.xml index 52c5d8fb..a688b64f 100644 --- a/components/notification-sender-config/org.wso2.carbon.identity.notification.sender.tenant.config/pom.xml +++ b/components/notification-sender-config/org.wso2.carbon.identity.notification.sender.tenant.config/pom.xml @@ -87,6 +87,11 @@ powermock-module-testng test + + org.jacoco + jacoco-maven-plugin + ${jacoco.version} + @@ -203,7 +208,26 @@ findsecbugs-plugin ${findsecbugs-plugin.version} - + + org.jacoco + jacoco-maven-plugin + ${jacoco.version} + + + + prepare-agent + + + + report + test + + report + + + + + @@ -240,6 +264,25 @@ + + org.jacoco + jacoco-maven-plugin + ${jacoco.version} + + + + prepare-agent + + + + report + test + + report + + + + diff --git a/features/org.wso2.carbon.email.mgt.feature/pom.xml b/features/org.wso2.carbon.email.mgt.feature/pom.xml index 03edc80e..84d969b0 100644 --- a/features/org.wso2.carbon.email.mgt.feature/pom.xml +++ b/features/org.wso2.carbon.email.mgt.feature/pom.xml @@ -44,6 +44,11 @@ org.wso2.carbon.email.mgt.ui.feature zip + + org.jacoco + jacoco-maven-plugin + ${jacoco.version} + @@ -74,6 +79,25 @@ + + org.jacoco + jacoco-maven-plugin + ${jacoco.version} + + + + prepare-agent + + + + report + test + + report + + + + diff --git a/features/org.wso2.carbon.email.mgt.server.feature/pom.xml b/features/org.wso2.carbon.email.mgt.server.feature/pom.xml index d4a520ab..53941f4d 100644 --- a/features/org.wso2.carbon.email.mgt.server.feature/pom.xml +++ b/features/org.wso2.carbon.email.mgt.server.feature/pom.xml @@ -42,6 +42,11 @@ org.wso2.carbon.identity.event.handler.notification org.wso2.carbon.identity.notification.sender.tenant.config + + org.jacoco + jacoco-maven-plugin + ${jacoco.version} + @@ -125,6 +130,25 @@ + + org.jacoco + jacoco-maven-plugin + ${jacoco.version} + + + + prepare-agent + + + + report + test + + report + + + + diff --git a/features/org.wso2.carbon.email.mgt.ui.feature/pom.xml b/features/org.wso2.carbon.email.mgt.ui.feature/pom.xml index 63c54486..03ea2bf8 100644 --- a/features/org.wso2.carbon.email.mgt.ui.feature/pom.xml +++ b/features/org.wso2.carbon.email.mgt.ui.feature/pom.xml @@ -41,6 +41,11 @@ org.wso2.carbon.identity.event.handler.notification org.wso2.carbon.email.mgt.stub + + org.jacoco + jacoco-maven-plugin + ${jacoco.version} + @@ -76,6 +81,25 @@ + + org.jacoco + jacoco-maven-plugin + ${jacoco.version} + + + + prepare-agent + + + + report + test + + report + + + + diff --git a/features/org.wso2.carbon.event.handler.notification.server.feature/pom.xml b/features/org.wso2.carbon.event.handler.notification.server.feature/pom.xml index 1674dd6a..6ab29067 100644 --- a/features/org.wso2.carbon.event.handler.notification.server.feature/pom.xml +++ b/features/org.wso2.carbon.event.handler.notification.server.feature/pom.xml @@ -38,6 +38,11 @@ org.wso2.carbon.identity.event.handler.notification org.wso2.carbon.identity.event.handler.notification + + org.jacoco + jacoco-maven-plugin + ${jacoco.version} + @@ -124,6 +129,25 @@ + + org.jacoco + jacoco-maven-plugin + ${jacoco.version} + + + + prepare-agent + + + + report + test + + report + + + + diff --git a/pom.xml b/pom.xml index 81731309..08464eb9 100644 --- a/pom.xml +++ b/pom.xml @@ -331,6 +331,16 @@ org.apache.felix.scr.ds-annotations ${apache.felix.scr.ds.annotations.version} + + org.jacoco + jacoco-maven-plugin + ${jacoco.version} + + + org.jacoco + jacoco-maven-plugin + ${jacoco.version} + @@ -359,6 +369,44 @@ maven-checkstyle-plugin ${maven.checkstyleplugin.version} + + org.jacoco + jacoco-maven-plugin + ${jacoco.version} + + + + prepare-agent + + + + report + test + + report + + + + + + org.jacoco + jacoco-maven-plugin + ${jacoco.version} + + + + prepare-agent + + + + report + test + + report + + + + @@ -399,7 +447,26 @@ - + + org.jacoco + jacoco-maven-plugin + ${jacoco.version} + + + + prepare-agent + + + + report + test + + report + + + + + @@ -492,5 +559,7 @@ findbugs-exclude-filter.xml 2.13.3 + + 0.8.12 diff --git a/service-stubs/identity/org.wso2.carbon.email.mgt.stub/pom.xml b/service-stubs/identity/org.wso2.carbon.email.mgt.stub/pom.xml index d17c1cc5..f4500904 100644 --- a/service-stubs/identity/org.wso2.carbon.email.mgt.stub/pom.xml +++ b/service-stubs/identity/org.wso2.carbon.email.mgt.stub/pom.xml @@ -97,6 +97,25 @@ + + org.jacoco + jacoco-maven-plugin + ${jacoco.version} + + + + prepare-agent + + + + report + test + + report + + + + @@ -109,5 +128,10 @@ org.apache.axis2.wso2 axis2-client + + org.jacoco + jacoco-maven-plugin + ${jacoco.version} + From 4c1521bd10027e9a440ac0731077c734a98ea562 Mon Sep 17 00:00:00 2001 From: Darshana Gunawardana Date: Mon, 2 Sep 2024 16:21:23 +0530 Subject: [PATCH 2/2] Fix codecov build issue --- .../pom.xml | 21 +------------------ 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/components/notification-sender-config/org.wso2.carbon.identity.notification.sender.tenant.config/pom.xml b/components/notification-sender-config/org.wso2.carbon.identity.notification.sender.tenant.config/pom.xml index a688b64f..5b32c8d1 100644 --- a/components/notification-sender-config/org.wso2.carbon.identity.notification.sender.tenant.config/pom.xml +++ b/components/notification-sender-config/org.wso2.carbon.identity.notification.sender.tenant.config/pom.xml @@ -208,26 +208,7 @@ findsecbugs-plugin ${findsecbugs-plugin.version} - - org.jacoco - jacoco-maven-plugin - ${jacoco.version} - - - - prepare-agent - - - - report - test - - report - - - - - +