mirror of
https://github.com/rasilon/ujetl.git
synced 2026-04-11 10:29:29 +00:00
Add dockerised tests
This commit is contained in:
parent
3badb97d49
commit
5571bd1b4d
14 changed files with 143 additions and 76 deletions
3
docker/test_db/Dockerfile
Normal file
3
docker/test_db/Dockerfile
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
FROM postgres:11
|
||||
COPY setup.sql /docker-entrypoint-initdb.d/
|
||||
COPY is_ready /
|
||||
3
docker/test_db/is_ready
Normal file
3
docker/test_db/is_ready
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
#!/bin/bash
|
||||
/usr/lib/postgresql/9.6/bin/psql -U postgres -c "SELECT 1 FROM public.container_ready" postgres
|
||||
|
||||
26
docker/test_db/setup.sql
Normal file
26
docker/test_db/setup.sql
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
CREATE DATABASE test;
|
||||
\c test
|
||||
CREATE ROLE test login password 'test';
|
||||
CREATE UNLOGGED TABLE source (
|
||||
id bigserial primary key,
|
||||
test_int integer,
|
||||
test_text text,
|
||||
test_ts timestamp with time zone
|
||||
);
|
||||
CREATE UNLOGGED TABLE dest (
|
||||
id bigint primary key,
|
||||
test_int integer,
|
||||
test_text text,
|
||||
test_ts timestamp with time zone
|
||||
);
|
||||
|
||||
|
||||
GRANT SELECT ON source to test;
|
||||
GRANT SELECT,INSERT,UPDATE,DELETE ON dest TO test;
|
||||
|
||||
INSERT INTO source(test_int,test_text,test_ts) SELECT 1,'banana',now() FROM generate_series(1,100000);
|
||||
|
||||
\c postgres
|
||||
CREATE TABLE public.container_ready AS SELECT 1 FROM(VALUES(1)) AS a(a);
|
||||
GRANT SELECT ON public.container_ready TO TEST;
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue