Skip to content

Conversation

@docflex
Copy link
Owner

@docflex docflex commented Jul 27, 2025

📄 Description:

This PR enhances the reporting module by adding robust test coverage, runtime benchmarking, code quality safeguards, and improved CI pipeline integration.

Screenshot 2025-07-27 at 8 32 13 PM

🧪 Tests Added:

  • Unit tests for ReportValidators

    • Valid .jasper and .jrxml handling
    • IO exceptions and null streams
    • Unsupported input types (e.g., InputStream, byte[])
  • Unit tests for ReportExporter

    • XML export failures and exception propagation
  • Unit tests for ReportGenerator

    • Happy path for all supported formats
    • Input and template validation failures
    • Unexpected runtime exceptions from getDataRows()
  • Verified thrown exceptions match expected types (including NullPointerException as cause in RuntimeException)


🚀 Enhancements:

  • Benchmarking

    • Added runtime logging to ReportGenerator.generateReport() to measure execution duration in milliseconds.
  • Coverage Enforcement

    • Updated Maven config and GitHub Actions to:

      • Generate JaCoCo coverage report via mvn verify
      • Enforce 80% minimum line coverage (build will fail if not met)

⚙️ CI Pipeline Changes (.github/workflows/test-feature.yml):

  • Added jacoco:report and jacoco:check to mvn command
  • Enforced minimumLineCoverage=0.80
  • Reports generated in target/site/jacoco/index.html

📊 How to View Coverage

After running:

mvn clean verify

Open this file:

target/site/jacoco/index.html

📎 Notes

  • Logging conflicts with commons-logging were resolved by avoiding duplicate classpath entries.
  • Exception wrapping is intentional in ReportGenerator to ensure internal failures don’t propagate unchecked.

Let me know if you'd like to split this PR or further document anything!

@docflex docflex merged commit dc411db into main Jul 27, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant