Skip to content

Conversation

@pvillard31
Copy link
Contributor

@pvillard31 pvillard31 commented Jan 6, 2026

Summary

NIFI-15432 Add system tests to code coverage workflow

  • Add system-tests job to collect coverage from spawned NiFi instances
  • Configure JaCoCo agent injection via JACOCO_AGENT_PATH environment variable
  • Modify SpawnedStandaloneNiFiInstanceFactory to configure JaCoCo agent in bootstrap.conf
  • Collect and merge jacoco.exec files from system tests and stateless tests
  • Convert merged coverage data to XML format for Codecov upload
  • Dynamically extract module list from nifi-code-coverage/pom.xml
  • Add nifi-registry-integration-tests profile to integration tests job

When doing testing in my fork, it's getting us to 60%+ of coverage.
https://app.codecov.io/github/pvillard31/nifi/commit/ec991a105874edbd925a95bb6eea9c2d060561e1/tree

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 contains commits signed with a registered key indicating Verified status

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 ./mvnw clean install -P contrib-check
    • JDK 21
    • JDK 25

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

@pvillard31 pvillard31 force-pushed the NIFI-15432 branch 2 times, most recently from ac38c8c to ea5aa83 Compare January 6, 2026 20:17
Copy link
Contributor

@exceptionfactory exceptionfactory left a comment

Choose a reason for hiding this comment

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

Thanks for working on this substantive improvement to code coverage tracking @pvillard31. The general approach of passing the JaCoCo agent handling through the system tests looks like a good strategy.

On initial review, my primary concern is the extensive amount of scripting in the code coverage workflow, in particular the complex sed and grep commands. At minimum, extracting this logic to an external script would support testing and maintenance. However, it does make me wonder if there are other options with potentially less scripting involved.

- Add system-tests job to collect coverage from spawned NiFi instances
- Configure JaCoCo agent injection via JACOCO_AGENT_PATH environment variable
- Modify SpawnedStandaloneNiFiInstanceFactory to configure JaCoCo agent in bootstrap.conf
- Collect and merge jacoco.exec files from system tests and stateless tests
- Convert merged coverage data to XML format for Codecov upload
- Dynamically extract module list from nifi-code-coverage/pom.xml
- Add nifi-registry-integration-tests profile to integration tests job
- Add jacoco.version property to root pom.xml for workflow compatibility
@pvillard31
Copy link
Contributor Author

Thanks for the feedback @exceptionfactory - I extracted the scripting into an external dedicated script file. Given the nature of the system tests and how they work / are executed, I didn't find any other (better) option during my testing.

@exceptionfactory exceptionfactory added the type: testing Pull requests for changes to test components label Jan 12, 2026
Copy link
Contributor

@exceptionfactory exceptionfactory left a comment

Choose a reason for hiding this comment

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

Thanks for moving the script to a separate file @pvillard31, the approach looks good! +1 merging

@exceptionfactory exceptionfactory merged commit b52727e into apache:main Jan 21, 2026
17 of 20 checks passed
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