From 560db9b045bd4c2b9760043f3376a332086abf63 Mon Sep 17 00:00:00 2001 From: Kyle Thompson Date: Wed, 1 Apr 2026 15:30:14 -0400 Subject: [PATCH 1/3] Migrate to RWX for CI --- .github/workflows/ci.yml | 253 ------- .rwx/integration.yml | 640 ++++++++++++++++++ .rwx/rust.yml | 354 ++++++++++ integration/load_balancer/pgdog.toml | 2 +- integration/rust/tests/integration/reload.rs | 30 +- integration/rust/tests/integration/rewrite.rs | 1 + integration/rust/tests/sqlx/select.rs | 12 +- 7 files changed, 1025 insertions(+), 267 deletions(-) delete mode 100644 .github/workflows/ci.yml create mode 100644 .rwx/integration.yml create mode 100644 .rwx/rust.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index 738eb5711..000000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,253 +0,0 @@ -name: ci -on: - push: - branches: - - main - pull_request: - types: [opened, synchronize, reopened] - -jobs: - fmt: - runs-on: blacksmith-4vcpu-ubuntu-2404 - steps: - - uses: actions/checkout@v4 - - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true - - name: Install CMake 3.31 - run: | - sudo apt update && sudo apt install mold -y - sudo apt remove cmake - sudo pip3 install cmake==3.31.6 - cmake --version - - name: Format - run: cargo fmt --all -- --check - - name: Clippy - working-directory: pgdog - run: cargo clippy - build: - runs-on: blacksmith-4vcpu-ubuntu-2404 - steps: - - uses: actions/checkout@v4 - - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true - - name: Install CMake 3.31 - run: | - sudo apt update && sudo apt install mold -y - sudo apt remove cmake - sudo pip3 install cmake==3.31.6 - cmake --version - - name: Build - run: cargo build - - name: Check release - run: cargo check --release - tests: - runs-on: blacksmith-4vcpu-ubuntu-2404 - steps: - - uses: actions/checkout@v4 - - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true - components: llvm-tools-preview - - uses: useblacksmith/rust-cache@v3 - with: - prefix-key: "v1" # Change this when updating tooling - - name: Setup PostgreSQL - run: | - sudo service postgresql start - sudo -u postgres createuser --superuser --login $USER - sudo -u postgres createdb $USER - sudo -u postgres psql -c 'ALTER SYSTEM SET max_prepared_transactions TO 1000;' - sudo -u postgres psql -c 'ALTER SYSTEM SET wal_level TO logical;' - sudo service postgresql restart - bash integration/setup.sh - sudo apt update && sudo apt install -y python3-virtualenv mold - sudo gem install bundler - sudo apt remove -y cmake - sudo pip3 install cmake==3.31.6 - cmake --version - cargo install cargo-nextest --version "0.9.78" --locked - bash integration/toxi/setup.sh - - name: Install test dependencies - run: cargo install cargo-nextest --version "0.9.78" --locked - - name: Install coverage tooling - run: cargo install cargo-llvm-cov --locked --version "0.6.10" - - name: Run tests with coverage - env: - RUSTFLAGS: "-C link-dead-code" - run: | - cargo llvm-cov clean --workspace - cargo llvm-cov nextest --lcov --output-path lcov.info --no-fail-fast --test-threads=1 --filter-expr "package(pgdog) | package(pgdog-config) | package(pgdog-vector) | package(pgdog-stats) | package(pgdog-postgres-types)" - - name: Run documentation tests - run: cargo test --doc - # Requires CODECOV_TOKEN secret for upload - - uses: codecov/codecov-action@v4 - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - with: - files: lcov.info - flags: unit - fail_ci_if_error: true - integration: - runs-on: blacksmith-4vcpu-ubuntu-2404 - timeout-minutes: 30 - env: - LLVM_PROFILE_FILE: ${{ github.workspace }}/target/llvm-cov-target/profiles/pgdog-%p-%m.profraw - steps: - - uses: actions/checkout@v4 - - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true - components: llvm-tools-preview - - uses: useblacksmith/rust-cache@v3 - with: - prefix-key: release-1 - - name: Setup dependencies - run: | - sudo service postgresql start - sudo -u postgres createuser --superuser --login $USER - sudo -u postgres createdb $USER - sudo -u postgres psql -c 'ALTER SYSTEM SET max_connections TO 1000;' - sudo -u postgres psql -c 'ALTER SYSTEM SET max_prepared_transactions TO 1000;' - sudo -u postgres psql -c 'ALTER SYSTEM SET wal_level TO logical;' - sudo service postgresql restart - bash integration/setup.sh - sudo apt update && sudo apt install -y python3-virtualenv mold php-cli php-pgsql - sudo gem install bundler - sudo apt remove -y cmake - sudo pip3 install cmake==3.31.6 - cmake --version - cargo install cargo-nextest --version "0.9.78" --locked - bash integration/toxi/setup.sh - sudo curl -SL https://github.com/docker/compose/releases/download/v2.36.1/docker-compose-linux-x86_64 -o /usr/local/bin/docker-compose - sudo chmod +x /usr/local/bin/docker-compose - - name: Install coverage tooling - run: cargo install cargo-llvm-cov --locked --version "0.6.10" - - name: Prepare instrumented PgDog build - env: - RUSTFLAGS: "-C link-dead-code" - run: | - cargo llvm-cov clean --workspace - mkdir -p target/llvm-cov-target/profiles - cargo llvm-cov run --no-report --release --package pgdog --bin pgdog -- --help - rm -f target/llvm-cov-target/profiles/*.profraw - rm -f target/llvm-cov-target/profiles/.last_snapshot - rm -rf target/llvm-cov-target/reports - BIN_PATH=$(find target/llvm-cov-target -type f -path '*/release/pgdog' | head -n 1) - if [ -z "$BIN_PATH" ]; then - echo "Instrumented PgDog binary not found" >&2 - exit 1 - fi - echo "Using instrumented binary at $BIN_PATH" - echo "PGDOG_BIN=$(realpath "$BIN_PATH")" >> "$GITHUB_ENV" - - name: pgbench - run: bash integration/pgbench/run.sh - - name: schema-sync - run: bash integration/schema_sync/run.sh - - name: Go - run: bash integration/go/run.sh - - name: JavaScript - run: bash integration/js/pg_tests/run.sh - - name: Ruby - run: bash integration/ruby/run.sh - - name: Java - run: bash integration/java/run.sh - - name: Mirror - run: bash integration/mirror/run.sh - - name: SQL - run: bash integration/sql/run.sh - - name: Toxi - run: bash integration/toxi/run.sh - - name: Rust - run: bash integration/rust/run.sh - - name: Stop shared PgDog - run: bash -lc 'source integration/common.sh; stop_pgdog' - - name: Data sync - run: bash integration/copy_data/dev.sh - - name: Python - run: bash integration/python/run.sh - - name: Load balancer - run: bash integration/load_balancer/run.sh - - name: More complex stuff - run: bash integration/complex/run.sh - - name: Dry run - run: bash integration/dry_run/run.sh - - name: Ensure PgDog stopped - run: | - if pgrep -x pgdog > /dev/null; then - killall -TERM pgdog - sleep 5 - fi - - name: Generate integration coverage report - run: cargo llvm-cov report --release --package pgdog --lcov --output-path integration.lcov - # Requires CODECOV_TOKEN secret for upload - - uses: codecov/codecov-action@v4 - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - with: - files: integration.lcov - flags: integration - fail_ci_if_error: true - plugin-unit-tests: - runs-on: blacksmith-4vcpu-ubuntu-2404 - continue-on-error: true - timeout-minutes: 30 - steps: - - uses: actions/checkout@v4 - - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true - - uses: useblacksmith/rust-cache@v3 - with: - prefix-key: "plugin-unit-v1" - - name: Install CMake 3.31 - run: | - sudo apt-get install -y mold - sudo apt remove cmake - sudo pip3 install cmake==3.31.6 - cmake --version - - name: Install test dependencies - run: cargo install cargo-nextest --version "0.9.78" --locked - - name: Run plugin unit tests - run: cargo nextest run -E 'package(pgdog-example-plugin)' --no-fail-fast - plugin-integration-tests: - runs-on: blacksmith-4vcpu-ubuntu-2404 - continue-on-error: true - timeout-minutes: 30 - steps: - - uses: actions/checkout@v4 - - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true - - uses: useblacksmith/rust-cache@v3 - with: - prefix-key: "plugin-integration-v1" - - name: Setup PostgreSQL - run: | - sudo service postgresql start - sudo -u postgres createuser --superuser --login $USER - sudo -u postgres createdb $USER - bash integration/setup.sh - - name: Install dependencies - run: | - sudo apt update && sudo apt install -y python3-virtualenv mold - sudo gem install bundler - sudo apt remove -y cmake - sudo pip3 install cmake==3.31.6 - cmake --version - cargo install cargo-nextest --version "0.9.78" --locked - - name: Build plugin - run: | - cargo build --release - pushd plugins/pgdog-example-plugin - cargo build --release - popd - - name: Run plugin integration tests - run: bash integration/plugins/run.sh diff --git a/.rwx/integration.yml b/.rwx/integration.yml new file mode 100644 index 000000000..225dc3295 --- /dev/null +++ b/.rwx/integration.yml @@ -0,0 +1,640 @@ +on: + github: + pull_request: + init: + commit-sha: ${{ event.git.sha }} + branch: ${{ event.git.branch }} + push: + if: ${{ event.git.branch == "main" }} + init: + commit-sha: ${{ event.git.sha }} + branch: ${{ event.git.branch }} + cli: + init: + commit-sha: ${{ event.git.sha }} + branch: local + +base: + image: ubuntu:24.04 + config: rwx/base 1.0.0 + +concurrency-pools: + - id: pgdogdev/pgdog:integration:${{ init.branch }} + if: ${{ init.branch != "main" && init.branch != "local" }} + capacity: 1 + on-overflow: cancel-running + +aliases: + build-filter: &build-filter + - Cargo.toml + - Cargo.lock + - docker-compose.yml + - examples/demo/** + - integration/** + - pgdog/** + - pgdog-config/** + - pgdog-macros/** + - pgdog-plugin/** + - pgdog-postgres-types/** + - pgdog-stats/** + - pgdog-vector/** + - plugins/** + - scripts/** + +tasks: + - key: code + call: git/clone 2.0.7 + with: + repository: https://github.com/pgdogdev/pgdog.git + ref: ${{ init.commit-sha }} + submodules: false + preserve-git-dir: true + + - key: rust + call: rust-lang/install 1.0.6 + with: + rust-version: 1.91.0 + + - key: integration-node + call: nodejs/install 1.1.13 + with: + node-version: "20.11.1" + + - key: integration-system-deps + run: | + sudo apt-get update + if [ -e /usr/bin/pg_config.libpq-dev ] && ! sudo dpkg-divert --list /usr/bin/pg_config >/dev/null 2>&1; then + sudo rm -f /usr/bin/pg_config.libpq-dev + fi + sudo apt-get install -y \ + build-essential \ + clang \ + curl \ + default-jdk \ + golang-go \ + lcov \ + libpq-dev \ + libpq5 \ + libssl-dev \ + libyaml-dev \ + lsof \ + mold \ + php-cli \ + php-pgsql \ + pkg-config \ + postgresql \ + postgresql-client \ + psmisc \ + python3 \ + python3-pip \ + python3-venv \ + python3-virtualenv \ + ruby-full + sudo apt-get remove -y cmake || true + sudo pip3 install --break-system-packages cmake==3.31.6 + cmake --version + sudo gem install bundler + sudo curl -SL https://github.com/docker/compose/releases/download/v2.36.1/docker-compose-linux-x86_64 -o /usr/local/bin/docker-compose + sudo chmod +x /usr/local/bin/docker-compose + sudo apt-get clean + cache: + ttl: 7 days + + - key: cargo-nextest + use: [integration-system-deps, rust] + run: cargo install cargo-nextest --version "0.9.78" --locked + + - key: cargo-llvm-cov + use: [cargo-nextest] + run: cargo install cargo-llvm-cov --locked --version "0.6.10" + + - key: codecov-cli + use: integration-system-deps + run: | + curl -fsSL -o codecov https://cli.codecov.io/v11.2.8/linux/codecov + chmod +x codecov + + - key: integration-build-pgdog-cov + use: [code, rust, integration-system-deps, cargo-nextest, cargo-llvm-cov] + agent: + cpus: 16 + memory: 32gb + tmpfs: true + env: + RUSTFLAGS: "-C link-dead-code" + filter: *build-filter + run: | + cargo llvm-cov clean --workspace + mkdir -p target/llvm-cov-target/profiles + cargo llvm-cov run --no-report --release --package pgdog --bin pgdog -- --help + rm -f target/llvm-cov-target/profiles/*.profraw + rm -f target/llvm-cov-target/profiles/.last_snapshot + rm -rf target/llvm-cov-target/reports + + BIN_PATH=$(find target/llvm-cov-target -type f -path '*/release/pgdog' | head -n 1) + if [ -z "$BIN_PATH" ]; then + echo "Instrumented PgDog binary not found" >&2 + exit 1 + fi + + printf '%s\n' "$(realpath "$BIN_PATH")" > "$RWX_ENV/PGDOG_BIN" + + - key: integration-pgbench + use: integration-build-pgdog-cov + timeout: 15m + run: | + export LLVM_PROFILE_FILE="$PWD/target/llvm-cov-target/profiles/pgbench-%p-%m.profraw" + + sudo service postgresql start + sudo -u postgres createuser --superuser --login "$USER" || true + sudo -u postgres createdb "$USER" || true + sudo -u postgres psql -c 'ALTER SYSTEM SET max_prepared_transactions TO 1000;' + sudo -u postgres psql -c 'ALTER SYSTEM SET max_connections TO 1000;' + sudo service postgresql restart + + bash integration/setup.sh + + source integration/common.sh + run_pgdog "$PWD/integration" + wait_for_pgdog + psql "postgres://admin:pgdog@127.0.0.1:6432/admin" -c "SET query_timeout TO 10000" + timeout --signal=TERM --kill-after=30s 10m bash integration/pgbench/dev.sh + timeout --signal=TERM --kill-after=30s 10m bash integration/pgbench/stress.sh + stop_pgdog + + cargo llvm-cov report --release --package pgdog --lcov --output-path pgbench.lcov + outputs: + filesystem: false + artifacts: + - key: lcov-pgbench + path: pgbench.lcov + + - key: integration-schema-sync + use: integration-build-pgdog-cov + run: | + export LLVM_PROFILE_FILE="$PWD/target/llvm-cov-target/profiles/schema-sync-%p-%m.profraw" + + sudo service postgresql start + sudo -u postgres createuser --superuser --login "$USER" || true + sudo -u postgres createdb "$USER" || true + sudo -u postgres psql -c 'ALTER SYSTEM SET max_prepared_transactions TO 1000;' + sudo -u postgres psql -c 'ALTER SYSTEM SET wal_level TO logical;' + sudo -u postgres psql -c 'ALTER SYSTEM SET max_connections TO 1000;' + sudo service postgresql restart + + bash integration/setup.sh + timeout --signal=TERM --kill-after=30s 8m bash integration/schema_sync/run.sh + + cargo llvm-cov report --release --package pgdog --lcov --output-path schema-sync.lcov + outputs: + filesystem: false + artifacts: + - key: lcov-schema-sync + path: schema-sync.lcov + + - key: integration-go + use: integration-build-pgdog-cov + timeout: 15m + run: | + export LLVM_PROFILE_FILE="$PWD/target/llvm-cov-target/profiles/go-%p-%m.profraw" + + sudo service postgresql start + sudo -u postgres createuser --superuser --login "$USER" || true + sudo -u postgres createdb "$USER" || true + sudo -u postgres psql -c 'ALTER SYSTEM SET max_prepared_transactions TO 1000;' + sudo -u postgres psql -c 'ALTER SYSTEM SET max_connections TO 1000;' + sudo service postgresql restart + + max_attempts=2 + attempt=1 + while true; do + echo "integration-go attempt ${attempt}/${max_attempts}" + bash integration/setup.sh + if timeout --signal=TERM --kill-after=30s 13m bash integration/go/run.sh; then + break + fi + if [ "${attempt}" -ge "${max_attempts}" ]; then + exit 1 + fi + attempt=$((attempt + 1)) + sleep 5 + done + + cargo llvm-cov report --release --package pgdog --lcov --output-path go.lcov + outputs: + filesystem: false + artifacts: + - key: lcov-go + path: go.lcov + + - key: integration-js + use: [integration-build-pgdog-cov, integration-node] + timeout: 10m + run: | + export LLVM_PROFILE_FILE="$PWD/target/llvm-cov-target/profiles/js-%p-%m.profraw" + + sudo service postgresql start + sudo -u postgres createuser --superuser --login "$USER" || true + sudo -u postgres createdb "$USER" || true + sudo -u postgres psql -c 'ALTER SYSTEM SET max_prepared_transactions TO 1000;' + sudo service postgresql restart + + bash integration/setup.sh + + pushd integration/js/pg_tests + npm pkg set type=module + popd + timeout --signal=TERM --kill-after=30s 6m bash integration/js/pg_tests/run.sh + + cargo llvm-cov report --release --package pgdog --lcov --output-path js.lcov + outputs: + filesystem: false + artifacts: + - key: lcov-js + path: js.lcov + + - key: integration-ruby + use: integration-build-pgdog-cov + timeout: 10m + run: | + export LLVM_PROFILE_FILE="$PWD/target/llvm-cov-target/profiles/ruby-%p-%m.profraw" + + cleanup() { + killall -TERM toxiproxy-server 2>/dev/null || true + killall -TERM pgdog 2>/dev/null || true + sleep 1 + killall -KILL toxiproxy-server 2>/dev/null || true + killall -KILL pgdog 2>/dev/null || true + } + trap cleanup EXIT + + sudo service postgresql start + sudo -u postgres createuser --superuser --login "$USER" || true + sudo -u postgres createdb "$USER" || true + sudo -u postgres psql -c 'ALTER SYSTEM SET max_prepared_transactions TO 1000;' + sudo -u postgres psql -c 'ALTER SYSTEM SET max_connections TO 1000;' + sudo service postgresql restart + + bash integration/setup.sh + bash integration/toxi/setup.sh + + export PGDOG_KEEP_RUNNING=1 + timeout --signal=TERM --kill-after=30s 6m bash integration/ruby/run.sh + + cargo llvm-cov report --release --package pgdog --lcov --output-path ruby.lcov + outputs: + filesystem: false + artifacts: + - key: lcov-ruby + path: ruby.lcov + + - key: integration-java + use: integration-build-pgdog-cov + timeout: 10m + run: | + export LLVM_PROFILE_FILE="$PWD/target/llvm-cov-target/profiles/java-%p-%m.profraw" + + sudo service postgresql start + sudo -u postgres createuser --superuser --login "$USER" || true + sudo -u postgres createdb "$USER" || true + sudo -u postgres psql -c 'ALTER SYSTEM SET max_prepared_transactions TO 1000;' + sudo -u postgres psql -c 'ALTER SYSTEM SET max_connections TO 1000;' + sudo service postgresql restart + + bash integration/setup.sh + timeout --signal=TERM --kill-after=30s 6m bash integration/java/run.sh + + cargo llvm-cov report --release --package pgdog --lcov --output-path java.lcov + outputs: + filesystem: false + artifacts: + - key: lcov-java + path: java.lcov + + - key: integration-mirror + use: integration-build-pgdog-cov + timeout: 10m + run: | + export LLVM_PROFILE_FILE="$PWD/target/llvm-cov-target/profiles/mirror-%p-%m.profraw" + + sudo service postgresql start + sudo -u postgres createuser --superuser --login "$USER" || true + sudo -u postgres createdb "$USER" || true + sudo -u postgres psql -c 'ALTER SYSTEM SET max_prepared_transactions TO 1000;' + sudo service postgresql restart + + bash integration/setup.sh + timeout --signal=TERM --kill-after=30s 6m bash integration/mirror/run.sh + + cargo llvm-cov report --release --package pgdog --lcov --output-path mirror.lcov + outputs: + filesystem: false + artifacts: + - key: lcov-mirror + path: mirror.lcov + + - key: integration-sql + use: integration-build-pgdog-cov + timeout: 10m + run: | + export LLVM_PROFILE_FILE="$PWD/target/llvm-cov-target/profiles/sql-%p-%m.profraw" + + sudo service postgresql start + sudo -u postgres createuser --superuser --login "$USER" || true + sudo -u postgres createdb "$USER" || true + sudo -u postgres psql -c 'ALTER SYSTEM SET max_prepared_transactions TO 1000;' + sudo service postgresql restart + + bash integration/setup.sh + timeout --signal=TERM --kill-after=30s 8m bash integration/sql/run.sh + + cargo llvm-cov report --release --package pgdog --lcov --output-path sql.lcov + outputs: + filesystem: false + artifacts: + - key: lcov-sql + path: sql.lcov + + - key: integration-toxi + use: integration-build-pgdog-cov + timeout: 12m + run: | + export LLVM_PROFILE_FILE="$PWD/target/llvm-cov-target/profiles/toxi-%p-%m.profraw" + + cleanup() { + killall -TERM toxiproxy-server 2>/dev/null || true + killall -TERM pgdog 2>/dev/null || true + sleep 1 + killall -KILL toxiproxy-server 2>/dev/null || true + killall -KILL pgdog 2>/dev/null || true + } + trap cleanup EXIT + + sudo service postgresql start + sudo -u postgres createuser --superuser --login "$USER" || true + sudo -u postgres createdb "$USER" || true + sudo -u postgres psql -c 'ALTER SYSTEM SET max_prepared_transactions TO 1000;' + sudo service postgresql restart + + bash integration/setup.sh + bash integration/toxi/setup.sh + + TOXI_LOG=/tmp/integration-toxi.log + : > "$TOXI_LOG" + + set +e + timeout --signal=TERM --kill-after=30s 8m bash integration/toxi/run.sh >"$TOXI_LOG" 2>&1 & + suite_pid=$! + + while kill -0 "$suite_pid" 2>/dev/null; do + if grep -Eq '[0-9]+ examples, 0 failures' "$TOXI_LOG"; then + killall -TERM pgdog 2>/dev/null || true + killall -TERM toxiproxy-server 2>/dev/null || true + sleep 2 + killall -KILL pgdog 2>/dev/null || true + killall -KILL toxiproxy-server 2>/dev/null || true + break + fi + sleep 1 + done + + wait "$suite_pid" + suite_status=$? + cat "$TOXI_LOG" + + if [ "$suite_status" -eq 124 ] && grep -Eq '[0-9]+ examples, 0 failures' "$TOXI_LOG"; then + suite_status=0 + fi + set -e + + if [ "$suite_status" -ne 0 ]; then + exit "$suite_status" + fi + + cargo llvm-cov report --release --package pgdog --lcov --output-path toxi.lcov + outputs: + filesystem: false + artifacts: + - key: lcov-toxi + path: toxi.lcov + + - key: integration-rust + use: integration-build-pgdog-cov + timeout: 20m + agent: + cpus: 16 + memory: 32gb + tmpfs: true + run: | + export LLVM_PROFILE_FILE="$PWD/target/llvm-cov-target/profiles/rust-%p-%m.profraw" + + cleanup() { + killall -TERM toxiproxy-server 2>/dev/null || true + killall -TERM pgdog 2>/dev/null || true + sleep 1 + killall -KILL toxiproxy-server 2>/dev/null || true + killall -KILL pgdog 2>/dev/null || true + } + trap cleanup EXIT + + sudo service postgresql start + sudo -u postgres createuser --superuser --login "$USER" || true + sudo -u postgres createdb "$USER" || true + sudo -u postgres psql -c 'ALTER SYSTEM SET max_prepared_transactions TO 1000;' + sudo -u postgres psql -c 'ALTER SYSTEM SET max_connections TO 1000;' + sudo service postgresql restart + + bash integration/setup.sh + bash integration/toxi/setup.sh + + export PGDOG_KEEP_RUNNING=1 + timeout --signal=TERM --kill-after=30s 10m bash integration/rust/run.sh + + cargo llvm-cov report --release --package pgdog --lcov --output-path rust.lcov + outputs: + filesystem: false + artifacts: + - key: lcov-rust + path: rust.lcov + + - key: integration-copy-data + use: integration-build-pgdog-cov + timeout: 15m + run: | + export LLVM_PROFILE_FILE="$PWD/target/llvm-cov-target/profiles/copy-data-%p-%m.profraw" + + sudo service postgresql start + sudo -u postgres createuser --superuser --login "$USER" || true + sudo -u postgres createdb "$USER" || true + sudo -u postgres psql -c 'ALTER SYSTEM SET max_prepared_transactions TO 1000;' + sudo -u postgres psql -c 'ALTER SYSTEM SET wal_level TO logical;' + sudo service postgresql restart + + bash integration/setup.sh + timeout --signal=TERM --kill-after=30s 10m bash integration/copy_data/dev.sh + + cargo llvm-cov report --release --package pgdog --lcov --output-path copy-data.lcov + outputs: + filesystem: false + artifacts: + - key: lcov-copy-data + path: copy-data.lcov + + - key: integration-python + use: integration-build-pgdog-cov + timeout: 12m + run: | + export LLVM_PROFILE_FILE="$PWD/target/llvm-cov-target/profiles/python-%p-%m.profraw" + + sudo service postgresql start + sudo -u postgres createuser --superuser --login "$USER" || true + sudo -u postgres createdb "$USER" || true + sudo -u postgres psql -c 'ALTER SYSTEM SET max_prepared_transactions TO 1000;' + sudo service postgresql restart + + bash integration/setup.sh + timeout --signal=TERM --kill-after=30s 10m bash integration/python/run.sh + + cargo llvm-cov report --release --package pgdog --lcov --output-path python.lcov + outputs: + filesystem: false + artifacts: + - key: lcov-python + path: python.lcov + + - key: integration-load-balancer + use: integration-build-pgdog-cov + docker: true + timeout: 20m + agent: + cpus: 4 + memory: 16gb + run: | + export LLVM_PROFILE_FILE="$PWD/target/llvm-cov-target/profiles/load-balancer-%p-%m.profraw" + + cleanup() { + (cd integration/load_balancer && docker-compose down >/dev/null 2>&1 || true) + killall -TERM pgdog 2>/dev/null || true + sleep 1 + killall -KILL pgdog 2>/dev/null || true + } + trap cleanup EXIT + + timeout --signal=TERM --kill-after=30s 16m bash integration/load_balancer/run.sh + cargo llvm-cov report --release --package pgdog --lcov --output-path load-balancer.lcov + outputs: + filesystem: false + artifacts: + - key: lcov-load-balancer + path: load-balancer.lcov + + - key: integration-complex + use: integration-build-pgdog-cov + timeout: 15m + run: | + export LLVM_PROFILE_FILE="$PWD/target/llvm-cov-target/profiles/complex-%p-%m.profraw" + + sudo service postgresql start + sudo -u postgres createuser --superuser --login "$USER" || true + sudo -u postgres createdb "$USER" || true + sudo -u postgres psql -c 'ALTER SYSTEM SET max_prepared_transactions TO 1000;' + sudo service postgresql restart + + bash integration/setup.sh + + pushd integration/python + virtualenv venv + source venv/bin/activate + pip install -r requirements.txt + deactivate + popd + + timeout --signal=TERM --kill-after=30s 10m bash integration/complex/run.sh + + cargo llvm-cov report --release --package pgdog --lcov --output-path complex.lcov + outputs: + filesystem: false + artifacts: + - key: lcov-complex + path: complex.lcov + + - key: integration-dry-run + use: [integration-build-pgdog-cov, integration-node] + timeout: 10m + run: | + export LLVM_PROFILE_FILE="$PWD/target/llvm-cov-target/profiles/dry-run-%p-%m.profraw" + + sudo service postgresql start + sudo -u postgres createuser --superuser --login "$USER" || true + sudo -u postgres createdb "$USER" || true + sudo -u postgres psql -c 'ALTER SYSTEM SET max_prepared_transactions TO 1000;' + sudo service postgresql restart + + bash integration/setup.sh + + pushd integration/dry_run + npm pkg set type=module + popd + timeout --signal=TERM --kill-after=30s 8m bash integration/dry_run/run.sh + + cargo llvm-cov report --release --package pgdog --lcov --output-path dry-run.lcov + outputs: + filesystem: false + artifacts: + - key: lcov-dry-run + path: dry-run.lcov + + - key: integration-lcov + use: integration-system-deps + run: | + lcov \ + -a "$LCOV_PGBENCH" \ + -a "$LCOV_SCHEMA_SYNC" \ + -a "$LCOV_GO" \ + -a "$LCOV_JS" \ + -a "$LCOV_RUBY" \ + -a "$LCOV_JAVA" \ + -a "$LCOV_MIRROR" \ + -a "$LCOV_SQL" \ + -a "$LCOV_TOXI" \ + -a "$LCOV_RUST" \ + -a "$LCOV_COPY_DATA" \ + -a "$LCOV_PYTHON" \ + -a "$LCOV_LOAD_BALANCER" \ + -a "$LCOV_COMPLEX" \ + -a "$LCOV_DRY_RUN" \ + -o integration.lcov + env: + LCOV_PGBENCH: ${{ tasks.integration-pgbench.artifacts.lcov-pgbench }} + LCOV_SCHEMA_SYNC: ${{ tasks.integration-schema-sync.artifacts.lcov-schema-sync }} + LCOV_GO: ${{ tasks.integration-go.artifacts.lcov-go }} + LCOV_JS: ${{ tasks.integration-js.artifacts.lcov-js }} + LCOV_RUBY: ${{ tasks.integration-ruby.artifacts.lcov-ruby }} + LCOV_JAVA: ${{ tasks.integration-java.artifacts.lcov-java }} + LCOV_MIRROR: ${{ tasks.integration-mirror.artifacts.lcov-mirror }} + LCOV_SQL: ${{ tasks.integration-sql.artifacts.lcov-sql }} + LCOV_TOXI: ${{ tasks.integration-toxi.artifacts.lcov-toxi }} + LCOV_RUST: ${{ tasks.integration-rust.artifacts.lcov-rust }} + LCOV_COPY_DATA: ${{ tasks.integration-copy-data.artifacts.lcov-copy-data }} + LCOV_PYTHON: ${{ tasks.integration-python.artifacts.lcov-python }} + LCOV_LOAD_BALANCER: ${{ tasks.integration-load-balancer.artifacts.lcov-load-balancer }} + LCOV_COMPLEX: ${{ tasks.integration-complex.artifacts.lcov-complex }} + LCOV_DRY_RUN: ${{ tasks.integration-dry-run.artifacts.lcov-dry-run }} + outputs: + artifacts: + - key: integration-lcov + path: integration.lcov + + - key: integration-codecov-upload + use: [code, codecov-cli] + env: + CODECOV_TOKEN: ${{ vaults.pgdog-development.secrets.CODECOV_TOKEN }} + LCOV_FILE: ${{ tasks.integration-lcov.artifacts.integration-lcov }} + run: | + ./codecov --verbose upload-process \ + --disable-search \ + --fail-on-error \ + -F integration \ + -f "$LCOV_FILE" + outputs: + filesystem: false diff --git a/.rwx/rust.yml b/.rwx/rust.yml new file mode 100644 index 000000000..a003be57d --- /dev/null +++ b/.rwx/rust.yml @@ -0,0 +1,354 @@ +on: + github: + pull_request: + init: + commit-sha: ${{ event.git.sha }} + branch: ${{ event.git.branch }} + push: + if: ${{ event.git.branch == "main" }} + init: + commit-sha: ${{ event.git.sha }} + branch: ${{ event.git.branch }} + cli: + init: + commit-sha: ${{ event.git.sha }} + branch: local + +base: + image: ubuntu:24.04 + config: rwx/base 1.0.0 + +concurrency-pools: + - id: pgdogdev/pgdog:rust:${{ init.branch }} + if: ${{ init.branch != "main" && init.branch != "local" }} + capacity: 1 + on-overflow: cancel-running + +aliases: + shared-filter: &shared-filter + - "!.claude" + - "!.git" + - "!.gitattributes" + - "!.github" + - "!.gitignore" + - "!.rwx" + - "!AGENTS.md" + - "!CLAUDE.md" + - "!CONTRIBUTING.md" + - "!LICENSE" + - "!README.md" + - "!SECURITY.md" + - "!docs" + +tasks: + - key: code + call: git/clone 2.0.7 + with: + repository: https://github.com/pgdogdev/pgdog.git + ref: ${{ init.commit-sha }} + preserve-git-dir: true + submodules: false + + - key: rust + call: rust-lang/install 1.0.6 + with: + rust-version: 1.91.0 + + - key: system-packages + run: | + sudo apt-get update + if [ -e /usr/bin/pg_config.libpq-dev ] && ! sudo dpkg-divert --list /usr/bin/pg_config >/dev/null 2>&1; then + sudo rm -f /usr/bin/pg_config.libpq-dev + fi + sudo apt-get install -y \ + build-essential \ + clang \ + curl \ + lcov \ + libpq-dev \ + libssl-dev \ + mold \ + pkg-config \ + postgresql \ + postgresql-client \ + psmisc \ + python3-pip \ + python3-venv \ + python3-virtualenv \ + ruby-full + sudo apt-get remove -y cmake || true + sudo pip3 install --break-system-packages cmake==3.31.6 + cmake --version + sudo gem install bundler + sudo apt-get clean + cache: + ttl: 7 days + + - key: cargo-nextest + use: [system-packages, rust] + run: cargo install cargo-nextest --version "0.9.78" --locked + + - key: cargo-llvm-cov + use: [cargo-nextest] + run: cargo install cargo-llvm-cov --locked --version "0.6.10" + + - key: codecov-cli + use: system-packages + run: | + curl -fsSL -o codecov https://cli.codecov.io/v11.2.8/linux/codecov + chmod +x codecov + + - key: cargo-build-workspace + use: [system-packages, code, rust, cargo-nextest] + agent: + cpus: 16 + memory: 32gb + tmpfs: true + run: cargo test --workspace --no-run + outputs: + filesystem: + deduplicate: true + filter: *shared-filter + + - key: cargo-build-workspace-cov + use: [system-packages, code, rust, cargo-nextest, cargo-llvm-cov] + agent: + cpus: 16 + memory: 32gb + tmpfs: true + run: cargo llvm-cov nextest --workspace --no-clean -E 'none()' --no-tests=pass + outputs: + filesystem: + deduplicate: true + filter: ["!**/*.profraw"] + filter: *shared-filter + + - key: cargo-test-pgdog + use: cargo-build-workspace-cov + timeout: 20m + run: | + sudo service postgresql start + sudo -u postgres createuser --superuser --login "$USER" || true + sudo -u postgres createdb "$USER" || true + sudo -u postgres psql -c 'ALTER SYSTEM SET max_prepared_transactions TO 1000;' -c 'ALTER SYSTEM SET wal_level TO logical;' + sudo service postgresql restart + + bash integration/setup.sh + + cargo llvm-cov nextest \ + --workspace \ + --no-clean \ + --lcov \ + --output-path lcov-pgdog.info \ + --no-fail-fast \ + --test-threads=1 \ + -E 'package(pgdog)' + outputs: + filesystem: false + artifacts: + - key: lcov-pgdog + path: lcov-pgdog.info + filter: *shared-filter + + - key: cargo-test-pgdog-config + use: cargo-build-workspace-cov + run: | + cargo llvm-cov nextest \ + --workspace \ + --no-clean \ + --lcov \ + --output-path lcov-pgdog-config.info \ + --no-fail-fast \ + --test-threads=1 \ + -E 'package(pgdog-config)' + outputs: + filesystem: false + artifacts: + - key: lcov-pgdog-config + path: lcov-pgdog-config.info + filter: *shared-filter + + - key: cargo-test-pgdog-vector + use: cargo-build-workspace-cov + run: | + cargo llvm-cov nextest \ + --workspace \ + --no-clean \ + --lcov \ + --output-path lcov-pgdog-vector.info \ + --no-fail-fast \ + --test-threads=1 \ + -E 'package(pgdog-vector)' + outputs: + filesystem: false + artifacts: + - key: lcov-pgdog-vector + path: lcov-pgdog-vector.info + filter: *shared-filter + + - key: cargo-test-pgdog-stats + use: cargo-build-workspace-cov + run: | + cargo llvm-cov nextest \ + --workspace \ + --no-clean \ + --lcov \ + --output-path lcov-pgdog-stats.info \ + --no-fail-fast \ + --test-threads=1 \ + -E 'package(pgdog-stats)' + outputs: + filesystem: false + artifacts: + - key: lcov-pgdog-stats + path: lcov-pgdog-stats.info + filter: *shared-filter + + - key: cargo-test-pgdog-postgres-types + use: cargo-build-workspace-cov + run: | + cargo llvm-cov nextest \ + --workspace \ + --no-clean \ + --lcov \ + --output-path lcov-pgdog-postgres-types.info \ + --no-fail-fast \ + --test-threads=1 \ + -E 'package(pgdog-postgres-types)' + outputs: + filesystem: false + artifacts: + - key: lcov-pgdog-postgres-types + path: lcov-pgdog-postgres-types.info + filter: *shared-filter + + - key: rust-core-lcov + use: system-packages + run: | + lcov \ + -a "$LCOV_PGDOG" \ + -a "$LCOV_PGDOG_CONFIG" \ + -a "$LCOV_PGDOG_VECTOR" \ + -a "$LCOV_PGDOG_STATS" \ + -a "$LCOV_PGDOG_POSTGRES_TYPES" \ + -o lcov.info + env: + LCOV_PGDOG: ${{ tasks.cargo-test-pgdog.artifacts.lcov-pgdog }} + LCOV_PGDOG_CONFIG: ${{ tasks.cargo-test-pgdog-config.artifacts.lcov-pgdog-config }} + LCOV_PGDOG_VECTOR: ${{ tasks.cargo-test-pgdog-vector.artifacts.lcov-pgdog-vector }} + LCOV_PGDOG_STATS: ${{ tasks.cargo-test-pgdog-stats.artifacts.lcov-pgdog-stats }} + LCOV_PGDOG_POSTGRES_TYPES: ${{ tasks.cargo-test-pgdog-postgres-types.artifacts.lcov-pgdog-postgres-types }} + outputs: + artifacts: + - key: core-lcov + path: lcov.info + + - key: rust-codecov-upload + use: [code, codecov-cli] + env: + CODECOV_TOKEN: ${{ vaults.pgdog-development.secrets.CODECOV_TOKEN }} + LCOV_FILE: ${{ tasks.rust-core-lcov.artifacts.core-lcov }} + run: | + ./codecov --verbose upload-process \ + --disable-search \ + --fail-on-error \ + -F unit \ + -f "$LCOV_FILE" + outputs: + filesystem: false + + - key: rust-fmt-check + use: [code, rust] + run: cargo fmt --all -- --check + outputs: + filesystem: false + filter: *shared-filter + + - key: rust-pgdog-clippy + use: [system-packages, code, rust] + agent: + cpus: 4 + run: cd pgdog && cargo clippy + outputs: + filesystem: false + filter: *shared-filter + + - key: rust-workspace-build + use: [system-packages, code, rust] + agent: + cpus: 8 + run: cargo build + outputs: + filesystem: false + filter: *shared-filter + + - key: rust-workspace-check-release + use: [system-packages, code, rust] + agent: + cpus: 4 + run: cargo check --release + outputs: + filesystem: false + filter: *shared-filter + + - key: rust-doc-tests + use: cargo-build-workspace + run: cargo test --doc + outputs: + filesystem: false + filter: *shared-filter + + # RWX does not currently have a direct per-task continue-on-error equivalent. + # Preserve the non-blocking behavior from GitHub Actions by surfacing failures + # in logs while still allowing the overall run to succeed. + - key: rust-plugin-unit + use: cargo-build-workspace + timeout: 30m + run: | + set +e + cargo nextest run -E 'package(pgdog-example-plugin)' --no-fail-fast + status=$? + set -e + + if [ "$status" -ne 0 ]; then + printf '%s\n' \ + "pgdog-example-plugin unit tests failed with exit code $status" \ + > "$RWX_WARNINGS/plugin-unit" + fi + + exit 0 + outputs: + filesystem: false + filter: *shared-filter + + - key: rust-plugin-integration + use: [system-packages, code, rust] + agent: + cpus: 8 + memory: 16gb + timeout: 30m + run: | + sudo service postgresql start + sudo -u postgres createuser --superuser --login "$USER" || true + sudo -u postgres createdb "$USER" || true + + bash integration/setup.sh + + cargo build --release -p pgdog --bin pgdog + export PGDOG_BIN="$PWD/target/release/pgdog" + + set +e + timeout --signal=TERM --kill-after=30s 11m bash integration/plugins/run.sh + status=$? + set -e + + if [ "$status" -ne 0 ]; then + printf '%s\n' \ + "pgdog-example-plugin integration tests failed with exit code $status" \ + > "$RWX_WARNINGS/plugin-integration" + fi + + exit 0 + outputs: + filesystem: false + filter: *shared-filter diff --git a/integration/load_balancer/pgdog.toml b/integration/load_balancer/pgdog.toml index 830bf7a6a..9ae1e89fb 100644 --- a/integration/load_balancer/pgdog.toml +++ b/integration/load_balancer/pgdog.toml @@ -3,7 +3,7 @@ host = "0.0.0.0" port = 6432 shutdown_timeout = 5_000 openmetrics_port = 9090 -query_timeout = 5_000 +query_timeout = 15_000 checkout_timeout = 5_000 connect_timeout = 5_000 idle_timeout = 30_000 diff --git a/integration/rust/tests/integration/reload.rs b/integration/rust/tests/integration/reload.rs index a97435316..edd859cf7 100644 --- a/integration/rust/tests/integration/reload.rs +++ b/integration/rust/tests/integration/reload.rs @@ -52,18 +52,26 @@ async fn test_reload_connection_count_stable() { eprintln!("connections before RELOAD: {before}"); admin.simple_query("RELOAD").await.unwrap(); - sleep(Duration::from_millis(500)).await; - - let after: i64 = direct - .fetch_one("SELECT COUNT(*)::BIGINT FROM pg_stat_activity WHERE application_name = 'PgDog'") - .await - .unwrap() - .get(0); - - eprintln!("connections after RELOAD: {after}"); + let mut after = before; + let mut settled = false; + for _ in 0..20 { + sleep(Duration::from_millis(250)).await; + after = direct + .fetch_one( + "SELECT COUNT(*)::BIGINT FROM pg_stat_activity WHERE application_name = 'PgDog'", + ) + .await + .unwrap() + .get(0); + eprintln!("connections after RELOAD: {after}"); + if after == before { + settled = true; + break; + } + } - assert_eq!( - before, after, + assert!( + settled, "connection count changed after RELOAD: before={before}, after={after}" ); diff --git a/integration/rust/tests/integration/rewrite.rs b/integration/rust/tests/integration/rewrite.rs index 0d44fb649..ac1635b20 100644 --- a/integration/rust/tests/integration/rewrite.rs +++ b/integration/rust/tests/integration/rewrite.rs @@ -295,6 +295,7 @@ async fn test_error_disconnects_and_update_works() -> Result<(), Box = sqlx::query_as("SELECT * FROM rust_test_concurrent.sharded WHERE id = $1") .bind(id) From 980c7ad429e10a994ef90b9dbbe2042248d82ae9 Mon Sep 17 00:00:00 2001 From: Kyle Thompson Date: Thu, 2 Apr 2026 15:24:00 -0400 Subject: [PATCH 2/3] Pull out duplicated postgres setup --- .rwx/integration.yml | 119 ++++++++++--------------------------------- 1 file changed, 27 insertions(+), 92 deletions(-) diff --git a/.rwx/integration.yml b/.rwx/integration.yml index 225dc3295..aa328259d 100644 --- a/.rwx/integration.yml +++ b/.rwx/integration.yml @@ -40,6 +40,19 @@ aliases: - pgdog-vector/** - plugins/** - scripts/** + postgres-bg-processes: &postgres-bg–processes + - key: postgres + run: | + sudo service postgresql start + sudo -u postgres createuser --superuser --login "$USER" || true + sudo -u postgres createdb "$USER" || true + sudo -u postgres psql -c 'ALTER SYSTEM SET wal_level TO logical;' + sudo -u postgres psql -c 'ALTER SYSTEM SET max_prepared_transactions TO 1000;' + sudo -u postgres psql -c 'ALTER SYSTEM SET max_connections TO 1000;' + sudo service postgresql restart + touch .pg_isready + ready-check: | + [ -f .pg_isready ] && pg_isready -U "$USER" -h 127.0.0.1 tasks: - key: code @@ -141,17 +154,11 @@ tasks: - key: integration-pgbench use: integration-build-pgdog-cov + background-processes: *postgres-bg–processes timeout: 15m run: | export LLVM_PROFILE_FILE="$PWD/target/llvm-cov-target/profiles/pgbench-%p-%m.profraw" - sudo service postgresql start - sudo -u postgres createuser --superuser --login "$USER" || true - sudo -u postgres createdb "$USER" || true - sudo -u postgres psql -c 'ALTER SYSTEM SET max_prepared_transactions TO 1000;' - sudo -u postgres psql -c 'ALTER SYSTEM SET max_connections TO 1000;' - sudo service postgresql restart - bash integration/setup.sh source integration/common.sh @@ -171,17 +178,10 @@ tasks: - key: integration-schema-sync use: integration-build-pgdog-cov + background-processes: *postgres-bg–processes run: | export LLVM_PROFILE_FILE="$PWD/target/llvm-cov-target/profiles/schema-sync-%p-%m.profraw" - sudo service postgresql start - sudo -u postgres createuser --superuser --login "$USER" || true - sudo -u postgres createdb "$USER" || true - sudo -u postgres psql -c 'ALTER SYSTEM SET max_prepared_transactions TO 1000;' - sudo -u postgres psql -c 'ALTER SYSTEM SET wal_level TO logical;' - sudo -u postgres psql -c 'ALTER SYSTEM SET max_connections TO 1000;' - sudo service postgresql restart - bash integration/setup.sh timeout --signal=TERM --kill-after=30s 8m bash integration/schema_sync/run.sh @@ -194,17 +194,11 @@ tasks: - key: integration-go use: integration-build-pgdog-cov + background-processes: *postgres-bg–processes timeout: 15m run: | export LLVM_PROFILE_FILE="$PWD/target/llvm-cov-target/profiles/go-%p-%m.profraw" - sudo service postgresql start - sudo -u postgres createuser --superuser --login "$USER" || true - sudo -u postgres createdb "$USER" || true - sudo -u postgres psql -c 'ALTER SYSTEM SET max_prepared_transactions TO 1000;' - sudo -u postgres psql -c 'ALTER SYSTEM SET max_connections TO 1000;' - sudo service postgresql restart - max_attempts=2 attempt=1 while true; do @@ -229,16 +223,11 @@ tasks: - key: integration-js use: [integration-build-pgdog-cov, integration-node] + background-processes: *postgres-bg–processes timeout: 10m run: | export LLVM_PROFILE_FILE="$PWD/target/llvm-cov-target/profiles/js-%p-%m.profraw" - sudo service postgresql start - sudo -u postgres createuser --superuser --login "$USER" || true - sudo -u postgres createdb "$USER" || true - sudo -u postgres psql -c 'ALTER SYSTEM SET max_prepared_transactions TO 1000;' - sudo service postgresql restart - bash integration/setup.sh pushd integration/js/pg_tests @@ -255,6 +244,7 @@ tasks: - key: integration-ruby use: integration-build-pgdog-cov + background-processes: *postgres-bg–processes timeout: 10m run: | export LLVM_PROFILE_FILE="$PWD/target/llvm-cov-target/profiles/ruby-%p-%m.profraw" @@ -268,13 +258,6 @@ tasks: } trap cleanup EXIT - sudo service postgresql start - sudo -u postgres createuser --superuser --login "$USER" || true - sudo -u postgres createdb "$USER" || true - sudo -u postgres psql -c 'ALTER SYSTEM SET max_prepared_transactions TO 1000;' - sudo -u postgres psql -c 'ALTER SYSTEM SET max_connections TO 1000;' - sudo service postgresql restart - bash integration/setup.sh bash integration/toxi/setup.sh @@ -290,17 +273,11 @@ tasks: - key: integration-java use: integration-build-pgdog-cov + background-processes: *postgres-bg–processes timeout: 10m run: | export LLVM_PROFILE_FILE="$PWD/target/llvm-cov-target/profiles/java-%p-%m.profraw" - sudo service postgresql start - sudo -u postgres createuser --superuser --login "$USER" || true - sudo -u postgres createdb "$USER" || true - sudo -u postgres psql -c 'ALTER SYSTEM SET max_prepared_transactions TO 1000;' - sudo -u postgres psql -c 'ALTER SYSTEM SET max_connections TO 1000;' - sudo service postgresql restart - bash integration/setup.sh timeout --signal=TERM --kill-after=30s 6m bash integration/java/run.sh @@ -313,16 +290,11 @@ tasks: - key: integration-mirror use: integration-build-pgdog-cov + background-processes: *postgres-bg–processes timeout: 10m run: | export LLVM_PROFILE_FILE="$PWD/target/llvm-cov-target/profiles/mirror-%p-%m.profraw" - sudo service postgresql start - sudo -u postgres createuser --superuser --login "$USER" || true - sudo -u postgres createdb "$USER" || true - sudo -u postgres psql -c 'ALTER SYSTEM SET max_prepared_transactions TO 1000;' - sudo service postgresql restart - bash integration/setup.sh timeout --signal=TERM --kill-after=30s 6m bash integration/mirror/run.sh @@ -335,16 +307,11 @@ tasks: - key: integration-sql use: integration-build-pgdog-cov + background-processes: *postgres-bg–processes timeout: 10m run: | export LLVM_PROFILE_FILE="$PWD/target/llvm-cov-target/profiles/sql-%p-%m.profraw" - sudo service postgresql start - sudo -u postgres createuser --superuser --login "$USER" || true - sudo -u postgres createdb "$USER" || true - sudo -u postgres psql -c 'ALTER SYSTEM SET max_prepared_transactions TO 1000;' - sudo service postgresql restart - bash integration/setup.sh timeout --signal=TERM --kill-after=30s 8m bash integration/sql/run.sh @@ -357,6 +324,7 @@ tasks: - key: integration-toxi use: integration-build-pgdog-cov + background-processes: *postgres-bg–processes timeout: 12m run: | export LLVM_PROFILE_FILE="$PWD/target/llvm-cov-target/profiles/toxi-%p-%m.profraw" @@ -370,12 +338,6 @@ tasks: } trap cleanup EXIT - sudo service postgresql start - sudo -u postgres createuser --superuser --login "$USER" || true - sudo -u postgres createdb "$USER" || true - sudo -u postgres psql -c 'ALTER SYSTEM SET max_prepared_transactions TO 1000;' - sudo service postgresql restart - bash integration/setup.sh bash integration/toxi/setup.sh @@ -420,6 +382,7 @@ tasks: - key: integration-rust use: integration-build-pgdog-cov + background-processes: *postgres-bg–processes timeout: 20m agent: cpus: 16 @@ -437,13 +400,6 @@ tasks: } trap cleanup EXIT - sudo service postgresql start - sudo -u postgres createuser --superuser --login "$USER" || true - sudo -u postgres createdb "$USER" || true - sudo -u postgres psql -c 'ALTER SYSTEM SET max_prepared_transactions TO 1000;' - sudo -u postgres psql -c 'ALTER SYSTEM SET max_connections TO 1000;' - sudo service postgresql restart - bash integration/setup.sh bash integration/toxi/setup.sh @@ -459,17 +415,11 @@ tasks: - key: integration-copy-data use: integration-build-pgdog-cov + background-processes: *postgres-bg–processes timeout: 15m run: | export LLVM_PROFILE_FILE="$PWD/target/llvm-cov-target/profiles/copy-data-%p-%m.profraw" - sudo service postgresql start - sudo -u postgres createuser --superuser --login "$USER" || true - sudo -u postgres createdb "$USER" || true - sudo -u postgres psql -c 'ALTER SYSTEM SET max_prepared_transactions TO 1000;' - sudo -u postgres psql -c 'ALTER SYSTEM SET wal_level TO logical;' - sudo service postgresql restart - bash integration/setup.sh timeout --signal=TERM --kill-after=30s 10m bash integration/copy_data/dev.sh @@ -482,16 +432,11 @@ tasks: - key: integration-python use: integration-build-pgdog-cov + background-processes: *postgres-bg–processes timeout: 12m run: | export LLVM_PROFILE_FILE="$PWD/target/llvm-cov-target/profiles/python-%p-%m.profraw" - sudo service postgresql start - sudo -u postgres createuser --superuser --login "$USER" || true - sudo -u postgres createdb "$USER" || true - sudo -u postgres psql -c 'ALTER SYSTEM SET max_prepared_transactions TO 1000;' - sudo service postgresql restart - bash integration/setup.sh timeout --signal=TERM --kill-after=30s 10m bash integration/python/run.sh @@ -530,16 +475,11 @@ tasks: - key: integration-complex use: integration-build-pgdog-cov + background-processes: *postgres-bg–processes timeout: 15m run: | export LLVM_PROFILE_FILE="$PWD/target/llvm-cov-target/profiles/complex-%p-%m.profraw" - sudo service postgresql start - sudo -u postgres createuser --superuser --login "$USER" || true - sudo -u postgres createdb "$USER" || true - sudo -u postgres psql -c 'ALTER SYSTEM SET max_prepared_transactions TO 1000;' - sudo service postgresql restart - bash integration/setup.sh pushd integration/python @@ -560,16 +500,11 @@ tasks: - key: integration-dry-run use: [integration-build-pgdog-cov, integration-node] + background-processes: *postgres-bg–processes timeout: 10m run: | export LLVM_PROFILE_FILE="$PWD/target/llvm-cov-target/profiles/dry-run-%p-%m.profraw" - sudo service postgresql start - sudo -u postgres createuser --superuser --login "$USER" || true - sudo -u postgres createdb "$USER" || true - sudo -u postgres psql -c 'ALTER SYSTEM SET max_prepared_transactions TO 1000;' - sudo service postgresql restart - bash integration/setup.sh pushd integration/dry_run From b08f6c0f3cecc0a8b07ad5deb7025ce35d39f776 Mon Sep 17 00:00:00 2001 From: Kyle Thompson Date: Thu, 2 Apr 2026 15:38:56 -0400 Subject: [PATCH 3/3] Remove unnecessary comment --- .rwx/rust.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.rwx/rust.yml b/.rwx/rust.yml index a003be57d..8c160c30f 100644 --- a/.rwx/rust.yml +++ b/.rwx/rust.yml @@ -298,9 +298,6 @@ tasks: filesystem: false filter: *shared-filter - # RWX does not currently have a direct per-task continue-on-error equivalent. - # Preserve the non-blocking behavior from GitHub Actions by surfacing failures - # in logs while still allowing the overall run to succeed. - key: rust-plugin-unit use: cargo-build-workspace timeout: 30m