Skip to content

fix: Bedrock credential isolation + Setup Wizard apply path hardening… #44

fix: Bedrock credential isolation + Setup Wizard apply path hardening…

fix: Bedrock credential isolation + Setup Wizard apply path hardening… #44

name: NemakiWare Integration Tests
on:
push:
branches: [ master, main, develop, 'release/**' ]
paths:
- 'core/src/main/java/**'
- 'core/src/test/java/**'
- 'core/pom.xml'
- '.github/workflows/integration-tests.yml'
pull_request:
branches: [ master, main, develop ]
paths:
- 'core/src/main/java/**'
- 'core/src/test/java/**'
- 'core/pom.xml'
- '.github/workflows/integration-tests.yml'
jobs:
integration-tests:
name: Integration Tests (VersioningBehaviorTest)
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Java 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
cache: 'maven'
- name: Build NemakiWare Dependencies
run: |
mvn clean install -N -DskipTests -q
mvn clean install -f common/pom.xml -DskipTests -q
mvn clean install -f cloudant-init/pom.xml -DskipTests -q
mvn clean install -f solr/pom.xml -DskipTests -q
- name: Build NemakiWare Core
run: |
mvn clean package -f core/pom.xml -Pdevelopment -DskipTests -q
ls -la core/target/core.war
- name: Start NemakiWare Server
run: |
cd docker
cp ../core/target/core.war core/core.war
docker compose -f docker-compose-simple.yml up -d --build
echo "Waiting for NemakiWare server to be ready..."
SERVER_READY=false
for i in {1..60}; do
if curl -sf -u admin:admin http://localhost:8080/core/atom/bedroom > /dev/null 2>&1; then
echo "NemakiWare server is ready (attempt $i)"
SERVER_READY=true
break
fi
echo "Waiting for server... ($i/60)"
sleep 5
done
if [ "$SERVER_READY" = "false" ]; then
echo "=== Server failed to start ==="
docker compose -f docker-compose-simple.yml ps
docker compose -f docker-compose-simple.yml logs core --tail=200 || true
docker compose -f docker-compose-simple.yml logs couchdb --tail=100 || true
exit 1
fi
- name: Run VersioningBehaviorTest
run: |
timeout 300s mvn test \
-Dtest=VersioningBehaviorTest \
-f core/pom.xml \
-Pdevelopment \
2>&1 | tee test-output.log
# Extract test counts from surefire output
TESTS_RUN=$(grep -oP 'Tests run: \K\d+' test-output.log | tail -1)
SKIPPED=$(grep -oP 'Skipped: \K\d+' test-output.log | tail -1)
FAILURES=$(grep -oP 'Failures: \K\d+' test-output.log | tail -1)
ERRORS=$(grep -oP 'Errors: \K\d+' test-output.log | tail -1)
echo "Tests run: $TESTS_RUN, Failures: $FAILURES, Errors: $ERRORS, Skipped: $SKIPPED"
# Fail if any tests were skipped (server should be available in CI)
if [ "$SKIPPED" != "0" ]; then
echo "::error::VersioningBehaviorTest had $SKIPPED skipped tests. In CI, skip count must be 0."
exit 1
fi
# Fail if any tests failed
if [ "$FAILURES" != "0" ] || [ "$ERRORS" != "0" ]; then
echo "::error::VersioningBehaviorTest had failures or errors."
exit 1
fi
- name: Run Unit Tests
run: |
mvn test \
-Dtest=FilesystemImporterTest,ImportExportResourceTest \
-f core/pom.xml \
-Pdevelopment
- name: Upload surefire reports
uses: actions/upload-artifact@v4
if: always()
with:
name: surefire-reports
path: core/target/surefire-reports/
retention-days: 14
- name: Cleanup
if: always()
run: |
cd docker
docker compose -f docker-compose-simple.yml down
docker system prune -f