From 361f24c48a673030a3d7bcd1c6c6493658487a51 Mon Sep 17 00:00:00 2001 From: ShammiL Date: Tue, 10 Sep 2024 18:10:26 +0530 Subject: [PATCH 1/7] Add code coverage dependencies --- .../pom.xml | 10 +++- pom.xml | 56 +++++++++++++++++++ 2 files changed, 63 insertions(+), 3 deletions(-) diff --git a/monitoring-dashboard/integration/org.wso2.micro.integrator.dashboard.integration.tests/pom.xml b/monitoring-dashboard/integration/org.wso2.micro.integrator.dashboard.integration.tests/pom.xml index 0c2a8b95c..68e6dfd37 100644 --- a/monitoring-dashboard/integration/org.wso2.micro.integrator.dashboard.integration.tests/pom.xml +++ b/monitoring-dashboard/integration/org.wso2.micro.integrator.dashboard.integration.tests/pom.xml @@ -48,13 +48,17 @@ + + org.jacoco + jacoco-maven-plugin + 0.8.4 + maven-surefire-plugin - 2.12.4 + 2.22.2 false - - -Xms512m -Xmx1024m + ${argLine} false false diff --git a/pom.xml b/pom.xml index ad72db824..f947de234 100644 --- a/pom.xml +++ b/pom.xml @@ -232,6 +232,62 @@ + + org.jacoco + jacoco-maven-plugin + 0.8.4 + + + default-prepare-agent-by-coverage-enforcer + + prepare-agent + + + argLine + + + + default-report-by-coverage-enforcer + + report + + + ${project.build.directory}/jacoco.exec + + + + default-check-by-coverage-enforcer + + check + + + ${project.build.directory}/jacoco.exec + + + + BUNDLE + + + + LINE + COVEREDRATIO + 0.0 + + + + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + maven.surefire.plugin.version + + @{argline} -Xms512m -Xmx1024m + + org.apache.maven.plugins maven-release-plugin From 7f9f9be8ad1a78f9cf1b43ac72196190701bbb19 Mon Sep 17 00:00:00 2001 From: ShammiL Date: Tue, 10 Sep 2024 18:14:12 +0530 Subject: [PATCH 2/7] Add codecov to PR build --- .github/workflows/pull_request_ubuntu_build.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/pull_request_ubuntu_build.yml b/.github/workflows/pull_request_ubuntu_build.yml index 1b101bee8..b206c62fd 100644 --- a/.github/workflows/pull_request_ubuntu_build.yml +++ b/.github/workflows/pull_request_ubuntu_build.yml @@ -19,3 +19,8 @@ jobs: cache: maven - name: Build with Maven run: mvn clean install + - name: Upload test coverage to Codecov + uses: codecov/codecov-action@v4.0.1 + with: + flags: unit_tests + token: ${{ secrets.CODECOV_TOKEN }} From 7b72a17fd8f4b267472a3a8f3638cd492ff05316 Mon Sep 17 00:00:00 2001 From: ShammiL Date: Tue, 10 Sep 2024 18:21:12 +0530 Subject: [PATCH 3/7] Downgrade surefire plugin version --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index f947de234..319778563 100644 --- a/pom.xml +++ b/pom.xml @@ -85,7 +85,7 @@ 5.1.2 3.1.0 1.8 - 2.22.2 + 2.12.4 3.1.1 From 6580a89905ff5616f64168a0322cf3f2cd91a2b1 Mon Sep 17 00:00:00 2001 From: ShammiL Date: Tue, 10 Sep 2024 18:26:14 +0530 Subject: [PATCH 4/7] Remove version in module pom --- .../pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/monitoring-dashboard/integration/org.wso2.micro.integrator.dashboard.integration.tests/pom.xml b/monitoring-dashboard/integration/org.wso2.micro.integrator.dashboard.integration.tests/pom.xml index 68e6dfd37..3b3c21930 100644 --- a/monitoring-dashboard/integration/org.wso2.micro.integrator.dashboard.integration.tests/pom.xml +++ b/monitoring-dashboard/integration/org.wso2.micro.integrator.dashboard.integration.tests/pom.xml @@ -55,7 +55,7 @@ maven-surefire-plugin - 2.22.2 + false ${argLine} From ba059ed5644629ac4ce0ff3f39ccb633564c95af Mon Sep 17 00:00:00 2001 From: ShammiL Date: Wed, 11 Sep 2024 09:11:54 +0530 Subject: [PATCH 5/7] Revert to prev surefire versions --- .../pom.xml | 2 +- pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/monitoring-dashboard/integration/org.wso2.micro.integrator.dashboard.integration.tests/pom.xml b/monitoring-dashboard/integration/org.wso2.micro.integrator.dashboard.integration.tests/pom.xml index 3b3c21930..1ae88124e 100644 --- a/monitoring-dashboard/integration/org.wso2.micro.integrator.dashboard.integration.tests/pom.xml +++ b/monitoring-dashboard/integration/org.wso2.micro.integrator.dashboard.integration.tests/pom.xml @@ -55,7 +55,7 @@ maven-surefire-plugin - + 2.12.4 false ${argLine} diff --git a/pom.xml b/pom.xml index 319778563..f947de234 100644 --- a/pom.xml +++ b/pom.xml @@ -85,7 +85,7 @@ 5.1.2 3.1.0 1.8 - 2.12.4 + 2.22.2 3.1.1 From 6d4b483c54a0a440eef9505fde8060c6134993b3 Mon Sep 17 00:00:00 2001 From: ShammiL Date: Wed, 11 Sep 2024 09:39:07 +0530 Subject: [PATCH 6/7] Enable inheriting for surefire --- .../pom.xml | 4 ++-- pom.xml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/monitoring-dashboard/integration/org.wso2.micro.integrator.dashboard.integration.tests/pom.xml b/monitoring-dashboard/integration/org.wso2.micro.integrator.dashboard.integration.tests/pom.xml index 1ae88124e..457bbe0b6 100644 --- a/monitoring-dashboard/integration/org.wso2.micro.integrator.dashboard.integration.tests/pom.xml +++ b/monitoring-dashboard/integration/org.wso2.micro.integrator.dashboard.integration.tests/pom.xml @@ -55,8 +55,8 @@ maven-surefire-plugin - 2.12.4 - false + 2.22.2 + ${argLine} false diff --git a/pom.xml b/pom.xml index f947de234..4c0a91933 100644 --- a/pom.xml +++ b/pom.xml @@ -283,7 +283,7 @@ org.apache.maven.plugins maven-surefire-plugin - maven.surefire.plugin.version + 2.22.2 @{argline} -Xms512m -Xmx1024m From 918f69c04ad47ad690846ccfa81a3ddca23b8249 Mon Sep 17 00:00:00 2001 From: ShammiL Date: Wed, 11 Sep 2024 12:32:32 +0530 Subject: [PATCH 7/7] Remove surefire plugin inheriting config --- .../pom.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/monitoring-dashboard/integration/org.wso2.micro.integrator.dashboard.integration.tests/pom.xml b/monitoring-dashboard/integration/org.wso2.micro.integrator.dashboard.integration.tests/pom.xml index 457bbe0b6..2368c0004 100644 --- a/monitoring-dashboard/integration/org.wso2.micro.integrator.dashboard.integration.tests/pom.xml +++ b/monitoring-dashboard/integration/org.wso2.micro.integrator.dashboard.integration.tests/pom.xml @@ -56,7 +56,6 @@ maven-surefire-plugin 2.22.2 - ${argLine} false