From a0b63cd0be2a8f1f893270c82e91c727d080d66d Mon Sep 17 00:00:00 2001 From: YuehuCao Date: Wed, 20 Aug 2025 00:34:33 +0800 Subject: [PATCH] refactor(test): relocate template tests to integration suite --- apps/notification/tests/integration_tests/README.md | 7 ++----- .../integration_tests}/create_global_templates.py | 0 .../{ => tests/integration_tests}/local.env | 11 ++++++++--- 3 files changed, 10 insertions(+), 8 deletions(-) rename apps/notification/{ => tests/integration_tests}/create_global_templates.py (100%) rename apps/notification/{ => tests/integration_tests}/local.env (79%) diff --git a/apps/notification/tests/integration_tests/README.md b/apps/notification/tests/integration_tests/README.md index 4c99f13..43e9bf9 100644 --- a/apps/notification/tests/integration_tests/README.md +++ b/apps/notification/tests/integration_tests/README.md @@ -3,12 +3,8 @@ # run the command cd notification -# for local environment source local.env python webapi/main.py & -# for alpha environment -source alpha.env -python webapi/main.py & ``` After running the commands, the notification api will start @@ -40,4 +36,5 @@ After running the commands, email will be sent ### Q: Why is the email sent twice? ### Q: Why do I recieve 2 identical emails at the same time -### A: in infra/rabbitmq/async_client.py, use exchange_name_format = "freeleaps.notification.exchange.local.{}" for local environment, while exchange_name_format = "freeleaps.notification.exchange.{}" for alpha environment. \ No newline at end of file +### A: when use local mongodb_uri, use exchange_name_format = "freeleaps.notification.exchange.local.{} in infra/rabbitmq/async_client.py. + while exchange_name_format = "freeleaps.notification.exchange.{}" for alpha mongodb_uri. \ No newline at end of file diff --git a/apps/notification/create_global_templates.py b/apps/notification/tests/integration_tests/create_global_templates.py similarity index 100% rename from apps/notification/create_global_templates.py rename to apps/notification/tests/integration_tests/create_global_templates.py diff --git a/apps/notification/local.env b/apps/notification/tests/integration_tests/local.env similarity index 79% rename from apps/notification/local.env rename to apps/notification/tests/integration_tests/local.env index c12ffc6..93d5880 100644 --- a/apps/notification/local.env +++ b/apps/notification/tests/integration_tests/local.env @@ -1,6 +1,6 @@ export APP_NAME=notification export SERVICE_API_ACCESS_HOST=0.0.0.0 -export SERVICE_API_ACCESS_PORT=8014 +export SERVICE_API_ACCESS_PORT=8104 export CONTAINER_APP_ROOT=/app export LOG_BASE_PATH=$CONTAINER_APP_ROOT/log/$APP_NAME export BACKEND_LOG_FILE_NAME=$APP_NAME @@ -13,6 +13,7 @@ export SYSTEM_USER_ID=117f191e810c19729de860aa export SMS_FROM=+16898887156 export EMAIL_FROM=freeleaps@freeleaps.com export SECRET_KEY=ea84edf152976b2fcec12b78aa8e45bc26a5cf0ef61bf16f5c317ae33b3fd8b0 +#export SECRET_KEY=pv5m-tAa5D2q3j8EQ7kKA4nm2W0IdmxWkdVidLdDZzCdre30I0P_cQ export GIT_REPO_ROOT=/mnt/freeleaps/freeleaps-service-hub export CODEBASE_ROOT=/mnt/freeleaps/freeleaps-service-hub/apps/notification export SITE_DEPLOY_FOLDER=/mnt/freeleaps/freeleaps-service-hub/sites/notification/deploy @@ -25,7 +26,11 @@ export DOCKER_BACKEND_HOME=$DOCKER_APP_HOME/$APP_NAME export DOCKER_BACKEND_LOG_HOME=$DOCKER_BACKEND_HOME/log export RABBITMQ_HOST=localhost export RABBITMQ_PORT=5672 -export MONGODB_URI="mongodb+srv://jetli:8IHKx6dZK8BfugGp@freeleaps2.hanbj.mongodb.net/" -export MONGODB_NAME="freeleaps2" + +# for local environment +export MONGODB_URI=mongodb://localhost:27017/ +# connectivity from local to alpha +#export MONGODB_URI=mongodb+srv://jetli:8IHKx6dZK8BfugGp@freeleaps2.hanbj.mongodb.net/ +export MONGODB_NAME=interview export FREELEAPS_ENV=local export LOG_BASE_PATH=./log