Skip to content

Commit dc85636

Browse files
committed
test(postgres/smoke_test): update the test to create different databases to simulate different peers
1 parent cfe39c0 commit dc85636

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

docker/postgresql/smoke_test.sql

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
-- - normal: `psql postgresql://postgres:postgres@localhost:5432/cloudsync_test -f docker/postgresql/smoke_test.sql`
33
-- - debug: `psql -v DEBUG=1 postgresql://postgres:postgres@localhost:5432/cloudsync_test -f docker/postgresql/smoke_test.sql`
44

5+
DROP DATABASE IF EXISTS cloudsync_test_1;
6+
CREATE DATABASE cloudsync_test_1;
7+
\connect cloudsync_test_1
8+
59
\set ON_ERROR_STOP on
610
\set fail 0
711
\if :{?DEBUG}
@@ -18,8 +22,8 @@ SET client_min_messages = warning; SET log_min_messages = warning;
1822
\endif
1923

2024
-- Reset extension and install
21-
DROP EXTENSION IF EXISTS cloudsync CASCADE;
22-
CREATE EXTENSION cloudsync;
25+
-- DROP EXTENSION IF EXISTS cloudsync CASCADE;
26+
CREATE EXTENSION IF NOT EXISTS cloudsync;
2327

2428
-- 'Test version visibility'
2529
SELECT cloudsync_version() AS version \gset
@@ -306,7 +310,7 @@ SET client_min_messages = warning; SET log_min_messages = warning;
306310
\pset tuples_only on
307311
\pset format unaligned
308312
\endif
309-
CREATE EXTENSION cloudsync;
313+
CREATE EXTENSION IF NOT EXISTS cloudsync;
310314
DROP TABLE IF EXISTS smoke_tbl;
311315
CREATE TABLE smoke_tbl (id TEXT PRIMARY KEY, val TEXT);
312316
SELECT cloudsync_init('smoke_tbl', 'CLS', true) AS _init_site_id_b \gset

0 commit comments

Comments
 (0)