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

NIFI-12192 Add Codecov Reporting with JaCoCo #7995

Closed
wants to merge 2 commits into from

Conversation

exceptionfactory
Copy link
Contributor

Summary

NIFI-12192 Adds code coverage for unit tests using the JaCoCo Maven Plugin reporting to Codecov.

Codecov provides free reporting capabilities for open source projects and enables integration with GitHub workflows using the Codecov Action.

The implementation of code coverage reporting updates the GitHub ci-workflow to run the Ubuntu Linux Java 21 job with JaCoCo coverage enabled. The JaCoCo plugin writes an aggregated report in XML, using the nifi-code-coverage module to aggregate coverage information based on an enumeration of dependencies. The Maven module is necessary for selecting and aggregating coverage reporting information. The Codecov Action reads the JaCoCo XML and sends it to Codecov for processing.

The JaCoCo prepare-agent goal updates the argLine property, which required removing custom locale information from the Ubuntu Linux job, instead relying on the default settings of the GitHub runner.

Updates include adding a Codecov badge to the README for displaying coverage on the main branch.

Current code coverage information is available in Codecov for this feature branch.

Tracking

Please complete the following tracking steps prior to pull request creation.

Issue Tracking

Pull Request Tracking

  • Pull Request title starts with Apache NiFi Jira issue number, such as NIFI-00000
  • Pull Request commit message starts with Apache NiFi Jira issue number, as such NIFI-00000

Pull Request Formatting

  • Pull Request based on current revision of the main branch
  • Pull Request refers to a feature branch with one commit containing changes

Verification

Please indicate the verification steps performed prior to pull request creation.

Build

  • Build completed using mvn clean install -P contrib-check
    • JDK 21

Licensing

  • New dependencies are compatible with the Apache License 2.0 according to the License Policy
  • New dependencies are documented in applicable LICENSE and NOTICE files

Documentation

  • Documentation formatting appears as expected in rendered files

- Added report-code-coverage profile to nifi-assembly for aggregation
- Added Codecov reporting to Ubuntu Linux Job in ci-workflow
- Added Codecov badge to README.md
pom.xml Show resolved Hide resolved
@ChrisSamo632
Copy link
Contributor

@exceptionfactory thanks for the update, the code coverage will help improve confidence in the code base going forward.

I've suggeted a couple of options to think about for improving the use of JaCoCo - more for consideration than blockers to merging this PR.

As discussed elsewhere, would it be sensible to update the integration-tests-ci profile to skip all ITRedisDistributedMapCacheClientService ITs as part of this PR - more of them failed the first time in the PR checks, but then succeeded on the retry?

@exceptionfactory
Copy link
Contributor Author

As discussed elsewhere, would it be sensible to update the integration-tests-ci profile to skip all ITRedisDistributedMapCacheClientService ITs as part of this PR - more of them failed the first time in the PR checks, but then succeeded on the retry?

Thanks for the review and feedback @ChrisSamo632! I have also noticed that methods in that class have been unreliable in automated tests, so I changed the exclusion to apply to the entire ITRedisDistributedMapCacheClientService class.

@exceptionfactory exceptionfactory added the type: testing Pull requests for changes to test components label Nov 8, 2023
Copy link
Contributor

@ChrisSamo632 ChrisSamo632 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@exceptionfactory thanks for the updates and useful discussion RE options

LGTM 👍 will merge

@asfgit asfgit closed this in 5554bab Nov 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: testing Pull requests for changes to test components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants