From 47a7e7e8931dd60646e7ed70625484e6f3cbb0e8 Mon Sep 17 00:00:00 2001 From: tyknkd <78797823+tyknkd@users.noreply.github.com> Date: Wed, 22 May 2024 14:38:16 +0900 Subject: [PATCH] test: dedicated data support test db --- .env | 3 ++- .../kotlin/test/newsanalyzer/datasupport/DataSupportTest.kt | 2 +- compose.yaml | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.env b/.env index ccc00b2..78ea8b1 100644 --- a/.env +++ b/.env @@ -14,6 +14,7 @@ export COLLECTOR_QUEUE=collector_queue export COLLECTOR_ROUTING_KEY=collector_key export COLLECTOR_TEST_DB=collector_test_db export COLLECTOR_TEST_EXCHANGE=collector_test_exchange +export DATA_SUPPORT_TEST_DB=data_support_test_db export GRAFANA_PORT=3000 export POSTGRES_DB=${COLLECTOR_DB} export POSTGRES_HOST=db @@ -30,4 +31,4 @@ export WEBSERVER_DB=webserver_db export WEBSERVER_HOST=web-server export WEBSERVER_PORT=8888 export WEBSERVER_TEST_DB=webserver_test_db -export ADDITIONAL_POSTGRES_DB=${ANALYZER_DB},${WEBSERVER_DB},${COLLECTOR_TEST_DB},${ANALYZER_TEST_DB},${WEBSERVER_TEST_DB} \ No newline at end of file +export ADDITIONAL_POSTGRES_DB=${ANALYZER_DB},${WEBSERVER_DB},${ANALYZER_TEST_DB},${COLLECTOR_TEST_DB},${DATA_SUPPORT_TEST_DB},${WEBSERVER_TEST_DB} \ No newline at end of file diff --git a/components/data-support/src/test/kotlin/test/newsanalyzer/datasupport/DataSupportTest.kt b/components/data-support/src/test/kotlin/test/newsanalyzer/datasupport/DataSupportTest.kt index ba9c7fd..d32ff11 100644 --- a/components/data-support/src/test/kotlin/test/newsanalyzer/datasupport/DataSupportTest.kt +++ b/components/data-support/src/test/kotlin/test/newsanalyzer/datasupport/DataSupportTest.kt @@ -9,7 +9,7 @@ import kotlin.test.* class DataSupportTest { private val tables: List = listOf(Topics) - private val database: Database = DatabaseTemplate(System.getenv("ANALYZER_TEST_DB"), emptyList()).database + private val database: Database = DatabaseTemplate(System.getenv("DATA_SUPPORT_TEST_DB"), emptyList()).database private val topic = Topic( topicId = 0, terms = "[article, description, title, content, second, interesting, grabbing, begins, organization, catchy]" diff --git a/compose.yaml b/compose.yaml index d5b4189..7352a5b 100644 --- a/compose.yaml +++ b/compose.yaml @@ -193,6 +193,7 @@ services: COLLECTOR_QUEUE: ${COLLECTOR_QUEUE} COLLECTOR_ROUTING_KEY: ${COLLECTOR_ROUTING_KEY} COLLECTOR_TEST_DB: ${COLLECTOR_TEST_DB} + DATA_SUPPORT_TEST_DB: ${DATA_SUPPORT_TEST_DB} NEWS_API_KEY_FILE: /run/secrets/news_api_key POSTGRES_HOST: ${POSTGRES_HOST} POSTGRES_PASSWORD_FILE: /run/secrets/postgres_password