From 928c2bbc77a1a511a7e994917a9cbf4191d1f6b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20No=C3=ABl?= <21990816+philippemnoel@users.noreply.github.com> Date: Tue, 17 Sep 2024 15:54:10 -0400 Subject: [PATCH] chore: Comment out upgrade test (#1677) --- .github/workflows/test-pg_search.yml | 136 ++++++++++++++------------- 1 file changed, 72 insertions(+), 64 deletions(-) diff --git a/.github/workflows/test-pg_search.yml b/.github/workflows/test-pg_search.yml index 9798d59c98..6c02912433 100644 --- a/.github/workflows/test-pg_search.yml +++ b/.github/workflows/test-pg_search.yml @@ -138,79 +138,87 @@ jobs: working-directory: /home/runner/.pgrx/data-${{ matrix.pg_version }}/ run: sed -i "s/^#shared_preload_libraries = .*/shared_preload_libraries = 'pg_search'/" postgresql.conf + # TODO: Uncomment the upgrade test after we release 0.10.0 # The integration tests also test upgrading the extension when passed the '-u' flag (only on promotion PRs) - name: Run pg_search Cargo Test Suite if: steps.check_skip.outputs.skip_remaining_steps != 'true' working-directory: pg_search/ run: | # Variables (we disable telemetry to avoid skewing the user metrics with CI runs) - BASE_RELEASE="0.6.0" + BASE_RELEASE="0.10.0" PARADEDB_TELEMETRY=false + # echo "" + # echo "Enabling code coverage..." + # echo -e "\n# Enable code coverage on Linux only, for CI builds\n[target.'cfg(target_os=\"linux\")']\nrustflags = [\"-Cinstrument-coverage\"]" >> ../.cargo/config.toml + # mkdir -p ../target/coverage ../target/coverage-report + + # # If this is a promotion PR, we test upgrading the extension by pulling the earliest version of the extension compatible with our current default Postgres version + # if [[ "${{ github.base_ref }}" == "main" && "${{ matrix.pg_version }}" == "${{ env.default_pg_version }}" ]]; then + # echo "" + # echo "Promotion PR detected! Running extension upgrade test..." + # if [[ "${{ github.event.inputs.test_upgrade_version }}" == "" ]]; then + # echo "Using the GitHub Variables version..." + # NEW_VERSION=${{ vars.VERSION_MAJOR }}.${{ vars.VERSION_MINOR }}.${{ vars.VERSION_PATCH }} + # else + # echo "Using the workflow_dispatch version..." + # NEW_VERSION="${{ github.event.inputs.test_upgrade_version }}" + # fi + # echo "Running extension upgrade test from v$BASE_RELEASE to v$NEW_VERSION..." + + # echo "" + # echo "Downloading pg_search v$BASE_RELEASE..." + # curl -LOJ "https://github.com/paradedb/paradedb/releases/download/v$BASE_RELEASE/pg_search-v$BASE_RELEASE-pg${{ matrix.pg_version }}-${{ matrix.arch }}-ubuntu2204.deb" + # sudo dpkg -i "pg_search-v$BASE_RELEASE-pg${{ matrix.pg_version }}-${{ matrix.arch }}-ubuntu2204.deb" + + # echo "" + # echo "Starting Postgres..." + # cargo pgrx start pg${{ matrix.pg_version }} + + # echo "" + # echo "Loading pg_search v$BASE_RELEASE..." + # psql -h localhost -d postgres -p 288${{ matrix.pg_version }} -c "CREATE EXTENSION pg_search VERSION '$BASE_RELEASE';" + + # echo "" + # echo "Verifying current pg_search installed version..." + # psql -h localhost -d postgres -p 288${{ matrix.pg_version }} -c "SELECT extname, extversion FROM pg_extension WHERE extname = 'pg_search';" + + # echo "" + # echo "Building pg_search v$NEW_VERSION..." + # sudo chown -R "$(whoami)" "/usr/share/postgresql/${{ matrix.pg_version }}/extension/" "/usr/lib/postgresql/${{ matrix.pg_version }}/lib/" + # cargo pgrx install --features icu --pg-config="/usr/lib/postgresql/${{ matrix.pg_version }}/bin/pg_config" --release + + # echo "" + # echo "Upgrading pg_search to v$NEW_VERSION..." + # psql -h localhost -d postgres -p 288${{ matrix.pg_version }} -c "ALTER EXTENSION pg_search UPDATE TO '$NEW_VERSION';" + + # echo "" + # echo "Verifying current pg_search installed version..." + # psql -h localhost -d postgres -p 288${{ matrix.pg_version }} -c "SELECT extname, extversion FROM pg_extension WHERE extname = 'pg_search';" + + # echo "" + # echo "Extension successfully upgraded from v$BASE_RELEASE to v$NEW_VERSION!" + + # echo "" + # echo "Restarting Postgres..." + # cargo pgrx stop pg${{ matrix.pg_version }} + # cargo pgrx start pg${{ matrix.pg_version }} + # else + # echo "" + # echo "Building pg_search..." + # cargo pgrx install --features icu --pg-config="/usr/lib/postgresql/${{ matrix.pg_version }}/bin/pg_config" --release + + # echo "" + # echo "Starting Postgres..." + # cargo pgrx start pg${{ matrix.pg_version }} + # fi echo "" - echo "Enabling code coverage..." - echo -e "\n# Enable code coverage on Linux only, for CI builds\n[target.'cfg(target_os=\"linux\")']\nrustflags = [\"-Cinstrument-coverage\"]" >> ../.cargo/config.toml - mkdir -p ../target/coverage ../target/coverage-report - - # If this is a promotion PR, we test upgrading the extension by pulling the earliest version of the extension compatible with our current default Postgres version - if [[ "${{ github.base_ref }}" == "main" && "${{ matrix.pg_version }}" == "${{ env.default_pg_version }}" ]]; then - echo "" - echo "Promotion PR detected! Running extension upgrade test..." - if [[ "${{ github.event.inputs.test_upgrade_version }}" == "" ]]; then - echo "Using the GitHub Variables version..." - NEW_VERSION=${{ vars.VERSION_MAJOR }}.${{ vars.VERSION_MINOR }}.${{ vars.VERSION_PATCH }} - else - echo "Using the workflow_dispatch version..." - NEW_VERSION="${{ github.event.inputs.test_upgrade_version }}" - fi - echo "Running extension upgrade test from v$BASE_RELEASE to v$NEW_VERSION..." - - echo "" - echo "Downloading pg_search v$BASE_RELEASE..." - curl -LOJ "https://github.com/paradedb/paradedb/releases/download/v$BASE_RELEASE/pg_search-v$BASE_RELEASE-pg${{ matrix.pg_version }}-${{ matrix.arch }}-ubuntu2204.deb" - sudo dpkg -i "pg_search-v$BASE_RELEASE-pg${{ matrix.pg_version }}-${{ matrix.arch }}-ubuntu2204.deb" - - echo "" - echo "Starting Postgres..." - cargo pgrx start pg${{ matrix.pg_version }} - - echo "" - echo "Loading pg_search v$BASE_RELEASE..." - psql -h localhost -d postgres -p 288${{ matrix.pg_version }} -c "CREATE EXTENSION pg_search VERSION '$BASE_RELEASE';" - - echo "" - echo "Verifying current pg_search installed version..." - psql -h localhost -d postgres -p 288${{ matrix.pg_version }} -c "SELECT extname, extversion FROM pg_extension WHERE extname = 'pg_search';" - - echo "" - echo "Building pg_search v$NEW_VERSION..." - sudo chown -R "$(whoami)" "/usr/share/postgresql/${{ matrix.pg_version }}/extension/" "/usr/lib/postgresql/${{ matrix.pg_version }}/lib/" - cargo pgrx install --features icu --pg-config="/usr/lib/postgresql/${{ matrix.pg_version }}/bin/pg_config" --release - - echo "" - echo "Upgrading pg_search to v$NEW_VERSION..." - psql -h localhost -d postgres -p 288${{ matrix.pg_version }} -c "ALTER EXTENSION pg_search UPDATE TO '$NEW_VERSION';" - - echo "" - echo "Verifying current pg_search installed version..." - psql -h localhost -d postgres -p 288${{ matrix.pg_version }} -c "SELECT extname, extversion FROM pg_extension WHERE extname = 'pg_search';" - - echo "" - echo "Extension successfully upgraded from v$BASE_RELEASE to v$NEW_VERSION!" - - echo "" - echo "Restarting Postgres..." - cargo pgrx stop pg${{ matrix.pg_version }} - cargo pgrx start pg${{ matrix.pg_version }} - else - echo "" - echo "Building pg_search..." - cargo pgrx install --features icu --pg-config="/usr/lib/postgresql/${{ matrix.pg_version }}/bin/pg_config" --release - - echo "" - echo "Starting Postgres..." - cargo pgrx start pg${{ matrix.pg_version }} - fi + echo "Building pg_search..." + cargo pgrx install --features icu --pg-config="/usr/lib/postgresql/${{ matrix.pg_version }}/bin/pg_config" --release + + echo "" + echo "Starting Postgres..." + cargo pgrx start pg${{ matrix.pg_version }} # Necessary for the ephemeral Postgres test to have proper permissions sudo chown -R $(whoami) /var/run/postgresql/