|
35 | 35 |
|
36 | 36 | - name: Install PostgreSQL client |
37 | 37 | run: | |
38 | | - # Install PostgreSQL client from Ubuntu repositories (works with all PostgreSQL versions) |
| 38 | + # Install default PostgreSQL client (works for all versions) |
39 | 39 | sudo apt-get update |
40 | | - sudo apt-get install -y postgresql-client-common postgresql-client-14 |
| 40 | + sudo apt-get install -y postgresql-client |
41 | 41 | |
42 | 42 | # Verify installation |
43 | 43 | psql --version |
@@ -142,108 +142,4 @@ jobs: |
142 | 142 | |
143 | 143 | echo "✅ All regression tests passed" |
144 | 144 |
|
145 | | - test-beta: |
146 | | - runs-on: ubuntu-latest |
147 | | - continue-on-error: true # Allow beta tests to fail without breaking CI |
148 | | - |
149 | | - strategy: |
150 | | - matrix: |
151 | | - postgres-version: ['18-beta', '19-beta'] |
152 | | - fail-fast: false |
153 | | - |
154 | | - services: |
155 | | - postgres: |
156 | | - image: postgres:${{ matrix.postgres-version }} |
157 | | - env: |
158 | | - POSTGRES_PASSWORD: postgres |
159 | | - POSTGRES_DB: test |
160 | | - options: >- |
161 | | - --health-cmd pg_isready |
162 | | - --health-interval 10s |
163 | | - --health-timeout 5s |
164 | | - --health-retries 5 |
165 | | - ports: |
166 | | - - 5432:5432 |
167 | | - |
168 | | - steps: |
169 | | - - name: Checkout code |
170 | | - uses: actions/checkout@v4 |
171 | | - |
172 | | - - name: Install PostgreSQL client |
173 | | - run: | |
174 | | - # Install PostgreSQL client from Ubuntu repositories (works with all PostgreSQL versions) |
175 | | - sudo apt-get update |
176 | | - sudo apt-get install -y postgresql-client-common postgresql-client-14 |
177 | | - |
178 | | - # Verify installation |
179 | | - psql --version |
180 | | - |
181 | | - - name: Configure PostgreSQL for pg_stat_statements |
182 | | - run: | |
183 | | - # Wait for PostgreSQL to be ready |
184 | | - until pg_isready -h localhost -p 5432 -U postgres; do |
185 | | - echo "Waiting for postgres..." |
186 | | - sleep 2 |
187 | | - done |
188 | | - |
189 | | - # Get container ID |
190 | | - CONTAINER_ID=$(docker ps --filter "expose=5432" --format "{{.ID}}") |
191 | | - echo "PostgreSQL container: $CONTAINER_ID" |
192 | | - |
193 | | - # Stop PostgreSQL to modify configuration |
194 | | - docker exec $CONTAINER_ID pg_ctl -D /var/lib/postgresql/data -m fast stop || true |
195 | | - |
196 | | - # Configure shared_preload_libraries |
197 | | - docker exec $CONTAINER_ID bash -c "echo \"shared_preload_libraries = 'pg_stat_statements'\" >> /var/lib/postgresql/data/postgresql.conf" |
198 | | - |
199 | | - # Configure trust authentication |
200 | | - docker exec $CONTAINER_ID bash -c "echo 'host all all all trust' > /var/lib/postgresql/data/pg_hba.conf" |
201 | | - docker exec $CONTAINER_ID bash -c "echo 'local all all trust' >> /var/lib/postgresql/data/pg_hba.conf" |
202 | | - |
203 | | - # Restart PostgreSQL |
204 | | - docker exec $CONTAINER_ID pg_ctl -D /var/lib/postgresql/data -l /var/lib/postgresql/data/logfile start |
205 | | - |
206 | | - # Wait for PostgreSQL to be ready after restart |
207 | | - sleep 5 |
208 | | - until pg_isready -h localhost -p 5432 -U postgres; do |
209 | | - echo "Waiting for postgres to restart..." |
210 | | - sleep 2 |
211 | | - done |
212 | | - |
213 | | - echo "PostgreSQL ${{ matrix.postgres-version }} configured successfully" |
214 | | - |
215 | | - - name: Prepare test database |
216 | | - run: | |
217 | | - # Check PostgreSQL version |
218 | | - PGPASSWORD=postgres psql -h localhost -U postgres -d test -c 'SELECT version();' |
219 | | - |
220 | | - # Create extensions |
221 | | - PGPASSWORD=postgres psql -h localhost -U postgres -d test -c 'CREATE EXTENSION IF NOT EXISTS pg_stat_statements;' |
222 | | - PGPASSWORD=postgres psql -h localhost -U postgres -d test -c 'CREATE EXTENSION IF NOT EXISTS pgstattuple;' |
223 | | - |
224 | | - # Create test tables |
225 | | - PGPASSWORD=postgres psql -h localhost -U postgres -d test -c "CREATE TABLE align1 AS SELECT 1::int4, 2::int8, 3::int4 AS more FROM generate_series(1, 100000) _(i);" |
226 | | - PGPASSWORD=postgres psql -h localhost -U postgres -d test -c "CREATE TABLE align2 AS SELECT 1::int4, 3::int4 AS more, 2::int8 FROM generate_series(1, 100000) _(i);" |
227 | | - |
228 | | - - name: Test wide mode (beta) |
229 | | - run: | |
230 | | - echo "\set postgres_dba_wide true" > ~/.psqlrc |
231 | | - echo "\set postgres_dba_interactive_mode false" >> ~/.psqlrc |
232 | | - echo "Testing all SQL files in wide mode (PostgreSQL ${{ matrix.postgres-version }})..." |
233 | | - for f in sql/*; do |
234 | | - echo " Testing $f..." |
235 | | - PGPASSWORD=postgres psql -h localhost -U postgres -d test --no-psqlrc -f warmup.psql -f "$f" > /dev/null 2>&1 || echo " ⚠️ Warning: $f failed in wide mode (beta)" |
236 | | - done |
237 | | - echo "✅ Wide mode tests completed (beta)" |
238 | | - |
239 | | - - name: Test normal mode (beta) |
240 | | - run: | |
241 | | - echo "\set postgres_dba_wide false" > ~/.psqlrc |
242 | | - echo "\set postgres_dba_interactive_mode false" >> ~/.psqlrc |
243 | | - echo "Testing all SQL files in normal mode (PostgreSQL ${{ matrix.postgres-version }})..." |
244 | | - for f in sql/*; do |
245 | | - echo " Testing $f..." |
246 | | - PGPASSWORD=postgres psql -h localhost -U postgres -d test --no-psqlrc -f warmup.psql -f "$f" > /dev/null 2>&1 || echo " ⚠️ Warning: $f failed in normal mode (beta)" |
247 | | - done |
248 | | - echo "✅ Normal mode tests completed (beta)" |
249 | 145 |
|
0 commit comments