Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvements to the jacoco report generation #21108

Merged
merged 2 commits into from
Sep 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions .github/workflows/fapi-oidc-conformance-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 0 additions & 7 deletions .github/workflows/oidc-conformance-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public ReportGenerator(File executionDataFile, Set<File> classDirectories) {
}

/**
* Create the report.
* Create the report based on the jacoco.exec file.
*
* @throws IOException - Throws if report creation fails
*/
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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));
Expand Down