aboutsummaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2025-12-01 15:40:06 -0800
committerChris Lu <chris.lu@gmail.com>2025-12-01 15:40:06 -0800
commita33e5a9e6a696049e8f0e1b62b9e3ded8201675f (patch)
treee7c00ed4b445b36a8f1bea284d834143db874198 /.github
parent8c585a9682748353c78b96e5f55238074497b35a (diff)
downloadseaweedfs-a33e5a9e6a696049e8f0e1b62b9e3ded8201675f.tar.xz
seaweedfs-a33e5a9e6a696049e8f0e1b62b9e3ded8201675f.zip
Add S3 object tagging tests to CI workflow
- Modified test/s3/tagging/s3_tagging_test.go to use environment variables for configurable endpoint and credentials - Added s3-tagging-tests job to .github/workflows/s3-go-tests.yml to run tagging tests in CI - Tests will now run automatically on pull requests
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/s3-go-tests.yml111
1 files changed, 111 insertions, 0 deletions
diff --git a/.github/workflows/s3-go-tests.yml b/.github/workflows/s3-go-tests.yml
index 6e04a8d44..556cf534e 100644
--- a/.github/workflows/s3-go-tests.yml
+++ b/.github/workflows/s3-go-tests.yml
@@ -411,4 +411,115 @@ jobs:
path: test/s3/versioning/weed-test*.log
retention-days: 7
+ s3-tagging-tests:
+ name: S3 Tagging Tests
+ runs-on: ubuntu-22.04
+ timeout-minutes: 20
+
+ steps:
+ - name: Check out code
+ uses: actions/checkout@v6
+
+ - name: Set up Go
+ uses: actions/setup-go@v6
+ with:
+ go-version-file: 'go.mod'
+ id: go
+
+ - name: Install SeaweedFS
+ run: |
+ go install -buildvcs=false
+
+ - name: Run S3 Tagging Tests
+ timeout-minutes: 15
+ run: |
+ cd weed
+ set -x
+ # Create clean data directory for this test run
+ export WEED_DATA_DIR="/tmp/seaweedfs-tagging-test-$(date +%s)"
+ mkdir -p "$WEED_DATA_DIR"
+ weed server -filer -filer.maxMB=64 -s3 -ip.bind 0.0.0.0 \
+ -dir="$WEED_DATA_DIR" \
+ -master.raftHashicorp -master.electionTimeout 1s -master.volumeSizeLimitMB=100 \
+ -volume.max=100 -volume.preStopSeconds=1 \
+ -master.port=9338 -volume.port=8084 -filer.port=8893 -s3.port=8006 -metricsPort=9329 \
+ -s3.allowEmptyFolder=false -s3.allowDeleteBucketNotEmpty=true -s3.config="$GITHUB_WORKSPACE/docker/compose/s3.json" -master.peers=none &
+ pid=$!
+
+ # Wait for all SeaweedFS components to be ready
+ echo "Waiting for SeaweedFS components to start..."
+ for i in {1..30}; do
+ if curl -s http://localhost:9338/cluster/status > /dev/null 2>&1; then
+ echo "Master server is ready"
+ break
+ fi
+ echo "Waiting for master server... ($i/30)"
+ sleep 2
+ done
+
+ for i in {1..30}; do
+ if curl -s http://localhost:8084/status > /dev/null 2>&1; then
+ echo "Volume server is ready"
+ break
+ fi
+ echo "Waiting for volume server... ($i/30)"
+ sleep 2
+ done
+
+ for i in {1..30}; do
+ if curl -s http://localhost:8893/ > /dev/null 2>&1; then
+ echo "Filer is ready"
+ break
+ fi
+ echo "Waiting for filer... ($i/30)"
+ sleep 2
+ done
+
+ for i in {1..30}; do
+ if curl -s http://localhost:8006/ > /dev/null 2>&1; then
+ echo "S3 server is ready"
+ break
+ fi
+ echo "Waiting for S3 server... ($i/30)"
+ sleep 2
+ done
+
+ echo "All SeaweedFS components are ready!"
+ cd ../test/s3/tagging
+
+ # Set environment variables for the test
+ export S3_ENDPOINT="http://localhost:8006"
+ export S3_ACCESS_KEY="0555b35654ad1656d804"
+ export S3_SECRET_KEY="h7GhxuBLTrlhVUyxSPUKUV8r/2EI4ngqJxD7iBdBYLhwluN30JaT3Q=="
+
+ # Additional wait for S3-Filer integration to be fully ready
+ echo "Waiting additional 10 seconds for S3-Filer integration..."
+ sleep 10
+
+ # Test S3 connection before running tests
+ echo "Testing S3 connection..."
+ for i in {1..10}; do
+ if curl -s -f http://localhost:8006/ > /dev/null 2>&1; then
+ echo "S3 connection test successful"
+ break
+ fi
+ echo "S3 connection test failed, retrying... ($i/10)"
+ sleep 2
+ done
+
+ echo "✅ S3 server is responding, starting tests..."
+
+ go test -v ./...
+ kill -9 $pid || true
+ # Clean up data directory
+ rm -rf "$WEED_DATA_DIR" || true
+
+ - name: Upload test logs on failure
+ if: failure()
+ uses: actions/upload-artifact@v5
+ with:
+ name: s3-tagging-test-logs
+ path: test/s3/tagging/weed-test*.log
+ retention-days: 3
+
# Removed SSE-C integration tests and compatibility job \ No newline at end of file