This is an automated email from the ASF dual-hosted git repository.

Croway pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-spring-boot.git


The following commit(s) were added to refs/heads/main by this push:
     new f67af72d42a Run only the changed starter integration tests in the PR 
build
f67af72d42a is described below

commit f67af72d42a45a9e961b35ebf853b6d70aef17f9
Author: croway <[email protected]>
AuthorDate: Tue Oct 6 12:06:45 2026 +0200

    Run only the changed starter integration tests in the PR build
    
    The PR build tests every module touched by the pull request, so any change
    to tests/camel-itest-spring-boot runs its ~400 per-starter integration 
tests.
    Each one generates a project from the archetype and builds it with a nested
    Maven invocation that cannot resolve the camel-spring-boot BOM snapshot on
    GitHub Actions, so every test fails, is retried twice, and the job takes
    more than an hour.
    
    - Add a github-ci profile to camel-itest-spring-boot, activated by
      ci.env.name=github.com, that runs only the catalog coverage check plus the
      integration tests listed in itest.changed.
    - Compute itest.changed in the workflow from the starter integration tests
      changed by the pull request and pass it with maven-extra-args.
    - Configure the Apache snapshots repository in ~/.m2/settings.xml so the
      nested Maven builds resolve the BOM and starters.
    - Drop the mode and artifact-upload-suffix inputs, no longer accepted by the
      incremental-build action.
    
    The whole suite still runs on the Jenkins daily build and locally.
    
    Co-Authored-By: Claude Opus 5.5 <[email protected]>
---
 .github/workflows/pr-build-main.yml   | 50 +++++++++++++++++++++++++++++++++--
 tests/camel-itest-spring-boot/pom.xml | 28 ++++++++++++++++++++
 2 files changed, 76 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/pr-build-main.yml 
b/.github/workflows/pr-build-main.yml
index 1b2deaf9e11..7c07fe20658 100644
--- a/.github/workflows/pr-build-main.yml
+++ b/.github/workflows/pr-build-main.yml
@@ -52,12 +52,58 @@ jobs:
         java-version: ${{ matrix.java }}
         distribution: 'temurin'
         cache: 'maven'
+    # The starter integration tests build a project generated from the 
archetype with a nested Maven
+    # invocation, which needs the Apache snapshots repository to resolve the 
camel-spring-boot BOM and
+    # the starters that are not part of the incremental build
+    - name: Configure Apache snapshots repository
+      run: |
+        mkdir -p ~/.m2
+        cat > ~/.m2/settings.xml <<'EOF'
+        <settings>
+          <profiles>
+            <profile>
+              <id>apache-snapshots</id>
+              <repositories>
+                <repository>
+                  <id>apache.snapshots</id>
+                  <url>https://repository.apache.org/snapshots/</url>
+                  <releases><enabled>false</enabled></releases>
+                  <snapshots><enabled>true</enabled></snapshots>
+                </repository>
+              </repositories>
+              <pluginRepositories>
+                <pluginRepository>
+                  <id>apache.snapshots</id>
+                  <url>https://repository.apache.org/snapshots/</url>
+                  <releases><enabled>false</enabled></releases>
+                  <snapshots><enabled>true</enabled></snapshots>
+                </pluginRepository>
+              </pluginRepositories>
+            </profile>
+          </profiles>
+          <activeProfiles>
+            <activeProfile>apache-snapshots</activeProfile>
+          </activeProfiles>
+        </settings>
+        EOF
+    # Only the starter integration tests changed by the pull request run on 
GitHub Actions,
+    # see the github-ci profile in tests/camel-itest-spring-boot/pom.xml
+    - name: Select changed starter integration tests
+      id: itests
+      env:
+        GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+        PR_ID: ${{ github.event.number }}
+      run: |
+        changed=$(gh pr diff "$PR_ID" --repo apache/camel-spring-boot 
--name-only \
+          | grep -E 
'^tests/camel-itest-spring-boot/src/test/java/org/apache/camel/itest/springboot/Camel[^/]*IT\.java$'
 \
+          | xargs -r -n1 basename | sed 's/\.java$//' | paste -sd, - || true)
+        echo "Changed starter integration tests: ${changed:-none}"
+        echo "maven-extra-args=${changed:+-Ditest.changed=,$changed}" >> 
"$GITHUB_OUTPUT"
     - name: Maven Test
       uses: apache/camel/.github/actions/incremental-build@main
       with:
-        mode: test
         pr-id: ${{ github.event.number }}
         github-token: ${{ secrets.GITHUB_TOKEN }}
         skip-mvnd-install: 'false'
         github-repo: apache/camel-spring-boot
-        artifact-upload-suffix: java-${{ matrix.java }}
+        maven-extra-args: ${{ steps.itests.outputs.maven-extra-args }}
diff --git a/tests/camel-itest-spring-boot/pom.xml 
b/tests/camel-itest-spring-boot/pom.xml
index 143954450c0..545fb7e7d35 100644
--- a/tests/camel-itest-spring-boot/pom.xml
+++ b/tests/camel-itest-spring-boot/pom.xml
@@ -152,6 +152,34 @@
     </build>
 
     <profiles>
+        <!--
+            On GitHub Actions run only the catalog coverage check and the 
starter integration tests
+            changed by the pull request (passed as 
-Ditest.changed=,CamelFooIT,CamelBarIT), the whole
+            suite builds one project per starter and runs on the Jenkins daily 
build.
+        -->
+        <profile>
+            <id>github-ci</id>
+            <activation>
+                <property>
+                    <name>ci.env.name</name>
+                    <value>github.com</value>
+                </property>
+            </activation>
+            <properties>
+                <itest.changed></itest.changed>
+            </properties>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-failsafe-plugin</artifactId>
+                        <configuration>
+                            <test>**/catalog/*IT${itest.changed}</test>
+                        </configuration>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
         <profile>
             <id>generate</id>
             <properties>

Reply via email to