Add pagination stress tests (>1000 versions) to the S3 versioning stress test job in GitHub CI. These tests run on master branch pushes to validate that ListObjectVersions correctly handles objects with more than 1000 versions using pagination.
480 lines
14 KiB
YAML
480 lines
14 KiB
YAML
name: "S3 Go Tests"
|
|
|
|
on:
|
|
pull_request:
|
|
|
|
concurrency:
|
|
group: ${{ github.head_ref }}/s3-go-tests
|
|
cancel-in-progress: true
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
defaults:
|
|
run:
|
|
working-directory: weed
|
|
|
|
jobs:
|
|
s3-versioning-tests:
|
|
name: S3 Versioning Tests
|
|
runs-on: ubuntu-22.04
|
|
timeout-minutes: 30
|
|
strategy:
|
|
matrix:
|
|
test-type: ["quick", "comprehensive"]
|
|
|
|
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 Versioning Tests - ${{ matrix.test-type }}
|
|
timeout-minutes: 25
|
|
working-directory: test/s3/versioning
|
|
run: |
|
|
set -x
|
|
echo "=== System Information ==="
|
|
uname -a
|
|
free -h
|
|
df -h
|
|
echo "=== Starting Tests ==="
|
|
|
|
# Run tests with automatic server management
|
|
# The test-with-server target handles server startup/shutdown automatically
|
|
if [ "${{ matrix.test-type }}" = "quick" ]; then
|
|
# Override TEST_PATTERN for quick tests only
|
|
make test-with-server TEST_PATTERN="TestBucketListReturnDataVersioning|TestVersioningBasicWorkflow|TestVersioningDeleteMarkers"
|
|
else
|
|
# Run all versioning tests
|
|
make test-with-server
|
|
fi
|
|
|
|
- name: Show server logs on failure
|
|
if: failure()
|
|
working-directory: test/s3/versioning
|
|
run: |
|
|
echo "=== Server Logs ==="
|
|
if [ -f weed-test.log ]; then
|
|
echo "Last 100 lines of server logs:"
|
|
tail -100 weed-test.log
|
|
else
|
|
echo "No server log file found"
|
|
fi
|
|
|
|
echo "=== Test Environment ==="
|
|
ps aux | grep -E "(weed|test)" || true
|
|
netstat -tlnp | grep -E "(8333|9333|8080)" || true
|
|
|
|
- name: Upload test logs on failure
|
|
if: failure()
|
|
uses: actions/upload-artifact@v6
|
|
with:
|
|
name: s3-versioning-test-logs-${{ matrix.test-type }}
|
|
path: test/s3/versioning/weed-test*.log
|
|
retention-days: 3
|
|
|
|
s3-versioning-compatibility:
|
|
name: S3 Versioning Compatibility Test
|
|
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 Core Versioning Test (Python s3tests equivalent)
|
|
timeout-minutes: 15
|
|
working-directory: test/s3/versioning
|
|
run: |
|
|
set -x
|
|
echo "=== System Information ==="
|
|
uname -a
|
|
free -h
|
|
|
|
# Run the specific test that is equivalent to the Python s3tests
|
|
make test-with-server || {
|
|
echo "❌ Test failed, checking logs..."
|
|
if [ -f weed-test.log ]; then
|
|
echo "=== Server logs ==="
|
|
tail -100 weed-test.log
|
|
fi
|
|
echo "=== Process information ==="
|
|
ps aux | grep -E "(weed|test)" || true
|
|
exit 1
|
|
}
|
|
|
|
- name: Upload server logs on failure
|
|
if: failure()
|
|
uses: actions/upload-artifact@v6
|
|
with:
|
|
name: s3-versioning-compatibility-logs
|
|
path: test/s3/versioning/weed-test*.log
|
|
retention-days: 3
|
|
|
|
s3-cors-compatibility:
|
|
name: S3 CORS Compatibility Test
|
|
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 Core CORS Test (AWS S3 compatible)
|
|
timeout-minutes: 15
|
|
working-directory: test/s3/cors
|
|
run: |
|
|
set -x
|
|
echo "=== System Information ==="
|
|
uname -a
|
|
free -h
|
|
|
|
# Run the specific test that is equivalent to AWS S3 CORS behavior
|
|
make test-with-server || {
|
|
echo "❌ Test failed, checking logs..."
|
|
if [ -f weed-test.log ]; then
|
|
echo "=== Server logs ==="
|
|
tail -100 weed-test.log
|
|
fi
|
|
echo "=== Process information ==="
|
|
ps aux | grep -E "(weed|test)" || true
|
|
exit 1
|
|
}
|
|
|
|
- name: Upload server logs on failure
|
|
if: failure()
|
|
uses: actions/upload-artifact@v6
|
|
with:
|
|
name: s3-cors-compatibility-logs
|
|
path: test/s3/cors/weed-test*.log
|
|
retention-days: 3
|
|
|
|
s3-retention-tests:
|
|
name: S3 Retention Tests
|
|
runs-on: ubuntu-22.04
|
|
timeout-minutes: 30
|
|
strategy:
|
|
matrix:
|
|
test-type: ["quick", "comprehensive"]
|
|
|
|
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 Retention Tests - ${{ matrix.test-type }}
|
|
timeout-minutes: 25
|
|
working-directory: test/s3/retention
|
|
run: |
|
|
set -x
|
|
echo "=== System Information ==="
|
|
uname -a
|
|
free -h
|
|
df -h
|
|
echo "=== Starting Tests ==="
|
|
|
|
# Run tests with automatic server management
|
|
# The test-with-server target handles server startup/shutdown automatically
|
|
if [ "${{ matrix.test-type }}" = "quick" ]; then
|
|
# Override TEST_PATTERN for quick tests only
|
|
make test-with-server TEST_PATTERN="TestBasicRetentionWorkflow|TestRetentionModeCompliance|TestLegalHoldWorkflow"
|
|
else
|
|
# Run all retention tests
|
|
make test-with-server
|
|
fi
|
|
|
|
- name: Show server logs on failure
|
|
if: failure()
|
|
working-directory: test/s3/retention
|
|
run: |
|
|
echo "=== Server Logs ==="
|
|
if [ -f weed-test.log ]; then
|
|
echo "Last 100 lines of server logs:"
|
|
tail -100 weed-test.log
|
|
else
|
|
echo "No server log file found"
|
|
fi
|
|
|
|
echo "=== Test Environment ==="
|
|
ps aux | grep -E "(weed|test)" || true
|
|
netstat -tlnp | grep -E "(8333|9333|8080)" || true
|
|
|
|
- name: Upload test logs on failure
|
|
if: failure()
|
|
uses: actions/upload-artifact@v6
|
|
with:
|
|
name: s3-retention-test-logs-${{ matrix.test-type }}
|
|
path: test/s3/retention/weed-test*.log
|
|
retention-days: 3
|
|
|
|
s3-cors-tests:
|
|
name: S3 CORS Tests
|
|
runs-on: ubuntu-22.04
|
|
timeout-minutes: 30
|
|
strategy:
|
|
matrix:
|
|
test-type: ["quick", "comprehensive"]
|
|
|
|
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 CORS Tests - ${{ matrix.test-type }}
|
|
timeout-minutes: 25
|
|
working-directory: test/s3/cors
|
|
run: |
|
|
set -x
|
|
echo "=== System Information ==="
|
|
uname -a
|
|
free -h
|
|
df -h
|
|
echo "=== Starting Tests ==="
|
|
|
|
# Run tests with automatic server management
|
|
# The test-with-server target handles server startup/shutdown automatically
|
|
if [ "${{ matrix.test-type }}" = "quick" ]; then
|
|
# Override TEST_PATTERN for quick tests only
|
|
make test-with-server TEST_PATTERN="TestCORSConfigurationManagement|TestServiceLevelCORS|TestCORSBasicWorkflow"
|
|
else
|
|
# Run all CORS tests
|
|
make test-with-server
|
|
fi
|
|
|
|
- name: Show server logs on failure
|
|
if: failure()
|
|
working-directory: test/s3/cors
|
|
run: |
|
|
echo "=== Server Logs ==="
|
|
if [ -f weed-test.log ]; then
|
|
echo "Last 100 lines of server logs:"
|
|
tail -100 weed-test.log
|
|
else
|
|
echo "No server log file found"
|
|
fi
|
|
|
|
echo "=== Test Environment ==="
|
|
ps aux | grep -E "(weed|test)" || true
|
|
netstat -tlnp | grep -E "(8333|9333|8080)" || true
|
|
|
|
- name: Upload test logs on failure
|
|
if: failure()
|
|
uses: actions/upload-artifact@v6
|
|
with:
|
|
name: s3-cors-test-logs-${{ matrix.test-type }}
|
|
path: test/s3/cors/weed-test*.log
|
|
retention-days: 3
|
|
|
|
s3-retention-worm:
|
|
name: S3 Retention WORM Integration Test
|
|
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 WORM Integration Tests
|
|
timeout-minutes: 15
|
|
working-directory: test/s3/retention
|
|
run: |
|
|
set -x
|
|
echo "=== System Information ==="
|
|
uname -a
|
|
free -h
|
|
|
|
# Run the WORM integration tests with automatic server management
|
|
# The test-with-server target handles server startup/shutdown automatically
|
|
make test-with-server TEST_PATTERN="TestWORM|TestRetentionExtendedAttributes|TestRetentionConcurrentOperations" || {
|
|
echo "❌ WORM integration test failed, checking logs..."
|
|
if [ -f weed-test.log ]; then
|
|
echo "=== Server logs ==="
|
|
tail -100 weed-test.log
|
|
fi
|
|
echo "=== Process information ==="
|
|
ps aux | grep -E "(weed|test)" || true
|
|
exit 1
|
|
}
|
|
|
|
- name: Upload server logs on failure
|
|
if: failure()
|
|
uses: actions/upload-artifact@v6
|
|
with:
|
|
name: s3-retention-worm-logs
|
|
path: test/s3/retention/weed-test*.log
|
|
retention-days: 3
|
|
|
|
s3-versioning-stress:
|
|
name: S3 Versioning Stress Test
|
|
runs-on: ubuntu-22.04
|
|
timeout-minutes: 35
|
|
# Only run stress tests on master branch pushes to avoid overloading PR testing
|
|
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
|
|
|
|
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 Versioning Stress Tests
|
|
timeout-minutes: 30
|
|
working-directory: test/s3/versioning
|
|
run: |
|
|
set -x
|
|
echo "=== System Information ==="
|
|
uname -a
|
|
free -h
|
|
|
|
# Run stress tests (concurrent operations)
|
|
make test-versioning-stress || {
|
|
echo "❌ Stress test failed, checking logs..."
|
|
if [ -f weed-test.log ]; then
|
|
echo "=== Server logs ==="
|
|
tail -200 weed-test.log
|
|
fi
|
|
make clean
|
|
exit 1
|
|
}
|
|
|
|
# Run pagination stress tests (>1000 versions)
|
|
echo "=== Running pagination stress tests ==="
|
|
make test-versioning-pagination-stress || {
|
|
echo "❌ Pagination stress test failed, checking logs..."
|
|
if [ -f weed-test.log ]; then
|
|
echo "=== Server logs ==="
|
|
tail -200 weed-test.log
|
|
fi
|
|
make clean
|
|
exit 1
|
|
}
|
|
make clean
|
|
|
|
- name: Upload stress test logs
|
|
if: always()
|
|
uses: actions/upload-artifact@v6
|
|
with:
|
|
name: s3-versioning-stress-logs
|
|
path: test/s3/versioning/weed-test*.log
|
|
retention-days: 7
|
|
|
|
s3-tagging-tests:
|
|
# CI job for S3 object 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
|
|
working-directory: test/s3/tagging
|
|
run: |
|
|
set -x
|
|
echo "=== System Information ==="
|
|
uname -a
|
|
free -h
|
|
|
|
# Set environment variables for the test
|
|
export S3_ENDPOINT="http://localhost:8006"
|
|
export S3_ACCESS_KEY="0555b35654ad1656d804"
|
|
export S3_SECRET_KEY="h7GhxuBLTrlhVUyxSPUKUV8r/2EI4ngqJxD7iBdBYLhwluN30JaT3Q=="
|
|
|
|
# Run the specific test that is equivalent to AWS S3 tagging behavior
|
|
make test-with-server || {
|
|
echo "❌ Test failed, checking logs..."
|
|
if [ -f weed-test.log ]; then
|
|
echo "=== Server logs ==="
|
|
tail -100 weed-test.log
|
|
fi
|
|
echo "=== Process information ==="
|
|
ps aux | grep -E "(weed|test)" || true
|
|
exit 1
|
|
}
|
|
|
|
- name: Upload test logs on failure
|
|
if: failure()
|
|
uses: actions/upload-artifact@v6
|
|
with:
|
|
name: s3-tagging-test-logs
|
|
path: test/s3/tagging/weed-test*.log
|
|
retention-days: 3
|
|
|
|
# Removed SSE-C integration tests and compatibility job |