exceptionfactory commented on code in PR #10714:
URL: https://github.com/apache/nifi/pull/10714#discussion_r2655761477
##########
.github/workflows/code-coverage.yml:
##########
@@ -62,9 +63,83 @@ 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: unittests
token: ${{ secrets.CODECOV_TOKEN }}
+
+ # Job 2: Integration tests - runs all container-based integration tests
+ # Uses the same approach as integration-tests.yml but with JaCoCo coverage
+ integration-tests:
+ timeout-minutes: 120
+ runs-on: ubuntu-24.04
+ name: Integration Tests
+ env:
+ # Skip assemblies and modules covered separately by the system-tests
workflow
+ # Skip unit tests (surefire), run integration tests (failsafe)
+ MAVEN_BUILD_ARGUMENTS: >-
+ verify
+ -P skip-unit-tests
+ -P integration-tests
+ jacoco:prepare-agent
+ jacoco:report
+ 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: Find Coverage Reports
+ id: find-reports
+ if: always()
+ run: |
+ REPORTS=$(find . -path "*/target/site/jacoco/jacoco.xml" -type f |
tr '\n' ',' | sed 's/,$//')
+ echo "reports=$REPORTS" >> $GITHUB_OUTPUT
+ echo "Found $(echo "$REPORTS" | tr ',' '\n' | wc -l) coverage
reports"
+ - name: Upload Coverage to Codecov
+ uses: codecov/codecov-action@v5
+ if: github.repository_owner == 'apache' &&
steps.find-reports.outputs.reports != ''
+ with:
+ files: ${{ steps.find-reports.outputs.reports }}
+ flags: integration-tests
+ token: ${{ secrets.CODECOV_TOKEN }}
+ - name: Upload Troubleshooting Logs
+ if: failure() || cancelled()
+ uses: actions/upload-artifact@v5
+ with:
+ name: integration-tests-failsafe-logs
+ path: |
+ **/target/failsafe-reports/**/*.txt
+ retention-days: 7
Review Comment:
I don't think uploading logs is needed, since this workflow is for code
coverage specifically.
##########
.github/workflows/code-coverage.yml:
##########
@@ -34,10 +34,11 @@ permissions:
contents: read
jobs:
- build:
+ # Job 1: Unit tests and Python integration tests - produces the main
coverage report
Review Comment:
I'm not sure this comment adds much beyond what already exists in the `name`
field
##########
.github/workflows/code-coverage.yml:
##########
@@ -62,9 +63,83 @@ 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: unittests
token: ${{ secrets.CODECOV_TOKEN }}
+
+ # Job 2: Integration tests - runs all container-based integration tests
+ # Uses the same approach as integration-tests.yml but with JaCoCo coverage
+ integration-tests:
+ timeout-minutes: 120
+ runs-on: ubuntu-24.04
+ name: Integration Tests
+ env:
+ # Skip assemblies and modules covered separately by the system-tests
workflow
+ # Skip unit tests (surefire), run integration tests (failsafe)
+ MAVEN_BUILD_ARGUMENTS: >-
+ verify
+ -P skip-unit-tests
+ -P integration-tests
+ jacoco:prepare-agent
+ jacoco:report
+ 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: Find Coverage Reports
+ id: find-reports
+ if: always()
+ run: |
+ REPORTS=$(find . -path "*/target/site/jacoco/jacoco.xml" -type f |
tr '\n' ',' | sed 's/,$//')
+ echo "reports=$REPORTS" >> $GITHUB_OUTPUT
+ echo "Found $(echo "$REPORTS" | tr ',' '\n' | wc -l) coverage
reports"
Review Comment:
Is this step necessary? It seems like some coverage reports should always be
produced, and avoiding scripting is better for maintainability.
##########
.github/workflows/code-coverage.yml:
##########
@@ -62,9 +63,83 @@ 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: unittests
Review Comment:
Recommend adjusting the flag to follow the pattern used below for
`integration-tests`.
```suggestion
flags: unit-tests
```
##########
.github/workflows/code-coverage.yml:
##########
@@ -62,9 +63,83 @@ 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: unittests
token: ${{ secrets.CODECOV_TOKEN }}
+
+ # Job 2: Integration tests - runs all container-based integration tests
+ # Uses the same approach as integration-tests.yml but with JaCoCo coverage
+ integration-tests:
+ timeout-minutes: 120
+ runs-on: ubuntu-24.04
+ name: Integration Tests
Review Comment:
```suggestion
name: Run Integration Tests
```
##########
.github/workflows/code-coverage.yml:
##########
@@ -34,10 +34,11 @@ permissions:
contents: read
jobs:
- build:
+ # Job 1: Unit tests and Python integration tests - produces the main
coverage report
+ unit-tests:
timeout-minutes: 120
runs-on: ubuntu-24.04
- name: Build
+ name: Unit Tests and Python ITs
Review Comment:
I recommend simplifying the name to follow the convention of the `flags`
below:
```name: Run Unit Tests```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]