Skip to content

Commit 31aec97

Browse files
authored
chore: simplify extension testing (#553)
1 parent 28ad851 commit 31aec97

File tree

5 files changed

+3
-53
lines changed

5 files changed

+3
-53
lines changed

ansible/tasks/test-image.yml

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,6 @@
1717
cmd: /usr/bin/pg_ctl -D /var/lib/postgresql/data start "-o -c config_file=/etc/postgresql/postgresql.conf"
1818
when: ebssurrogate_mode
1919

20-
- name: Enable pgTAP extension
21-
shell: /usr/lib/postgresql/bin/psql -U postgres -h localhost -d postgres -c "CREATE extension pgtap";
22-
when: ebssurrogate_mode
23-
24-
- name: Create function for testing extensions
25-
shell: /usr/lib/postgresql/bin/psql -U postgres -h localhost -d postgres -f /tmp/unit-tests/test-extensions.sql;
26-
when: ebssurrogate_mode
27-
28-
- name: Extension Installation tests
29-
shell: /usr/bin/pg_prove -U supabase_admin -h localhost -d postgres -v /tmp/unit-tests/verify-extensions.sql
30-
register: retval
31-
when: ebssurrogate_mode
32-
3320
- name: Run Unit tests (with filename unit-test-*) on Postgres Database
3421
shell: /usr/bin/pg_prove -U postgres -h localhost -d postgres -v /tmp/unit-tests/unit-test-*.sql
3522
register: retval
@@ -51,14 +38,6 @@
5138
cmd: mv /etc/postgresql/postgresql.conf.bak /etc/postgresql/postgresql.conf
5239
when: ebssurrogate_mode
5340

54-
- name: Drop pgTap extension
55-
shell: /usr/lib/postgresql/bin/psql -U postgres -h localhost -d postgres -c "DROP extension if exists pgtap";
56-
when: ebssurrogate_mode
57-
58-
- name: Drop extension test function
59-
shell: /usr/lib/postgresql/bin/psql -U postgres -h localhost -d postgres -c "DROP FUNCTION IF EXISTS install_available_extensions_and_test";
60-
when: ebssurrogate_mode
61-
6241
- name: Reset db stats
6342
shell: /usr/lib/postgresql/bin/psql --no-password --no-psqlrc -d postgres -h localhost -U supabase_admin -c 'SELECT pg_stat_statements_reset(); SELECT pg_stat_reset();'
6443
when: ebssurrogate_mode

ebssurrogate/files/unit-tests/test-extensions.sql

Lines changed: 0 additions & 20 deletions
This file was deleted.

ebssurrogate/files/unit-tests/unit-test-01.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
BEGIN;
2+
CREATE EXTENSION IF NOT EXISTS pgtap;
23
SELECT plan(8);
34

45
-- Check installed extensions

ebssurrogate/files/unit-tests/verify-extensions.sql

Lines changed: 0 additions & 12 deletions
This file was deleted.

migrations/docker-compose.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ services:
2828
depends_on:
2929
db:
3030
condition: service_healthy
31+
dbmate:
32+
condition: service_completed_successfully
3133
environment:
3234
PGHOST: db
3335
PGUSER: supabase_admin

0 commit comments

Comments
 (0)