refactor(test): relocate template tests to integration suite

This commit is contained in:
YuehuCao 2025-08-20 00:34:33 +08:00
parent fc2aaebf94
commit a0b63cd0be
3 changed files with 10 additions and 8 deletions

View File

@ -3,12 +3,8 @@
# run the command # run the command
cd notification cd notification
# for local environment
source local.env source local.env
python webapi/main.py & python webapi/main.py &
# for alpha environment
source alpha.env
python webapi/main.py &
``` ```
After running the commands, the notification api will start 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 is the email sent twice?
### Q: Why do I recieve 2 identical emails at the same time ### 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. ### 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.

View File

@ -1,6 +1,6 @@
export APP_NAME=notification export APP_NAME=notification
export SERVICE_API_ACCESS_HOST=0.0.0.0 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 CONTAINER_APP_ROOT=/app
export LOG_BASE_PATH=$CONTAINER_APP_ROOT/log/$APP_NAME export LOG_BASE_PATH=$CONTAINER_APP_ROOT/log/$APP_NAME
export BACKEND_LOG_FILE_NAME=$APP_NAME export BACKEND_LOG_FILE_NAME=$APP_NAME
@ -13,6 +13,7 @@ export SYSTEM_USER_ID=117f191e810c19729de860aa
export SMS_FROM=+16898887156 export SMS_FROM=+16898887156
export EMAIL_FROM=freeleaps@freeleaps.com export EMAIL_FROM=freeleaps@freeleaps.com
export SECRET_KEY=ea84edf152976b2fcec12b78aa8e45bc26a5cf0ef61bf16f5c317ae33b3fd8b0 export SECRET_KEY=ea84edf152976b2fcec12b78aa8e45bc26a5cf0ef61bf16f5c317ae33b3fd8b0
#export SECRET_KEY=pv5m-tAa5D2q3j8EQ7kKA4nm2W0IdmxWkdVidLdDZzCdre30I0P_cQ
export GIT_REPO_ROOT=/mnt/freeleaps/freeleaps-service-hub export GIT_REPO_ROOT=/mnt/freeleaps/freeleaps-service-hub
export CODEBASE_ROOT=/mnt/freeleaps/freeleaps-service-hub/apps/notification export CODEBASE_ROOT=/mnt/freeleaps/freeleaps-service-hub/apps/notification
export SITE_DEPLOY_FOLDER=/mnt/freeleaps/freeleaps-service-hub/sites/notification/deploy 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 DOCKER_BACKEND_LOG_HOME=$DOCKER_BACKEND_HOME/log
export RABBITMQ_HOST=localhost export RABBITMQ_HOST=localhost
export RABBITMQ_PORT=5672 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 FREELEAPS_ENV=local
export LOG_BASE_PATH=./log export LOG_BASE_PATH=./log