Add script to launch SQL test
This commit is contained in:
@@ -30,6 +30,3 @@ begin
|
||||
raise notice 'constitution test pass';
|
||||
end
|
||||
$$;
|
||||
|
||||
|
||||
-- select uuid_generate_v4();
|
||||
@@ -24,4 +24,4 @@ begin
|
||||
select (a->>'id')::uuid into _article_id from upsert_article(created_article) a;
|
||||
end if;
|
||||
end;
|
||||
$$
|
||||
$$;
|
||||
|
||||
@@ -21,4 +21,4 @@ begin
|
||||
select upsert_citizen(created_citizen) into created_citizen;
|
||||
_citizen_id := created_citizen->>'id';
|
||||
end
|
||||
$$
|
||||
$$;
|
||||
|
||||
@@ -15,4 +15,4 @@ begin
|
||||
select insert_user(created_user) into created_user;
|
||||
user_id := created_user->>'id';
|
||||
end
|
||||
$$
|
||||
$$;
|
||||
|
||||
@@ -26,4 +26,4 @@ begin
|
||||
select upsert_workgroup(created_workgroup) into created_workgroup;
|
||||
assert created_workgroup->>'description' is not null, 'description should not be null';
|
||||
end;
|
||||
$$
|
||||
$$;
|
||||
|
||||
@@ -83,7 +83,6 @@ begin
|
||||
assert(select (a#>>'{opinions, Opinion1}')::int = 1
|
||||
from find_article_by_id((created_article->>'id')::uuid) a), 'the article must be have a opinion';
|
||||
|
||||
raise notice '%', opinion2;
|
||||
assert(select (opinion2#>>'{choice, id}')::uuid = opinion_choice2_id), 'opinion2 is not inserted';
|
||||
assert(select (opinion2#>>'{choice, name}') = 'Opinion2'), 'no name for opinion2';
|
||||
|
||||
|
||||
6
src/test/test.sh
Normal file
6
src/test/test.sh
Normal file
@@ -0,0 +1,6 @@
|
||||
#bin/bash
|
||||
echo "Start tests"
|
||||
cat ../main/resources/sql/functions/*/*.sql ../main/resources/sql/migrations/*.sql ./sql/fixtures/*.sql ./sql/*.sql > ./allSQL.sql
|
||||
docker exec -i postgresql_dc-project psql test test -q -b -v "ON_ERROR_STOP=1" < ./allSQL.sql
|
||||
rm ./allSQL.sql
|
||||
#sleep 20
|
||||
Reference in New Issue
Block a user