mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-10-25 14:30:43 +01:00
* ci(s3tables): tolerate stale FUSE mounts in disk diagnostics * ci(s3tables): bound df diagnostics with timeout, explain once A stale FUSE mount can also hang statfs, not just fail it, so wrap df in timeout 15; one comment at the first site covers all sixteen. * ci: tolerate stale FUSE mounts in df diagnostics elsewhere The same self-hosted runners serve the other workflow files; a bare df -h there can stall or fail a job the same way. * ci: unmount disconnected FUSE test mounts before jobs start * ci: skip FUSE cleanup when the variant checkout is skipped * ci: reclaim the crashed run's test dir once its stale FUSE mount is detached * ci: stop tracking python bytecode for the FUSE cleanup action The helper's __pycache__ slipped into the tree; ignore it so local test runs cannot re-add it. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com> * ci: run the FUSE cleanup action's unit tests on action changes test_cleanup.py was never wired into CI, so a regression in cleanup.py would ship silently. A path-filtered workflow runs it on every change under .github/actions/. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com> * ci: match every FUSE test mount layout in the cleanup action The candidates list only matched seaweedfs_fuse_test_*/mount, so stale mounts left by fuse_failover and fuse_p2p runs (mountN leaves under seaweedfs_fuse_* dirs) and the posix-compliance workflow's fixed /tmp/seaweedfs/mount were never reclaimed and could still wedge df. * ci: run the FUSE mount cleanup in the fuse_failover and fuse_p2p workflows --------- Co-authored-by: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
166 lines
5.2 KiB
YAML
166 lines
5.2 KiB
YAML
name: "S3 Keycloak Integration Tests"
|
|
|
|
on:
|
|
pull_request:
|
|
paths:
|
|
- 'weed/iam/**'
|
|
- 'weed/s3api/**'
|
|
- 'test/s3/iam/**'
|
|
- '.github/workflows/s3-keycloak-tests.yml'
|
|
push:
|
|
branches: [ master ]
|
|
paths:
|
|
- 'weed/iam/**'
|
|
- 'weed/s3api/**'
|
|
- 'test/s3/iam/**'
|
|
- '.github/workflows/s3-keycloak-tests.yml'
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || (github.event_name == 'push' && github.ref) || github.run_id }}
|
|
cancel-in-progress: ${{ github.event_name == 'pull_request' || (github.event_name == 'push' && !startsWith(github.ref, 'refs/tags/')) }}
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
defaults:
|
|
run:
|
|
working-directory: weed
|
|
|
|
jobs:
|
|
# Dedicated job for Keycloak integration tests
|
|
s3-keycloak-integration-tests:
|
|
name: S3 Keycloak Integration Tests
|
|
runs-on: ubuntu-22.04
|
|
timeout-minutes: 30
|
|
|
|
steps:
|
|
- name: Check out code
|
|
uses: actions/checkout@v7
|
|
|
|
- name: Clean up stale FUSE mounts
|
|
uses: ./.github/actions/cleanup-stale-fuse-mounts
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v7
|
|
with:
|
|
go-version-file: 'go.mod'
|
|
cache: ${{ runner.environment == 'github-hosted' }}
|
|
id: go
|
|
|
|
- name: Install SeaweedFS
|
|
working-directory: weed
|
|
run: |
|
|
go install -buildvcs=false
|
|
|
|
- name: Run Keycloak Integration Tests
|
|
timeout-minutes: 25
|
|
working-directory: test/s3/iam
|
|
run: |
|
|
set -x
|
|
echo "=== System Information ==="
|
|
uname -a
|
|
free -h
|
|
timeout 15 df -h || true
|
|
echo "=== Starting S3 Keycloak Integration Tests ==="
|
|
|
|
# Set WEED_BINARY to use the installed version
|
|
export WEED_BINARY=$(which weed)
|
|
export TEST_TIMEOUT=20m
|
|
|
|
echo "Running Keycloak integration tests..."
|
|
# Start Keycloak container first
|
|
docker run -d \
|
|
--name keycloak \
|
|
-p 8080:8080 \
|
|
-e KC_BOOTSTRAP_ADMIN_USERNAME=admin \
|
|
-e KC_BOOTSTRAP_ADMIN_PASSWORD=admin \
|
|
-e KC_HTTP_ENABLED=true \
|
|
-e KC_HOSTNAME_STRICT=false \
|
|
-e KC_HOSTNAME_STRICT_HTTPS=false \
|
|
quay.io/keycloak/keycloak:26.0 \
|
|
start-dev
|
|
|
|
# Wait for Keycloak with better health checking
|
|
timeout 300 bash -c '
|
|
while true; do
|
|
if curl -s http://localhost:8080/health/ready > /dev/null 2>&1; then
|
|
echo "✅ Keycloak health check passed"
|
|
break
|
|
fi
|
|
echo "... waiting for Keycloak to be ready"
|
|
sleep 5
|
|
done
|
|
'
|
|
|
|
# Setup Keycloak configuration
|
|
./setup_keycloak.sh
|
|
|
|
# Start SeaweedFS services
|
|
make clean setup start-services wait-for-services
|
|
|
|
# Verify service accessibility
|
|
echo "=== Verifying Service Accessibility ==="
|
|
curl -f http://localhost:8080/realms/master
|
|
curl -s http://localhost:8333/healthz
|
|
echo "✅ SeaweedFS S3 API is responding (IAM-protected endpoint)"
|
|
|
|
# Run Keycloak-specific tests
|
|
echo "=== Running Keycloak Tests ==="
|
|
export KEYCLOAK_URL=http://localhost:8080
|
|
export S3_ENDPOINT=http://localhost:8333
|
|
|
|
# Wait for realm to be properly configured
|
|
timeout 120 bash -c 'until curl -fs http://localhost:8080/realms/seaweedfs-test/.well-known/openid-configuration > /dev/null; do echo "... waiting for realm"; sleep 3; done'
|
|
|
|
# Run the Keycloak integration tests
|
|
go test -v -timeout 20m -run "TestKeycloak" ./...
|
|
|
|
- name: Show server logs on failure
|
|
if: failure()
|
|
working-directory: test/s3/iam
|
|
run: |
|
|
echo "=== Service Logs ==="
|
|
echo "--- Keycloak logs ---"
|
|
docker logs keycloak --tail=100 || echo "No Keycloak container logs"
|
|
|
|
echo "--- SeaweedFS Master logs ---"
|
|
if [ -f weed-master.log ]; then
|
|
tail -100 weed-master.log
|
|
fi
|
|
|
|
echo "--- SeaweedFS S3 logs ---"
|
|
if [ -f weed-s3.log ]; then
|
|
tail -100 weed-s3.log
|
|
fi
|
|
|
|
echo "--- SeaweedFS Filer logs ---"
|
|
if [ -f weed-filer.log ]; then
|
|
tail -100 weed-filer.log
|
|
fi
|
|
|
|
echo "=== System Status ==="
|
|
ps aux | grep -E "(weed|keycloak)" || true
|
|
netstat -tlnp | grep -E "(8333|9333|8080|8888)" || true
|
|
docker ps -a || true
|
|
|
|
- name: Cleanup
|
|
if: always()
|
|
working-directory: test/s3/iam
|
|
run: |
|
|
# Stop Keycloak container
|
|
docker stop keycloak || true
|
|
docker rm keycloak || true
|
|
|
|
# Stop SeaweedFS services
|
|
make clean || true
|
|
|
|
- name: Upload test logs on failure
|
|
if: failure()
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
name: s3-keycloak-test-logs
|
|
path: |
|
|
test/s3/iam/*.log
|
|
test/s3/iam/test-volume-data/
|
|
retention-days: 3
|