aboutsummaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/s3-versioning-tests.yml181
-rw-r--r--.github/workflows/s3tests.yml16
2 files changed, 196 insertions, 1 deletions
diff --git a/.github/workflows/s3-versioning-tests.yml b/.github/workflows/s3-versioning-tests.yml
new file mode 100644
index 000000000..a401a05c8
--- /dev/null
+++ b/.github/workflows/s3-versioning-tests.yml
@@ -0,0 +1,181 @@
+name: "S3 Versioning Tests (Go)"
+
+on:
+ pull_request:
+
+concurrency:
+ group: ${{ github.head_ref }}/s3-versioning
+ 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@v4
+
+ - name: Set up Go
+ uses: actions/setup-go@v5
+ 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@v4
+ 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@v4
+
+ - name: Set up Go
+ uses: actions/setup-go@v5
+ 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@v4
+ with:
+ name: s3-versioning-compatibility-logs
+ path: test/s3/versioning/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@v4
+
+ - name: Set up Go
+ uses: actions/setup-go@v5
+ 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
+ }
+ make clean
+
+ - name: Upload stress test logs
+ if: always()
+ uses: actions/upload-artifact@v4
+ with:
+ name: s3-versioning-stress-logs
+ path: test/s3/versioning/weed-test*.log
+ retention-days: 7 \ No newline at end of file
diff --git a/.github/workflows/s3tests.yml b/.github/workflows/s3tests.yml
index b538d3e1d..8291f4a4b 100644
--- a/.github/workflows/s3tests.yml
+++ b/.github/workflows/s3tests.yml
@@ -43,7 +43,11 @@ jobs:
cd /__w/seaweedfs/seaweedfs/weed
go install -buildvcs=false
set -x
+ # Create clean data directory for this test run
+ export WEED_DATA_DIR="/tmp/seaweedfs-s3tests-$(date +%s)"
+ mkdir -p "$WEED_DATA_DIR"
weed -v 0 server -filer -filer.maxMB=64 -s3 -ip.bind 0.0.0.0 \
+ -dir="$WEED_DATA_DIR" \
-master.raftHashicorp -master.electionTimeout 1s -master.volumeSizeLimitMB=1024 \
-volume.max=100 -volume.preStopSeconds=1 -s3.port=8000 -metricsPort=9324 \
-s3.allowEmptyFolder=false -s3.allowDeleteBucketNotEmpty=true -s3.config=../docker/compose/s3.json &
@@ -204,6 +208,8 @@ jobs:
s3tests_boto3/functional/test_s3.py::test_lifecycle_get \
s3tests_boto3/functional/test_s3.py::test_lifecycle_set_filter
kill -9 $pid || true
+ # Clean up data directory
+ rm -rf "$WEED_DATA_DIR" || true
- name: Run Ceph S3 tests with SQL store
timeout-minutes: 15
@@ -213,9 +219,13 @@ jobs:
run: |
cd /__w/seaweedfs/seaweedfs/weed
go install -tags "sqlite" -buildvcs=false
- export WEED_LEVELDB2_ENABLED="false" WEED_SQLITE_ENABLED="true" WEED_SQLITE_DBFILE="./filer.db"
+ # Create clean data directory for this test run
+ export WEED_DATA_DIR="/tmp/seaweedfs-sql-test-$(date +%s)"
+ mkdir -p "$WEED_DATA_DIR"
+ export WEED_LEVELDB2_ENABLED="false" WEED_SQLITE_ENABLED="true" WEED_SQLITE_DBFILE="$WEED_DATA_DIR/filer.db"
set -x
weed -v 0 server -filer -filer.maxMB=64 -s3 -ip.bind 0.0.0.0 \
+ -dir="$WEED_DATA_DIR" \
-master.raftHashicorp -master.electionTimeout 1s -master.volumeSizeLimitMB=1024 \
-volume.max=100 -volume.preStopSeconds=1 -s3.port=8000 -metricsPort=9324 \
-s3.allowEmptyFolder=false -s3.allowDeleteBucketNotEmpty=true -s3.config=../docker/compose/s3.json &
@@ -284,3 +294,7 @@ jobs:
s3tests_boto3/functional/test_s3.py::test_bucket_list_long_name \
s3tests_boto3/functional/test_s3.py::test_bucket_list_special_prefix
kill -9 $pid || true
+ # Clean up data directory
+ rm -rf "$WEED_DATA_DIR" || true
+
+