diff --git a/.github/actions/incremental-build/incremental-build.sh b/.github/actions/incremental-build/incremental-build.sh index f0bce642149f5..24dfb3d1dc863 100755 --- a/.github/actions/incremental-build/incremental-build.sh +++ b/.github/actions/incremental-build/incremental-build.sh @@ -756,6 +756,27 @@ main() { echo "============================================================" echo "" + # ── Step 4b: Aggregated core coverage report ── + # When coverage is enabled and core modules were tested, generate the + # aggregated JaCoCo report via the coverage module. This is needed because + # camel-core tests exercise classes from camel-core-model, camel-core-processor, + # etc., so per-module reports alone miss cross-module coverage. + if [[ "${MVND_OPTS:-}" == *"-Dcoverage"* ]]; then + local core_tested=false + for w in $(echo "$final_pl" | tr ',' '\n'); do + if [[ "$w" == core/* ]]; then + core_tested=true + break + fi + done + if [[ "$core_tested" == true ]]; then + echo "" + echo "Core modules affected — generating aggregated coverage report..." + $mavenBinary verify -B -Dcoverage -pl coverage -am -DskipTests \ + || echo "WARNING: Coverage aggregation failed (non-fatal)" + fi + fi + # ── Step 5: Write comment and summary ── local comment_file="incremental-test-comment.md" writeComment "$comment_file" "$pl" "$dep_module_ids" "$all_changed_props" "$testedDependents" "$extraModules" "$scalpel_managed_deps" "$scalpel_managed_plugins" diff --git a/.github/workflows/sonar-build.yml b/.github/workflows/sonar-build.yml index 1e20713dff161..cff9ff3bf4144 100644 --- a/.github/workflows/sonar-build.yml +++ b/.github/workflows/sonar-build.yml @@ -37,8 +37,7 @@ concurrency: jobs: build: - # Temporarily disabled until SonarCloud quality gate is adjusted (INFRA-27808) - if: false && github.repository == 'apache/camel' + if: github.repository == 'apache/camel' name: Build for Sonar Analysis runs-on: ubuntu-latest steps: @@ -59,17 +58,18 @@ jobs: - name: Build with Maven run: ./mvnw install -B -Dquickly - # Run core tests with JaCoCo and generate aggregated coverage report. - # The source modules must be in the reactor so report-aggregate can - # map execution data from camel-core tests to their classes. - # TODO: Once incremental-build.sh supports module detection in the sonar - # workflow, replace the hardcoded -pl with detected affected modules - # to get coverage on components too (see PR #22247). - - name: Run tests with coverage and generate report - run: > - ./mvnw verify -B -Dcoverage - -pl core/camel-api,core/camel-util,core/camel-support,core/camel-management-api,core/camel-management,core/camel-base,core/camel-base-engine,core/camel-core-engine,core/camel-core-languages,core/camel-core-model,core/camel-core-processor,core/camel-core-reifier,core/camel-core,core/camel-main,core/camel-health,coverage - -Dmaven.test.failure.ignore=true + # Run tests on PR-affected modules with JaCoCo coverage. + # Per-module reports are generated by jacoco:report (added in parent pom). + # When core modules are affected, the incremental build also generates + # the aggregated coverage report via the coverage module. + - name: Run incremental tests with coverage + uses: ./.github/actions/incremental-build + with: + pr-id: ${{ github.event.pull_request.number }} + github-token: ${{ secrets.GITHUB_TOKEN }} + artifact-upload-suffix: sonar + env: + MVND_OPTS: "-Dcoverage -Dmaven.test.failure.ignore=true" - name: Prepare compiled classes artifact shell: bash diff --git a/.github/workflows/sonar-scan.yml b/.github/workflows/sonar-scan.yml index 1c2fdc309fb5c..37ab8e6857b00 100644 --- a/.github/workflows/sonar-scan.yml +++ b/.github/workflows/sonar-scan.yml @@ -28,9 +28,7 @@ concurrency: jobs: sonar: - # Temporarily disabled until SonarCloud quality gate is adjusted (INFRA-27808) if: > - false && github.event.workflow_run.conclusion == 'success' && github.repository == 'apache/camel' name: Sonar Analysis diff --git a/.superset/config.json b/.superset/config.json new file mode 100644 index 0000000000000..f806b5255cf88 --- /dev/null +++ b/.superset/config.json @@ -0,0 +1,5 @@ +{ + "setup": [], + "teardown": [], + "run": [] +} diff --git a/parent/pom.xml b/parent/pom.xml index c2028d92fe872..5fb2092ac3a11 100644 --- a/parent/pom.xml +++ b/parent/pom.xml @@ -4415,6 +4415,13 @@ + + report + verify + + report + + diff --git a/pom.xml b/pom.xml index 4b3c87db9fe5c..ccb40409fb729 100644 --- a/pom.xml +++ b/pom.xml @@ -122,9 +122,10 @@ ${jdk.version} + when upgrading to Maven 4.x, according to any of the new variables that will replace this one. + Two sources: per-module reports (from jacoco:report) and the aggregated report (from coverage module). --> - ${maven.multiModuleProjectDirectory}/coverage/target/site/jacoco-aggregate/jacoco.xml + ${project.build.directory}/site/jacoco/jacoco.xml,${maven.multiModuleProjectDirectory}/coverage/target/site/jacoco-aggregate/jacoco.xml components/camel-jackson3/**,components/camel-jackson3xml/**,components/camel-test/camel-test-junit6/**