diff --git a/.github/workflows/test-platforms.yml b/.github/workflows/test-platforms.yml
index 976de41..0656db5 100644
--- a/.github/workflows/test-platforms.yml
+++ b/.github/workflows/test-platforms.yml
@@ -24,16 +24,18 @@ on:
# Manual trigger
workflow_dispatch:
- # Run on pushes to development
+ # Run on pushes to development and feature branches
push:
branches:
- development
+ - 'feature/**'
paths:
- 'libre2-core/src/**'
- 'perf-test/src/**'
- 'pom.xml'
- 'libre2-core/pom.xml'
- 'perf-test/pom.xml'
+ - '.github/workflows/test-platforms.yml'
jobs:
# ============================================================================
@@ -81,15 +83,44 @@ jobs:
retention-days: 7
# ============================================================================
- # Test JAR on all platforms
+ # Stage 2: Unit Tests (run once on ubuntu-24.04)
+ # ============================================================================
+
+ unit-tests:
+ name: Unit Tests
+ needs: build-jar
+ runs-on: ubuntu-24.04
+
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v4
+
+ - name: Set up JDK 17
+ uses: actions/setup-java@v4
+ with:
+ distribution: 'temurin'
+ java-version: '17'
+ cache: 'maven'
+
+ - name: Download core JAR artifact
+ uses: actions/download-artifact@v4
+ with:
+ name: libre2-core-jar
+ path: libre2-core/target/
+
+ - name: Run unit tests
+ run: mvn test -pl libre2-core -B
+
+ # ============================================================================
+ # Stage 3: Integration Tests (all platforms)
# ============================================================================
# ============================================================================
- # macOS Tests
+ # macOS Integration Tests
# ============================================================================
- test-macos-x86_64:
- name: Test macOS x86_64 (Intel)
- needs: build-jar
+ integration-macos-x86_64:
+ name: Integration Test macOS x86_64 (Intel)
+ needs: unit-tests
runs-on: macos-15-intel
steps:
@@ -114,17 +145,17 @@ jobs:
echo "Checking darwin-x86_64 library in JAR:"
unzip -l libre2-core/target/libre2-core-1.0.0.jar | grep "darwin-x86_64/libre2.dylib"
- - name: Run tests (multi-module)
- run: mvn test -B
+ - name: Run integration tests (multi-module)
+ run: mvn failsafe:integration-test failsafe:verify -pl libre2-core -B
- name: Verify platform detection
run: |
echo "Checking test logs for platform detection:"
- cat libre2-core/libre2-core/target/surefire-reports/*.txt | grep "darwin-x86_64" || echo "✅ Tests passed on darwin-x86_64"
+ cat libre2-core/libre2-core/target/surefire-reports/*.txt | grep "darwin-x86_64" || echo "✅ Integration tests passed on darwin-x86_64"
- test-macos-aarch64:
- name: Test macOS aarch64 (Apple Silicon)
- needs: build-jar
+ integration-macos-aarch64:
+ name: Integration Test macOS aarch64 (Apple Silicon)
+ needs: unit-tests
runs-on: macos-latest
steps:
@@ -149,20 +180,20 @@ jobs:
echo "Checking darwin-aarch64 library in JAR:"
unzip -l libre2-core/target/libre2-core-1.0.0.jar | grep "darwin-aarch64/libre2.dylib"
- - name: Run tests with JAR
- run: mvn test -B
+ - name: Run integration tests with JAR
+ run: mvn failsafe:integration-test failsafe:verify -pl libre2-core -B
- name: Verify platform detection
run: |
- echo "✅ Tests passed on darwin-aarch64"
+ echo "✅ Integration tests passed on darwin-aarch64"
# ============================================================================
- # Linux Tests (Debian-based: Ubuntu LTS versions)
+ # Linux Integration Tests (Debian-based: Ubuntu LTS versions)
# ============================================================================
- test-linux-ubuntu-2004-x86_64:
- name: Test Linux Ubuntu 20.04 x86_64
- needs: build-jar
+ integration-linux-ubuntu-2004-x86_64:
+ name: Integration Test Linux Ubuntu 20.04 x86_64
+ needs: unit-tests
runs-on: ubuntu-latest
steps:
@@ -208,15 +239,15 @@ jobs:
echo 'Checking linux-x86_64 library in JAR:'
unzip -l libre2-core/target/libre2-core-1.0.0.jar | grep 'linux-x86_64/libre2.so'
- # Run tests
- ./mvnw test -B
+ # Run integration tests
+ ./mvnw failsafe:integration-test failsafe:verify -pl libre2-core -B
- echo '✅ Tests passed on Ubuntu 20.04 linux-x86_64'
+ echo '✅ Integration tests passed on Ubuntu 20.04 linux-x86_64'
"
- test-linux-ubuntu-2204-x86_64:
- name: Test Linux Ubuntu 22.04 x86_64
- needs: build-jar
+ integration-linux-ubuntu-2204-x86_64:
+ name: Integration Test Linux Ubuntu 22.04 x86_64
+ needs: unit-tests
runs-on: ubuntu-latest
steps:
@@ -241,16 +272,16 @@ jobs:
echo "Checking linux-x86_64 library in JAR:"
unzip -l libre2-core/target/libre2-core-1.0.0.jar | grep "linux-x86_64/libre2.so"
- - name: Run tests with JAR
- run: mvn test -B
+ - name: Run integration tests with JAR
+ run: mvn failsafe:integration-test failsafe:verify -pl libre2-core -B
- name: Verify platform detection
run: |
- echo "✅ Tests passed on Ubuntu 22.04 linux-x86_64"
+ echo "✅ Integration tests passed on Ubuntu 22.04 linux-x86_64"
- test-linux-ubuntu-2404-x86_64:
- name: Test Linux Ubuntu 24.04 x86_64
- needs: build-jar
+ integration-linux-ubuntu-2404-x86_64:
+ name: Integration Test Linux Ubuntu 24.04 x86_64
+ needs: unit-tests
runs-on: ubuntu-latest
steps:
@@ -290,19 +321,19 @@ jobs:
echo 'Checking linux-x86_64 library in JAR:'
unzip -l libre2-core/target/libre2-core-1.0.0.jar | grep 'linux-x86_64/libre2.so'
- # Run tests
- ./mvnw test -B
+ # Run integration tests
+ ./mvnw failsafe:integration-test failsafe:verify -pl libre2-core -B
- echo '✅ Tests passed on Ubuntu 24.04 linux-x86_64'
+ echo '✅ Integration tests passed on Ubuntu 24.04 linux-x86_64'
"
# ============================================================================
- # Linux Tests (RHEL-based: Rocky Linux versions)
+ # Linux Integration Tests (RHEL-based: Rocky Linux versions)
# ============================================================================
- test-linux-rocky-8-x86_64:
- name: Test Linux Rocky 8 x86_64
- needs: build-jar
+ integration-linux-rocky-8-x86_64:
+ name: Integration Test Linux Rocky 8 x86_64
+ needs: unit-tests
runs-on: ubuntu-latest
steps:
@@ -345,15 +376,15 @@ jobs:
echo 'Checking linux-x86_64 library in JAR:'
unzip -l libre2-core/target/libre2-core-1.0.0.jar | grep 'linux-x86_64/libre2.so'
- # Run tests
- ./mvnw test -B
+ # Run integration tests
+ ./mvnw failsafe:integration-test failsafe:verify -pl libre2-core -B
- echo '✅ Tests passed on Rocky Linux 8 x86_64'
+ echo '✅ Integration tests passed on Rocky Linux 8 x86_64'
"
- test-linux-rocky-9-x86_64:
- name: Test Linux Rocky 9 x86_64
- needs: build-jar
+ integration-linux-rocky-9-x86_64:
+ name: Integration Test Linux Rocky 9 x86_64
+ needs: unit-tests
runs-on: ubuntu-latest
steps:
@@ -397,15 +428,22 @@ jobs:
echo 'Checking linux-x86_64 library in JAR:'
unzip -l libre2-core/target/libre2-core-1.0.0.jar | grep 'linux-x86_64/libre2.so'
- # Run tests
- ./mvnw test -B
+ # Run integration tests
+ ./mvnw failsafe:integration-test failsafe:verify -pl libre2-core -B
- echo '✅ Tests passed on Rocky Linux 9 x86_64'
+ echo '✅ Integration tests passed on Rocky Linux 9 x86_64'
"
- test-linux-ubuntu-2204-aarch64:
- name: Test Linux Ubuntu 22.04 aarch64 (ARM64)
- needs: build-jar
+ integration-linux-ubuntu-2204-aarch64:
+ name: "Final Validation: Ubuntu 22.04 aarch64 (QEMU)"
+ needs:
+ - performance-macos-x86_64
+ - performance-macos-aarch64
+ - performance-linux-ubuntu-2004-x86_64
+ - performance-linux-ubuntu-2204-x86_64
+ - performance-linux-ubuntu-2404-x86_64
+ - performance-linux-rocky-8-x86_64
+ - performance-linux-rocky-9-x86_64
runs-on: ubuntu-latest
steps:
@@ -448,15 +486,22 @@ jobs:
echo 'Checking linux-aarch64 library in JAR:'
unzip -l libre2-core/target/libre2-core-1.0.0.jar | grep 'linux-aarch64/libre2.so'
- # Run tests
- ./mvnw test -B
+ # Run integration tests
+ ./mvnw failsafe:integration-test failsafe:verify -pl libre2-core -B
- echo '✅ Tests passed on Ubuntu 22.04 linux-aarch64'
+ echo '✅ Integration tests passed on Ubuntu 22.04 linux-aarch64'
"
- test-linux-ubuntu-2404-aarch64:
- name: Test Linux Ubuntu 24.04 aarch64 (ARM64)
- needs: build-jar
+ integration-linux-ubuntu-2404-aarch64:
+ name: "Final Validation: Ubuntu 24.04 aarch64 (QEMU)"
+ needs:
+ - performance-macos-x86_64
+ - performance-macos-aarch64
+ - performance-linux-ubuntu-2004-x86_64
+ - performance-linux-ubuntu-2204-x86_64
+ - performance-linux-ubuntu-2404-x86_64
+ - performance-linux-rocky-8-x86_64
+ - performance-linux-rocky-9-x86_64
runs-on: ubuntu-latest
steps:
@@ -503,15 +548,22 @@ jobs:
echo 'Checking linux-aarch64 library in JAR:'
unzip -l libre2-core/target/libre2-core-1.0.0.jar | grep 'linux-aarch64/libre2.so'
- # Run tests
- ./mvnw test -B
+ # Run integration tests
+ ./mvnw failsafe:integration-test failsafe:verify -pl libre2-core -B
- echo '✅ Tests passed on Ubuntu 24.04 linux-aarch64'
+ echo '✅ Integration tests passed on Ubuntu 24.04 linux-aarch64'
"
- test-linux-rocky-9-aarch64:
- name: Test Linux Rocky 9 aarch64 (ARM64)
- needs: build-jar
+ integration-linux-rocky-9-aarch64:
+ name: "Final Validation: Rocky 9 aarch64 (QEMU)"
+ needs:
+ - performance-macos-x86_64
+ - performance-macos-aarch64
+ - performance-linux-ubuntu-2004-x86_64
+ - performance-linux-ubuntu-2204-x86_64
+ - performance-linux-ubuntu-2404-x86_64
+ - performance-linux-rocky-8-x86_64
+ - performance-linux-rocky-9-x86_64
runs-on: ubuntu-latest
steps:
@@ -561,29 +613,402 @@ jobs:
echo 'Checking linux-aarch64 library in JAR:'
unzip -l libre2-core/target/libre2-core-1.0.0.jar | grep 'linux-aarch64/libre2.so'
- # Run tests
- ./mvnw test -B
+ # Run integration tests
+ ./mvnw failsafe:integration-test failsafe:verify -pl libre2-core -B
- echo '✅ Tests passed on Rocky Linux 9 aarch64'
+ echo '✅ Integration tests passed on Rocky Linux 9 aarch64'
"
# ============================================================================
- # Summary
+ # Stage 4: Performance Tests (all platforms)
+ # ============================================================================
+ # ============================================================================
+ # macOS Performance Tests
+ # ============================================================================
+
+ performance-macos-x86_64:
+ name: Performance Test macOS x86_64 (Intel)
+ needs:
+ - integration-macos-x86_64
+ - integration-macos-aarch64
+ - integration-linux-ubuntu-2004-x86_64
+ - integration-linux-ubuntu-2204-x86_64
+ - integration-linux-ubuntu-2404-x86_64
+ - integration-linux-rocky-8-x86_64
+ - integration-linux-rocky-9-x86_64
+ runs-on: macos-15-intel
+
+ steps:
+ - name: Checkout code (for tests)
+ uses: actions/checkout@v4
+
+ - name: Set up JDK 17
+ uses: actions/setup-java@v4
+ with:
+ distribution: 'temurin'
+ java-version: '17'
+ cache: 'maven'
+
+ - name: Download core JAR artifact
+ uses: actions/download-artifact@v4
+ with:
+ name: libre2-core-jar
+ path: libre2-core/target/
+
+ - name: Verify native library in JAR
+ run: |
+ echo "Checking darwin-x86_64 library in JAR:"
+ unzip -l libre2-core/target/libre2-core-1.0.0.jar | grep "darwin-x86_64/libre2.dylib"
+
+ - name: Run performance tests
+ run: mvn install -DskipTests -B && mvn test -pl perf-test -B
+
+ - name: Verify platform detection
+ run: |
+ echo "✅ Performance tests passed on darwin-x86_64"
+
+ performance-macos-aarch64:
+ name: Performance Test macOS aarch64 (Apple Silicon)
+ needs:
+ - integration-macos-x86_64
+ - integration-macos-aarch64
+ - integration-linux-ubuntu-2004-x86_64
+ - integration-linux-ubuntu-2204-x86_64
+ - integration-linux-ubuntu-2404-x86_64
+ - integration-linux-rocky-8-x86_64
+ - integration-linux-rocky-9-x86_64
+ runs-on: macos-latest
+
+ steps:
+ - name: Checkout code (for tests)
+ uses: actions/checkout@v4
+
+ - name: Set up JDK 17
+ uses: actions/setup-java@v4
+ with:
+ distribution: 'temurin'
+ java-version: '17'
+ cache: 'maven'
+
+ - name: Download JAR artifact
+ uses: actions/download-artifact@v4
+ with:
+ name: libre2-core-jar
+ path: libre2-core/target/
+
+ - name: Verify native library in JAR
+ run: |
+ echo "Checking darwin-aarch64 library in JAR:"
+ unzip -l libre2-core/target/libre2-core-1.0.0.jar | grep "darwin-aarch64/libre2.dylib"
+
+ - name: Run performance tests with JAR
+ run: mvn install -DskipTests -B && mvn test -pl perf-test -B
+
+ - name: Verify platform detection
+ run: |
+ echo "✅ Performance tests passed on darwin-aarch64"
+
+ # ============================================================================
+ # Linux Performance Tests (Debian-based: Ubuntu LTS versions)
+ # ============================================================================
+
+ performance-linux-ubuntu-2004-x86_64:
+ name: Performance Test Linux Ubuntu 20.04 x86_64
+ needs:
+ - integration-macos-x86_64
+ - integration-macos-aarch64
+ - integration-linux-ubuntu-2004-x86_64
+ - integration-linux-ubuntu-2204-x86_64
+ - integration-linux-ubuntu-2404-x86_64
+ - integration-linux-rocky-8-x86_64
+ - integration-linux-rocky-9-x86_64
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: Checkout code (for tests)
+ uses: actions/checkout@v4
+
+ - name: Download JAR artifact
+ uses: actions/download-artifact@v4
+ with:
+ name: libre2-core-jar
+ path: libre2-core/target/
+
+ - name: Cache Maven dependencies
+ uses: actions/cache@v4
+ with:
+ path: ~/.m2/repository
+ key: maven-${{ hashFiles('pom.xml') }}
+ restore-keys: maven-
+
+ - name: Test in Ubuntu 20.04 container
+ run: |
+ docker run --rm \
+ -v "$(pwd):/workspace" \
+ -v ~/.m2:/root/.m2 \
+ -w /workspace \
+ ubuntu:20.04 \
+ bash -c "
+ set -e
+ # Install JDK 17 from AdoptOpenJDK
+ apt-get update
+ apt-get install -y wget apt-transport-https gnupg unzip
+
+ # Add Adoptium repository
+ wget -qO - https://packages.adoptium.net/artifactory/api/gpg/key/public | apt-key add -
+ echo 'deb https://packages.adoptium.net/artifactory/deb focal main' > /etc/apt/sources.list.d/adoptium.list
+ apt-get update
+ apt-get install -y temurin-17-jdk
+
+ # Verify Java
+ java -version
+
+ # Verify native library in JAR
+ echo 'Checking linux-x86_64 library in JAR:'
+ unzip -l libre2-core/target/libre2-core-1.0.0.jar | grep 'linux-x86_64/libre2.so'
+
+ # Run performance tests
+ ./mvnw install -DskipTests -B && ./mvnw test -pl perf-test -B
+
+ echo '✅ Performance tests passed on Ubuntu 20.04 linux-x86_64'
+ "
+
+ performance-linux-ubuntu-2204-x86_64:
+ name: Performance Test Linux Ubuntu 22.04 x86_64
+ needs:
+ - integration-macos-x86_64
+ - integration-macos-aarch64
+ - integration-linux-ubuntu-2004-x86_64
+ - integration-linux-ubuntu-2204-x86_64
+ - integration-linux-ubuntu-2404-x86_64
+ - integration-linux-rocky-8-x86_64
+ - integration-linux-rocky-9-x86_64
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: Checkout code (for tests)
+ uses: actions/checkout@v4
+
+ - name: Set up JDK 17
+ uses: actions/setup-java@v4
+ with:
+ distribution: 'temurin'
+ java-version: '17'
+ cache: 'maven'
+
+ - name: Download JAR artifact
+ uses: actions/download-artifact@v4
+ with:
+ name: libre2-core-jar
+ path: libre2-core/target/
+
+ - name: Verify native library in JAR
+ run: |
+ echo "Checking linux-x86_64 library in JAR:"
+ unzip -l libre2-core/target/libre2-core-1.0.0.jar | grep "linux-x86_64/libre2.so"
+
+ - name: Run performance tests with JAR
+ run: mvn install -DskipTests -B && mvn test -pl perf-test -B
+
+ - name: Verify platform detection
+ run: |
+ echo "✅ Performance tests passed on Ubuntu 22.04 linux-x86_64"
+
+ performance-linux-ubuntu-2404-x86_64:
+ name: Performance Test Linux Ubuntu 24.04 x86_64
+ needs:
+ - integration-macos-x86_64
+ - integration-macos-aarch64
+ - integration-linux-ubuntu-2004-x86_64
+ - integration-linux-ubuntu-2204-x86_64
+ - integration-linux-ubuntu-2404-x86_64
+ - integration-linux-rocky-8-x86_64
+ - integration-linux-rocky-9-x86_64
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: Checkout code (for tests)
+ uses: actions/checkout@v4
+
+ - name: Download JAR artifact
+ uses: actions/download-artifact@v4
+ with:
+ name: libre2-core-jar
+ path: libre2-core/target/
+
+ - name: Cache Maven dependencies
+ uses: actions/cache@v4
+ with:
+ path: ~/.m2/repository
+ key: maven-${{ hashFiles('pom.xml') }}
+ restore-keys: maven-
+
+ - name: Test in Ubuntu 24.04 container
+ run: |
+ docker run --rm \
+ -v "$(pwd):/workspace" \
+ -v ~/.m2:/root/.m2 \
+ -w /workspace \
+ ubuntu:24.04 \
+ bash -c "
+ set -e
+ # Install JDK 17
+ apt-get update
+ apt-get install -y openjdk-17-jdk unzip
+
+ # Verify Java
+ java -version
+
+ # Verify native library in JAR
+ echo 'Checking linux-x86_64 library in JAR:'
+ unzip -l libre2-core/target/libre2-core-1.0.0.jar | grep 'linux-x86_64/libre2.so'
+
+ # Run performance tests
+ ./mvnw install -DskipTests -B && ./mvnw test -pl perf-test -B
+
+ echo '✅ Performance tests passed on Ubuntu 24.04 linux-x86_64'
+ "
+
+ # ============================================================================
+ # Linux Performance Tests (RHEL-based: Rocky Linux versions)
+ # ============================================================================
+
+ performance-linux-rocky-8-x86_64:
+ name: Performance Test Linux Rocky 8 x86_64
+ needs:
+ - integration-macos-x86_64
+ - integration-macos-aarch64
+ - integration-linux-ubuntu-2004-x86_64
+ - integration-linux-ubuntu-2204-x86_64
+ - integration-linux-ubuntu-2404-x86_64
+ - integration-linux-rocky-8-x86_64
+ - integration-linux-rocky-9-x86_64
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: Checkout code (for tests)
+ uses: actions/checkout@v4
+
+ - name: Download JAR artifact
+ uses: actions/download-artifact@v4
+ with:
+ name: libre2-core-jar
+ path: libre2-core/target/
+
+ - name: Cache Maven dependencies
+ uses: actions/cache@v4
+ with:
+ path: ~/.m2/repository
+ key: maven-${{ hashFiles('pom.xml') }}
+ restore-keys: maven-
+
+ - name: Test in Rocky Linux 8 container
+ run: |
+ docker run --rm \
+ -v "$(pwd):/workspace" \
+ -v ~/.m2:/root/.m2 \
+ -w /workspace \
+ rockylinux:8 \
+ bash -c "
+ set -e
+ # Install JDK 17
+ dnf install -y java-17-openjdk java-17-openjdk-devel unzip
+
+ # Set JAVA_HOME
+ export JAVA_HOME=/usr/lib/jvm/java-17-openjdk
+ export PATH=\$JAVA_HOME/bin:\$PATH
+
+ # Verify Java
+ java -version
+
+ # Verify native library in JAR
+ echo 'Checking linux-x86_64 library in JAR:'
+ unzip -l libre2-core/target/libre2-core-1.0.0.jar | grep 'linux-x86_64/libre2.so'
+
+ # Run performance tests
+ ./mvnw install -DskipTests -B && ./mvnw test -pl perf-test -B
+
+ echo '✅ Performance tests passed on Rocky Linux 8 x86_64'
+ "
+
+ performance-linux-rocky-9-x86_64:
+ name: Performance Test Linux Rocky 9 x86_64
+ needs:
+ - integration-macos-x86_64
+ - integration-macos-aarch64
+ - integration-linux-ubuntu-2004-x86_64
+ - integration-linux-ubuntu-2204-x86_64
+ - integration-linux-ubuntu-2404-x86_64
+ - integration-linux-rocky-8-x86_64
+ - integration-linux-rocky-9-x86_64
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: Checkout code (for tests)
+ uses: actions/checkout@v4
+
+ - name: Download JAR artifact
+ uses: actions/download-artifact@v4
+ with:
+ name: libre2-core-jar
+ path: libre2-core/target/
+
+ - name: Cache Maven dependencies
+ uses: actions/cache@v4
+ with:
+ path: ~/.m2/repository
+ key: maven-${{ hashFiles('pom.xml') }}
+ restore-keys: maven-
+
+ - name: Test in Rocky Linux container
+ run: |
+ # Run tests in Rocky Linux 9 container with JDK 17
+ docker run --rm \
+ -v "$(pwd):/workspace" \
+ -v ~/.m2:/root/.m2 \
+ -w /workspace \
+ rockylinux:9 \
+ bash -c "
+ set -e
+ # Install JDK 17
+ dnf install -y java-17-openjdk java-17-openjdk-devel unzip
+
+ # Set JAVA_HOME
+ export JAVA_HOME=/usr/lib/jvm/java-17-openjdk
+ export PATH=\$JAVA_HOME/bin:\$PATH
+
+ # Verify Java
+ java -version
+
+ # Verify native library in JAR
+ echo 'Checking linux-x86_64 library in JAR:'
+ unzip -l libre2-core/target/libre2-core-1.0.0.jar | grep 'linux-x86_64/libre2.so'
+
+ # Run performance tests
+ ./mvnw install -DskipTests -B && ./mvnw test -pl perf-test -B
+
+ echo '✅ Performance tests passed on Rocky Linux 9 x86_64'
+ "
+
+ # ============================================================================
+ # Final Summary
# ============================================================================
all-platforms-tested:
name: All Platforms Tested
needs:
- - test-macos-x86_64
- - test-macos-aarch64
- - test-linux-ubuntu-2004-x86_64
- - test-linux-ubuntu-2204-x86_64
- - test-linux-ubuntu-2404-x86_64
- - test-linux-ubuntu-2204-aarch64
- - test-linux-ubuntu-2404-aarch64
- - test-linux-rocky-8-x86_64
- - test-linux-rocky-9-x86_64
- - test-linux-rocky-9-aarch64
+ # 7 performance jobs
+ - performance-macos-x86_64
+ - performance-macos-aarch64
+ - performance-linux-ubuntu-2004-x86_64
+ - performance-linux-ubuntu-2204-x86_64
+ - performance-linux-ubuntu-2404-x86_64
+ - performance-linux-rocky-8-x86_64
+ - performance-linux-rocky-9-x86_64
+ # 3 final ARM64 validation jobs
+ - integration-linux-ubuntu-2204-aarch64
+ - integration-linux-ubuntu-2404-aarch64
+ - integration-linux-rocky-9-aarch64
runs-on: ubuntu-latest
steps:
@@ -591,22 +1016,17 @@ jobs:
run: |
echo "✅ All platform tests passed!"
echo ""
- echo "Verified platforms (10 total):"
+ echo "4-Stage CI Pipeline Complete:"
+ echo " Stage 1: Build JAR ✓"
+ echo " Stage 2: Unit Tests (22 tests, Ubuntu 24.04) ✓"
+ echo " Stage 3: Integration Tests (428 tests × 7 platforms) ✓"
+ echo " Stage 4: Performance Tests (11 tests × 7 platforms) ✓"
+ echo " Final: ARM64 Integration Tests (428 tests × 3 QEMU platforms) ✓"
echo ""
- echo "macOS:"
+ echo "Platforms tested:"
echo " - macOS x86_64 (Intel)"
echo " - macOS aarch64 (Apple Silicon)"
- echo ""
- echo "Ubuntu (Debian-based):"
- echo " - Ubuntu 20.04 x86_64"
- echo " - Ubuntu 22.04 x86_64"
- echo " - Ubuntu 22.04 aarch64"
- echo " - Ubuntu 24.04 x86_64"
- echo " - Ubuntu 24.04 aarch64"
- echo ""
- echo "Rocky Linux (RHEL-based):"
- echo " - Rocky 8 x86_64"
- echo " - Rocky 9 x86_64"
- echo " - Rocky 9 aarch64"
- echo ""
- echo "All native libraries load and function correctly!"
+ echo " - Linux Ubuntu 20.04/22.04/24.04 x86_64"
+ echo " - Linux Rocky 8/9 x86_64"
+ echo " - Linux Ubuntu 22.04/24.04 aarch64 (QEMU, final validation)"
+ echo " - Linux Rocky 9 aarch64 (QEMU, final validation)"
diff --git a/TEST_RESTRUCTURE_SUMMARY.md b/TEST_RESTRUCTURE_SUMMARY.md
new file mode 100644
index 0000000..6985b54
--- /dev/null
+++ b/TEST_RESTRUCTURE_SUMMARY.md
@@ -0,0 +1,166 @@
+# Test Restructuring Summary
+
+**Branch:** feature/integration-test-separation
+**Date:** 2025-11-26
+**Purpose:** Separate unit, integration, and performance tests with proper Maven lifecycle and CI pipeline
+
+---
+
+## Changes Made
+
+### 1. Test Separation by Type
+
+**Unit Tests** (src/test/java): 3 test classes, 22 test methods
+- `HelloWorldTest` (2 tests) - Sample unit test
+- `ConfigurationTest` (14 tests) - RE2Config builder validation
+- `RE2MetricsConfigTest` (6 tests) - Metrics config factories
+- `TestUtils.java` (helper class, not a test)
+
+**Integration Tests** (src/integration-test/java): 25 test classes, 428 test methods
+- Renamed from *Test.java → *IT.java (Maven Failsafe convention)
+- Moved from src/test to src/integration-test
+- Includes: API tests, cache tests, JNI tests, metrics tests, dropwizard tests
+- Plus 3 stress tests moved back from perf-test module
+
+**Performance Tests** (perf-test module): 3 test classes, 11 test methods
+- `BulkMatchingPerformanceTest` (3 tests)
+- `CachePerformanceTest` (4 tests)
+- `StressTest` (4 tests)
+
+**Total:** 31 test files, 461 test methods (was 459, added HelloWorldTest +2)
+
+---
+
+### 2. Maven Configuration
+
+**libre2-core/pom.xml:**
+- ✅ maven-surefire-plugin: Runs unit tests from src/test/java
+- ✅ maven-failsafe-plugin: Runs integration tests from src/integration-test/java (*IT.java)
+- ✅ build-helper-maven-plugin: Adds src/integration-test/java as test source
+- ✅ test-jar: Shares TestUtils with other modules
+
+**Build Commands:**
+```bash
+mvn test # Unit tests only (22 tests, ~1s)
+mvn integration-test # Unit + Integration (450 tests, ~30s)
+mvn verify # All tests (461 tests, ~60s)
+mvn test -pl perf-test # Performance tests (11 tests)
+```
+
+---
+
+### 3. CI Pipeline Restructure
+
+**New 5-Stage Pipeline:**
+
+```
+Stage 1: Build JAR
+ ├─ ubuntu-latest
+ ├─ Build all modules
+ ├─ Duration: ~26s
+ └─ Upload artifacts
+ ↓
+Stage 2: Unit Tests
+ ├─ ubuntu-24.04 (once)
+ ├─ Command: mvn test -pl libre2-core -B
+ ├─ Tests: 22 unit tests
+ └─ Duration: ~1s
+ ↓
+Stage 3: Integration Tests (7 platforms in parallel)
+ ├─ macOS x86_64, macOS aarch64
+ ├─ Linux Ubuntu 20.04/22.04/24.04 x86_64
+ ├─ Linux Rocky 8/9 x86_64
+ ├─ Command: mvn failsafe:integration-test failsafe:verify -pl libre2-core -B
+ ├─ Tests: 428 integration tests per platform
+ └─ Duration: ~30-60s per platform
+ ↓
+Stage 4: Performance Tests (7 platforms in parallel)
+ ├─ Same 7 platforms as integration
+ ├─ Command: mvn install -DskipTests -B && mvn test -pl perf-test -B
+ ├─ Tests: 11 performance tests per platform
+ └─ Duration: ~10-20s per platform
+ ↓
+Stage 5: ARM64 Final Validation (3 QEMU platforms in parallel)
+ ├─ Ubuntu 22.04 aarch64, Ubuntu 24.04 aarch64, Rocky 9 aarch64
+ ├─ Command: ./mvnw integration-test -B (Docker QEMU)
+ ├─ Tests: 428 integration tests per platform
+ ├─ Duration: ~5-10 minutes per platform (QEMU slow)
+ └─ Note: Performance tests skipped on ARM64 (QEMU data meaningless)
+ ↓
+Final: All Platforms Tested
+ └─ Summary of all passed stages
+```
+
+**Total Jobs:** 20
+- 1 build
+- 1 unit test
+- 7 integration tests
+- 7 performance tests
+- 3 ARM64 final validation
+- 1 summary
+
+---
+
+### 4. Key Optimizations
+
+**QEMU ARM64 Optimization:**
+- Moved slow QEMU-based ARM64 platforms to final stage
+- Skip ARM64 performance tests (data not meaningful on emulation)
+- Run only integration tests on ARM64 as final sanity check
+- Prevents slow ARM64 jobs from blocking fast x86_64/macOS performance tests
+
+**Module Isolation:**
+- Unit tests: Only libre2-core module
+- Integration tests: Only libre2-core module (via Failsafe)
+- Performance tests: Only perf-test module
+- No cross-contamination between test types
+
+**Resource Configuration:**
+- logback-test.xml copied to integration-test/resources and perf-test/resources
+- Test utilities shared via test-jar mechanism
+
+---
+
+### 5. Commits on Branch (8 total)
+
+1. `629f393` - Separate unit and integration tests using Maven conventions
+2. `e2a0c17` - Enable CI for feature branches
+3. `7769409` - CI: Restructure to 4-stage pipeline
+4. `fa85178` - Fix CI performance tests + duplicate Surefire
+5. `8a59d8a` - Fix YAML syntax (quote job names)
+6. `d9bf115` - Fix performance tests: Install entire reactor
+7. `28f35cd` - Fix CI: Isolate test phases to run correct test types
+8. `781a057` - Fix flaky CachePerformanceTest on CI runners
+
+---
+
+## Verification
+
+**Local Build:**
+```bash
+mvn clean verify
+# Tests run: 22 unit + 428 integration + 11 performance = 461 total
+# BUILD SUCCESS
+```
+
+**CI Pipeline (Expected):**
+- Stage 1: Build ✓
+- Stage 2: Unit (22 tests) ✓
+- Stage 3: Integration (428 tests × 7 platforms) ✓
+- Stage 4: Performance (11 tests × 7 platforms) ✓
+- Stage 5: ARM64 Final (428 tests × 3 platforms) ✓
+
+---
+
+## Benefits
+
+1. **Fast Feedback:** Unit tests run in ~1s, fail fast
+2. **Clear Separation:** Each test type has its own directory and lifecycle phase
+3. **Optimized CI:** ARM64 QEMU tests don't block fast platforms
+4. **Scalable:** Easy to add new unit tests without affecting integration/performance
+5. **Maintainable:** Standard Maven conventions (*Test.java for unit, *IT.java for integration)
+6. **Parallel Execution:** Integration and performance tests run in parallel across platforms
+
+---
+
+**Ready for PR to main after CI passes**
diff --git a/libre2-core/pom.xml b/libre2-core/pom.xml
index 67d25e2..3927bb8 100644
--- a/libre2-core/pom.xml
+++ b/libre2-core/pom.xml
@@ -95,6 +95,60 @@
+
IMPORTANT: These tests directly manage native handles.
* Always free handles in @AfterEach to prevent memory leaks.
*/
-class RE2NativeJNITest {
+class RE2NativeJNIIT {
private static PatternCache originalCache;
diff --git a/libre2-core/src/test/java/com/axonops/libre2/metrics/ComprehensiveMetricsTest.java b/libre2-core/src/integration-test/java/com/axonops/libre2/metrics/ComprehensiveMetricsIT.java
similarity index 99%
rename from libre2-core/src/test/java/com/axonops/libre2/metrics/ComprehensiveMetricsTest.java
rename to libre2-core/src/integration-test/java/com/axonops/libre2/metrics/ComprehensiveMetricsIT.java
index 3af622a..7a2d23d 100644
--- a/libre2-core/src/test/java/com/axonops/libre2/metrics/ComprehensiveMetricsTest.java
+++ b/libre2-core/src/integration-test/java/com/axonops/libre2/metrics/ComprehensiveMetricsIT.java
@@ -25,7 +25,7 @@
* Tests that Global = Sum of Specifics for all operation types.
*/
@DisplayName("Comprehensive Metrics Verification")
-class ComprehensiveMetricsTest {
+class ComprehensiveMetricsIT {
private MetricRegistry registry;
private PatternCache originalCache;
diff --git a/libre2-core/src/test/java/com/axonops/libre2/metrics/MetricsIntegrationTest.java b/libre2-core/src/integration-test/java/com/axonops/libre2/metrics/MetricsIntegrationIT.java
similarity index 99%
rename from libre2-core/src/test/java/com/axonops/libre2/metrics/MetricsIntegrationTest.java
rename to libre2-core/src/integration-test/java/com/axonops/libre2/metrics/MetricsIntegrationIT.java
index 9d6f509..b6e805e 100644
--- a/libre2-core/src/test/java/com/axonops/libre2/metrics/MetricsIntegrationTest.java
+++ b/libre2-core/src/integration-test/java/com/axonops/libre2/metrics/MetricsIntegrationIT.java
@@ -21,7 +21,7 @@
* Uses Pattern.setGlobalCache() to inject a test cache with Dropwizard metrics,
* then performs real operations and verifies metrics are updated correctly.
*/
-class MetricsIntegrationTest {
+class MetricsIntegrationIT {
private MetricRegistry registry;
private PatternCache originalCache;
diff --git a/libre2-core/src/test/java/com/axonops/libre2/metrics/NativeMemoryMetricsTest.java b/libre2-core/src/integration-test/java/com/axonops/libre2/metrics/NativeMemoryMetricsIT.java
similarity index 99%
rename from libre2-core/src/test/java/com/axonops/libre2/metrics/NativeMemoryMetricsTest.java
rename to libre2-core/src/integration-test/java/com/axonops/libre2/metrics/NativeMemoryMetricsIT.java
index 0352040..c946c48 100644
--- a/libre2-core/src/test/java/com/axonops/libre2/metrics/NativeMemoryMetricsTest.java
+++ b/libre2-core/src/integration-test/java/com/axonops/libre2/metrics/NativeMemoryMetricsIT.java
@@ -16,7 +16,7 @@
*
* Verifies that memory gauges accurately track native memory allocation and deallocation.
*/
-class NativeMemoryMetricsTest {
+class NativeMemoryMetricsIT {
private MetricRegistry registry;
private PatternCache originalCache;
diff --git a/libre2-core/src/test/java/com/axonops/libre2/metrics/TimerHistogramTest.java b/libre2-core/src/integration-test/java/com/axonops/libre2/metrics/TimerHistogramIT.java
similarity index 99%
rename from libre2-core/src/test/java/com/axonops/libre2/metrics/TimerHistogramTest.java
rename to libre2-core/src/integration-test/java/com/axonops/libre2/metrics/TimerHistogramIT.java
index 519880c..c7fd687 100644
--- a/libre2-core/src/test/java/com/axonops/libre2/metrics/TimerHistogramTest.java
+++ b/libre2-core/src/integration-test/java/com/axonops/libre2/metrics/TimerHistogramIT.java
@@ -23,7 +23,7 @@
* - Percentiles: 75th, 95th, 98th, 99th, 99.9th
* - Rates: 1-min, 5-min, 15-min moving averages
*/
-class TimerHistogramTest {
+class TimerHistogramIT {
private MetricRegistry registry;
private PatternCache originalCache;
diff --git a/libre2-core/src/integration-test/resources/logback-test.xml b/libre2-core/src/integration-test/resources/logback-test.xml
new file mode 100644
index 0000000..6d2c57a
--- /dev/null
+++ b/libre2-core/src/integration-test/resources/logback-test.xml
@@ -0,0 +1,20 @@
+
+
+