Skip to content
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
60 changes: 57 additions & 3 deletions .github/workflows/code-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ permissions:
contents: read

jobs:
build:
unit-tests:
timeout-minutes: 120
runs-on: ubuntu-24.04
name: Build
name: Run Unit Tests
steps:
- name: Checkout Code
uses: actions/checkout@v6
Expand All @@ -62,9 +62,63 @@ jobs:
-P report-code-coverage
jacoco:prepare-agent
verify
- name: Codecov
- name: Upload Coverage to Codecov
uses: codecov/codecov-action@v5
if: github.repository_owner == 'apache'
with:
files: ./nifi-code-coverage/target/site/jacoco-aggregate/jacoco.xml
flags: unit-tests
token: ${{ secrets.CODECOV_TOKEN }}

integration-tests:
timeout-minutes: 120
runs-on: ubuntu-24.04
name: Run Integration Tests
env:
MAVEN_BUILD_ARGUMENTS: >-
verify
-P skip-unit-tests
-P integration-tests
-P report-code-coverage
MAVEN_BUILD_EXCLUDE_PROJECTS: >-
-pl -:minifi-assembly
-pl -:nifi-assembly
-pl -:nifi-toolkit-assembly
-pl -:nifi-registry-assembly
-pl -:nifi-registry-toolkit-assembly
-pl -:nifi-runtime-manifest
-pl -:nifi-runtime-manifest-test
-pl -:nifi-stateless-assembly
-pl -:nifi-stateless-system-test-suite
-pl -:nifi-system-test-suite
-pl -:nifi-nar-provider-assembly
-pl -:nifi-py4j-integration-tests
-pl -:nifi-docs
-pl -:nifi-maven-archetypes
-pl -:nifi-processor-bundle-archetype
-pl -:nifi-service-bundle-archetype
steps:
- name: Checkout Code
uses: actions/checkout@v6
- name: Set up Java 21
uses: actions/setup-java@v5
with:
distribution: 'zulu'
java-version: 21
cache: 'maven'
- name: Maven Integration Tests with Coverage
env:
MAVEN_OPTS: >-
${{ env.DEFAULT_MAVEN_OPTS }}
TESTCONTAINERS_REUSE_ENABLE: true
run: >
./mvnw --fail-fast --no-snapshot-updates --no-transfer-progress --show-version
${{ env.MAVEN_BUILD_ARGUMENTS }}
${{ env.MAVEN_BUILD_EXCLUDE_PROJECTS }}
- name: Upload Coverage to Codecov
uses: codecov/codecov-action@v5
if: github.repository_owner == 'apache'
with:
files: ./nifi-code-coverage/target/site/jacoco-aggregate/jacoco.xml
flags: integration-tests
token: ${{ secrets.CODECOV_TOKEN }}
7 changes: 7 additions & 0 deletions nifi-code-coverage/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1586,6 +1586,13 @@
<goals>
<goal>report-aggregate</goal>
</goals>
<configuration>
<!-- Include both unit test and integration test coverage files -->
<dataFileIncludes>
<include>**/jacoco.exec</include>
<include>**/jacoco-it.exec</include>
</dataFileIncludes>
</configuration>
</execution>
</executions>
</plugin>
Expand Down
25 changes: 25 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1139,6 +1139,31 @@
</plugins>
</build>
</profile>
<profile>
<!--
Enables JaCoCo coverage collection for integration tests.
This profile is inherited by all modules and sets up the JaCoCo agent
for Failsafe integration tests, writing to jacoco-it.exec files.
The nifi-code-coverage module also defines this profile for report aggregation.
-->
<id>report-code-coverage</id>
<build>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<executions>
<execution>
<id>prepare-agent-integration</id>
<goals>
<goal>prepare-agent-integration</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>contrib-check</id>
<build>
Expand Down
Loading