From 48ef86c5ab5423b34e877820efc732b207c23087 Mon Sep 17 00:00:00 2001 From: Maduranga Siriwardena Date: Fri, 13 Sep 2024 22:30:08 +0530 Subject: [PATCH 1/2] Improvements to the jacoco report generation --- .../wso2/carbon/identity/jacoco/ReportGenerator.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/modules/integration/tests-common/jacoco-report-generator/src/main/java/org/wso2/carbon/identity/jacoco/ReportGenerator.java b/modules/integration/tests-common/jacoco-report-generator/src/main/java/org/wso2/carbon/identity/jacoco/ReportGenerator.java index 044092d778..71bf5d703e 100644 --- a/modules/integration/tests-common/jacoco-report-generator/src/main/java/org/wso2/carbon/identity/jacoco/ReportGenerator.java +++ b/modules/integration/tests-common/jacoco-report-generator/src/main/java/org/wso2/carbon/identity/jacoco/ReportGenerator.java @@ -109,7 +109,7 @@ public ReportGenerator(File executionDataFile, Set classDirectories) { } /** - * Create the report. + * Create the report based on the jacoco.exec file. * * @throws IOException - Throws if report creation fails */ @@ -177,9 +177,13 @@ private IBundleCoverage analyzeStructure() throws IOException { return coverageBuilder.getBundle(title); } + /** + * Create a concrete report visitor based on some supplied configuration. In this case we use the defaults. + * @param bundleCoverage - Bundle coverage + * @throws IOException + */ private void createReport(final IBundleCoverage bundleCoverage) throws IOException { - // Create a concrete report visitor based on some supplied configuration. In this case we use the defaults try (FileOutputStream fos = new FileOutputStream(xmlReport)) { final XMLFormatter xmlFormatter = new XMLFormatter(); final IReportVisitor visitor = xmlFormatter.createVisitor(fos); @@ -207,7 +211,7 @@ private void createReport(final IBundleCoverage bundleCoverage) throws IOExcepti * @return - Jar file extracted directory. * @throws IOException - Throws if jar extraction fails */ - private synchronized String extractJarFile(String jarFilePath, File tempDir) throws IOException { + private String extractJarFile(String jarFilePath, File tempDir) throws IOException { if (!jarFilePath.endsWith(".war") && !jarFilePath.endsWith(".jar")) { throw new IllegalArgumentException(String.format(INVALID_EXTENSION_ERROR, jarFilePath)); From 7b8e3b8b70c620fd017189e2f8b73968a83703bc Mon Sep 17 00:00:00 2001 From: Maduranga Siriwardena Date: Fri, 13 Sep 2024 22:31:30 +0530 Subject: [PATCH 2/2] Remove exec file archiving --- .github/workflows/fapi-oidc-conformance-test.yml | 7 ------- .github/workflows/oidc-conformance-test.yml | 7 ------- 2 files changed, 14 deletions(-) diff --git a/.github/workflows/fapi-oidc-conformance-test.yml b/.github/workflows/fapi-oidc-conformance-test.yml index 1a47e0419f..db67cf415c 100644 --- a/.github/workflows/fapi-oidc-conformance-test.yml +++ b/.github/workflows/fapi-oidc-conformance-test.yml @@ -253,13 +253,6 @@ jobs: name: test-logs path: ./*log.txt - - name: Archive Jacoco exec - uses: actions/upload-artifact@v4 - if: always() - with: - name: jacoco-exec - path: ./jacoco.exec - - name: Build Jacoco Report Generator run: | cd ./product-is/modules/integration/tests-common/jacoco-report-generator diff --git a/.github/workflows/oidc-conformance-test.yml b/.github/workflows/oidc-conformance-test.yml index bd456fc860..e6391ced68 100644 --- a/.github/workflows/oidc-conformance-test.yml +++ b/.github/workflows/oidc-conformance-test.yml @@ -206,13 +206,6 @@ jobs: name: test-logs path: ./*log.txt - - name: Archive Jacoco exec - uses: actions/upload-artifact@v4 - if: always() - with: - name: jacoco-exec - path: ./jacoco.exec - - name: Build Jacoco Report Generator run: | cd ./product-is/modules/integration/tests-common/jacoco-report-generator