create gradle tasks "test", "testSql", "migrations" and run docker before tasks

This commit is contained in:
2021-02-27 23:20:57 +01:00
parent c25cf64f4b
commit 7446bd506a
13 changed files with 325 additions and 102 deletions

View File

@@ -86,14 +86,14 @@ class NotificationConsumerTest {
followArticleRepo = followArticleRepo,
followConstitutionRepo = mockk(),
notificationEmailSender = emailSender,
exchangeName = "notification_test",
exchangeName = "notification",
).apply { start() }
verify { rabbitFactory.newConnection() }
/* Push message */
Publisher(
factory = rabbitFactory,
exchangeName = "notification_test",
exchangeName = "notification",
).publish(
ArticleUpdateNotification(
ArticleForView(

View File

@@ -1,7 +1,6 @@
ktor {
deployment {
port = 8080
port = ${?PORT}
port = 8181
}
application {
modules = [ fr.dcproject.ApplicationKt.module ]
@@ -15,26 +14,22 @@ app {
db {
host = localhost
host = ${?DB_HOST}
database = test
username = test
password = test
port = 5432
port = 5433
}
redis {
connection = "redis://localhost:6379"
connection = ${?REDIS_CONNECTION}
connection = "redis://localhost:6380"
}
rabbitmq {
connection = "amqp://localhost:5672"
connection = ${?RABBITMQ_CONNECTION}
}
elasticsearch {
connection = "http://localhost:9200"
connection = ${?ELASTICSEARCH_CONNECTION}
connection = "http://localhost:9201"
}
mail {

View File

@@ -1,6 +1,6 @@
#!/bin/bash
options=("All" "article" "citizen" "comment" "constitution" "follow" "opinion" "user" "vote" "workgroup" "RESET DB" "Quit")
options=("All" "RESET DB" "article" "citizen" "comment" "constitution" "follow" "opinion" "user" "vote" "workgroup" "Quit")
if [ -z "$1" ]; then
PS3='Please enter your choice: '
select ch in "${options[@]}"
@@ -17,7 +17,7 @@ case $opt in
awk 'FNR==1{print "--------------------"}1' \
../../main/resources/sql/migrations/*.down.sql \
../../main/resources/sql/migrations/*.up.sql > ./allSQL.sql
docker exec -i dc-project_postgresql psql test test -q -b -v "ON_ERROR_STOP=1" < ./allSQL.sql
docker exec -i dc-project_postgresql_test psql test test -q -b -v "ON_ERROR_STOP=1" < ./allSQL.sql
rm ./allSQL.sql
;;
"All")
@@ -26,7 +26,7 @@ case $opt in
../../main/resources/sql/functions/*/*.sql \
./fixtures/*.sql \
./*.sql > ./allSQL.sql
docker exec -i dc-project_postgresql psql test test -q -b -v "ON_ERROR_STOP=1" < ./allSQL.sql
docker exec -i dc-project_postgresql_test psql test test -q -b -v "ON_ERROR_STOP=1" < ./allSQL.sql
rm ./allSQL.sql
;;
"Quit")
@@ -37,7 +37,7 @@ case $opt in
../../main/resources/sql/functions/*/*.sql \
./fixtures/*.sql \
./"$opt".sql > ./allSQL.sql
docker exec -i dc-project_postgresql psql test test -q -b -v "ON_ERROR_STOP=1" < ./allSQL.sql
docker exec -i dc-project_postgresql_test psql test test -q -b -v "ON_ERROR_STOP=1" < ./allSQL.sql
rm ./allSQL.sql
;;
esac