diff --git a/.github/workflows/postgres-flat-tests.yml b/.github/workflows/postgres-flat-tests.yml index 1a9f096f58..9b28d68eae 100644 --- a/.github/workflows/postgres-flat-tests.yml +++ b/.github/workflows/postgres-flat-tests.yml @@ -6,6 +6,7 @@ on: paths: - 'weed/**' - 'test/postgres_flat/**' + - 'test/s3/versioning/**' - 'test/testutil/**' - 'test/volume_server/framework/**' - 'go.mod' @@ -16,6 +17,7 @@ on: paths: - 'weed/**' - 'test/postgres_flat/**' + - 'test/s3/versioning/**' - 'test/testutil/**' - 'test/volume_server/framework/**' - 'go.mod' @@ -70,3 +72,64 @@ jobs: RUN_POSTGRES_TESTS: "1" WEED_BINARY: ${{ github.workspace }}/weed/weed run: go test -v -count=1 -timeout=20m ./test/postgres_flat/ + + versioning-suite: + name: S3 versioning suite over postgres_flat + runs-on: ubuntu-24.04 + timeout-minutes: 30 + + services: + postgres: + image: postgres:17 + env: + POSTGRES_PASSWORD: postgres + ports: + - 5432:5432 + options: >- + --health-cmd pg_isready + --health-interval 5s + --health-timeout 5s + --health-retries 20 + + steps: + - name: Checkout code + uses: actions/checkout@v7 + + - name: Set up Go + uses: actions/setup-go@v7 + with: + go-version-file: 'go.mod' + cache: ${{ runner.environment == 'github-hosted' }} + + - name: Build SeaweedFS + run: go build -o weed/weed -buildvcs=false ./weed + + - name: Start weed mini on postgres_flat + run: | + mkdir -p "$RUNNER_TEMP/config" "$RUNNER_TEMP/data" + : > "$RUNNER_TEMP/config/security.toml" + cat > "$RUNNER_TEMP/config/filer.toml" <<'EOF' + [postgres_flat] + enabled = true + hostname = "127.0.0.1" + port = 5432 + username = "postgres" + password = "postgres" + database = "postgres" + sslmode = "disable" + EOF + weed/weed -config_dir="$RUNNER_TEMP/config" mini -ip=127.0.0.1 -ip.bind=127.0.0.1 \ + -dir="$RUNNER_TEMP/data" -s3.config="$GITHUB_WORKSPACE/docker/compose/s3.json" \ + -webdav=false -admin.ui=false > "$RUNNER_TEMP/weed.log" 2>&1 & + for i in $(seq 90); do curl -s -o /dev/null http://127.0.0.1:8333 && break; sleep 1; done + curl -s -o /dev/null http://127.0.0.1:8333 || { cat "$RUNNER_TEMP/weed.log"; exit 1; } + test "$(docker exec ${{ job.services.postgres.id }} psql -U postgres -Atc "SELECT count(*) FROM information_schema.columns WHERE table_name = 'filemeta' AND column_name = 'path'")" = 1 + + - name: Run the S3 versioning suite + env: + ENABLE_STRESS_TESTS: "true" + run: go test -v -count=1 -timeout=25m ./test/s3/versioning/ + + - name: Show the server log + if: failure() + run: tail -200 "$RUNNER_TEMP/weed.log"