* refactor: clietn in msggateway Signed-off-by: rfyiamcool <rfyiamcool@163.com> * perf: add sync.pool for req object Signed-off-by: rfyiamcool <rfyiamcool@163.com> --------- Signed-off-by: rfyiamcool <rfyiamcool@163.com> feat: use dummy pusher by default (#1349) Add Prometheus monitoring function (#1337) * Code adaptation k8s: service discovery and registration adaptation, configuration adaptation * Initial submission of the help charts script for openim API * change the help charts script * change the help charts script * change helm chart codes * change dockerfiles script * change chart script:add configmap mounts * change chart script:change repository * change chart script:msggateway add one service * change config.yaml * roll back some config values * change chart script:change Ingress rule with a rewrite annotation * add mysql charts scrible * change chart script:add mysql.config.yaml * add nfs provisioner charts * change chart script:add nfs.config.yaml * add ingress-nginx charts * change chart script:add ingress-nginx.config.yaml * add redis &mongodb charts * add kafka&minio charts * change chart script:change redis.values.yaml * change chart script:add redis.config.yaml * change chart script:change redis.config.yaml * change chart script:change mongodb.value.yaml * change chart script:change mongodb.value.yaml * change chart script:add mongodb.config.yaml * change chart script:change minio.values.yaml * change chart script:add minio.config.yaml * change chart script:change kafka.values.yaml * change chart script:add kafka.config.yaml * change chart script:change services.config.yaml * bug fix:Delete websocket's Port restrictions * bug fix:change port value * change chart script:Submit a stable version script * fix bug:Implement option interface * fix bug:change K8sDR.Register * change config.yaml * change chats script:minio service add ingress * change chats script:minio service add ingress * change chats script:kafka.replicaCount=3& change minio.api ingress * delete change chats script * change config.yaml * change openim.yaml * merge go.sum * Add monitoring function and struct for Prometheus on gin and GRPC * Add GRPC and gin server monitoring logic * Add GRPC and gin server monitoring logic2 * Add GRPC and gin server monitoring logic3 * Add GRPC and gin server monitoring logic4 * Add GRPC and gin server monitoring logic5 * Add GRPC and gin server monitoring logic6 * Add GRPC and gin server monitoring logic7 * delete:old monitoring code * add for test * fix bug:change packname * fix bug:delete getPromPort funciton * fix bug:delete getPromPort funciton * fix bug:change logs * fix bug:change registerName logic in GetGrpcCusMetrics function * add getPrometheus url api * fix:config path logic * fix:prometheus enable function * fix:prometheus enable function * fix:transfer Multi process monitoring logic * del:del not using manifest * fix:openim-msgtransfer.sh * fix:openim-msgtransfer.sh --------- Co-authored-by: lin.huang <lin.huang@apulis.com> Co-authored-by: Xinwei Xiong <3293172751@qq.com> fix: initiateUpload sign list number (#1358) * optimize scheduled deletion * optimize scheduled deletion * optimize scheduled deletion * optimize scheduled deletion * minio cache * fix: conflicts * feat: minio cache * feat: cache optimize * feat: cache optimize * feat: cache optimize * feat: cache optimize * feat: cache optimize * fix: initiateUpload sign list number fix: msg pull change and fcm redis flag fix. (#1367) * fix: to start im or chat, ZooKeeper must be started first. * fix: msg gateway start output err info Signed-off-by: Gordon <1432970085@qq.com> * fix: msg gateway start output err info Signed-off-by: Gordon <1432970085@qq.com> * chore: package path changes Signed-off-by: withchao <993506633@qq.com> * fix: go mod update Signed-off-by: Gordon <1432970085@qq.com> * fix: token update Signed-off-by: Gordon <1432970085@qq.com> * chore: package path changes Signed-off-by: withchao <993506633@qq.com> * chore: package path changes Signed-off-by: withchao <993506633@qq.com> * fix: token update Signed-off-by: Gordon <1432970085@qq.com> * fix: token update Signed-off-by: Gordon <1432970085@qq.com> * fix: token update Signed-off-by: Gordon <1432970085@qq.com> * fix: token update Signed-off-by: Gordon <1432970085@qq.com> * fix: token update Signed-off-by: Gordon <1432970085@qq.com> * fix: token update Signed-off-by: Gordon <1432970085@qq.com> * fix: get all userID Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * fix: msggateway add online status call Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * refactor: log change Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * refactor: log change Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * chore: network mode change Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * cicd: robot automated Change Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * cicd: robot automated Change Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * cicd: robot automated Change Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * feat: add api of get server time Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * feat: remove go work sum Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * cicd: robot automated Change Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * fix: pull message add isRead field Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * fix: check msg-transfer script Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * fix: script update Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * fix: script update Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * fix: script update Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * fix: script update Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * fix: script update Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * fix: script update Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * fix: script update Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * fix: script update Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * fix: script update Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * fix: script update Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * fix: script update Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * fix: script update Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * fix: script update Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * fix: script update Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * fix: script update Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * fix: script update Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * fix: script update Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * fix: start don't kill old process Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * cicd: robot automated Change Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * fix: check component Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * fix: pull message set isRead only message come from single. Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * cicd: robot automated Change Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * fix: multiple gateway kick user each other. Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * fix: multiple gateway kick user each other. Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * fix: multiple gateway kick user each other. Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * fix: multiple gateway kick user each other. Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * fix: multiple gateway kick user each other. Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * fix: multiple gateway kick user each other. Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * cicd: robot automated Change Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * fix: multiple gateway kick user each other. Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * fix: add ex field to update group info. Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * cicd: robot automated Change * cicd: robot automated Change * refactor: change project module name. Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * refactor: change project module name. Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * refactor: change project module name. Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * cicd: robot automated Change * test: for pressure test. Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * test: for pressure test. Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * test: for pressure test. Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * test: message log. Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * cicd: robot automated Change * fxi: component check output valid info. Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * fxi: component check output valid info. Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * test: send message test log. Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * cicd: robot automated Change * cicd: robot automated Change * test: remove info log. Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * feat: api of send message add sendTime field. Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * fix: add callback for update user's info. * cicd: robot automated Change * fix: change callback command name. * cicd: robot automated Change * fix: single chat unread status change. * fix: single chat unread status change. * fix: single chat unread status change. * fix: user status change. * cicd: robot automated Change * fix: user status change. * fix: user status change. * fix: user status change. * cicd: robot automated Change * fix: ws close when user logout. * fix: remove repeat platform on online status. * cicd: robot automated Change * fix: api send messages for notification conversation . * fix: api send messages for notification conversation . * fix: api send messages for notification conversation . * fix: api send messages for notification conversation . * fix: api send messages for notification conversation . * fix: api send messages for notification conversation. * fix: api send messages for notification conversation. * fix: api send messages for notification conversation. * fix: api send messages for notification conversation. * fix: api send messages for notification conversation. * fix: api send messages for notification conversation. * re: remove router of unsubscribeStatus. * re: remove router of unsubscribeStatus. * re: remove router of unsubscribeStatus. * re: remove router of unsubscribeStatus. * fix: reset branch * fix: not support redis cluster. CROSSSLOT Keys in request don't hash to the same slot * fix: update user.FaceURL do not trigger GroupMemberInfoSetNotification * cicd: robot automated Change * fix: api send messages for notification conversation. * fix: api send messages for notification conversation. * fix: zk add close to avoid zk block. * fix: go mod update. * fix: msg pull change and fcm redis flag fix. --------- Signed-off-by: Gordon <1432970085@qq.com> Signed-off-by: withchao <993506633@qq.com> Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: withchao <993506633@qq.com> Co-authored-by: Xinwei Xiong <3293172751NSS@gmail.com> Co-authored-by: FGadvancer <FGadvancer@users.noreply.github.com> Co-authored-by: withchao <withchao@users.noreply.github.com> fix: sync close ws conn when kick old user avoid wrong trigger order about online status. (#1368) Update README-zh_CN.md Update README-zh_CN.md fix: GetUserReqApplicationList error when there is a disbanded group chat (#1374) fix: error when querying some information about disbanded group (#1376) * fix: GetUserReqApplicationList error when there is a disbanded group chat * fix: error when querying some information about disbanded group fix: GetUserReqApplicationList dismissed group error (#1378) * fix: GetUserReqApplicationList error when there is a disbanded group chat * fix: error when querying some information about disbanded group * fix: GetUserReqApplicationList dismissed group error refactor: lower the level of code nesting (#1370) * refactor: lower the level of code nesting Signed-off-by: rfyiamcool <rfyiamcool@163.com> * refactor: lower the level of code nesting Signed-off-by: rfyiamcool <rfyiamcool@163.com> --------- Signed-off-by: rfyiamcool <rfyiamcool@163.com> ☀️ feat: Enhancing OpenIM with Integrated E2E Testing and CI/CD Enhancements (#1359) * cicd: robot automated Change * feat: add api test Signed-off-by: Xinwei Xiong(cubxxw) <3293172751nss@gmail.com> * feat: add api test make file Signed-off-by: Xinwei Xiong(cubxxw) <3293172751nss@gmail.com> * feat: add openim e2e test Signed-off-by: Xinwei Xiong(cubxxw) <3293172751nss@gmail.com> * feat: add openim e2e test Signed-off-by: Xinwei Xiong(cubxxw) <3293172751nss@gmail.com> * fix: Fixed some unused scripts and some names Signed-off-by: Xinwei Xiong(cubxxw) <3293172751nss@gmail.com> * docs: optimize openim docs Signed-off-by: Xinwei Xiong(cubxxw) <3293172751nss@gmail.com> * feat: add prom address Signed-off-by: Xinwei Xiong(cubxxw) <3293172751nss@gmail.com> * feat: add openim info test * feat: add openim images config path Signed-off-by: Xinwei Xiong(cubxxw) <3293172751nss@gmail.com> * fix: fix tim file rename * fix: fix tim file rename * fix: fix tim file rename * fix: fix tim file rename * fix: add openim test e2e * feat: add openim test .keep Signed-off-by: Xinwei Xiong(cubxxw) <3293172751nss@gmail.com> * feat: add openim test .keep Signed-off-by: Xinwei Xiong(cubxxw) <3293172751nss@gmail.com> * feat: openim test Signed-off-by: Xinwei Xiong(cubxxw) <3293172751nss@gmail.com> * feat: openim test Signed-off-by: Xinwei Xiong(cubxxw) <3293172751nss@gmail.com> * feat: openim test Signed-off-by: Xinwei Xiong(cubxxw) <3293172751nss@gmail.com> --------- Signed-off-by: Xinwei Xiong(cubxxw) <3293172751nss@gmail.com> Co-authored-by: cubxxw <cubxxw@users.noreply.github.com> perf: auto set runtime maxprocs in docker (#1339) Signed-off-by: rfyiamcool <rfyiamcool@163.com> build: build openim image (#1381) perf: improve gzip performance with sync.pool (#1321) Signed-off-by: rfyiamcool <rfyiamcool@163.com> Co-authored-by: Gordon <46924906+FGadvancer@users.noreply.github.com> fix: add kafka compress type and producer ack params (#1310) Signed-off-by: rfyiamcool <rfyiamcool@163.com> delete not using files cicd: robot automated Change add prometheus docker-compose for monitor fix prometheus.yaml fix environment.sh fix init-config.sh fix init-config.sh fix env_template.yaml fix docker-compose.yml fix docker-compose.yml add openim_admin_front service change openim-admin-front del not using files add node-exporter-dashaboard.yaml
13 KiB
OpenIM RPC Service Test Control Script Documentation
This document serves as a comprehensive guide to understanding and utilizing the test.sh script for testing OpenIM RPC services. The test.sh script is a collection of bash functions designed to test various aspects of the OpenIM RPC services, ensuring that each part of the API is functioning as expected.
For some complex, bulky functional tests, performance tests, and various e2e tests, We are all in the current warehouse to https://github.com/OpenIMSDK/Open-IM-Server/tree/main/test or https://github.com/openim-sigs/test-infra directory In the.
- About OpenIM Feature Test Docs
Usage
The test.sh script is located within the ./scripts/install/ directory of the OpenIM service's codebase. To use the script, navigate to this directory from your terminal:
cd ./scripts/install/
chmod +x test.sh
Running the Entire Test Suite
To execute all available tests, you can either call the script directly or use the make command:
./test.sh openim::test::test
Or, if you have a Makefile that defines the test-api target:
make test-api
Alternatively, you can invoke specific test functions by passing them as arguments:
./test.sh openim::test::<function_name>
This make command should be equivalent to running ./test.sh openim::test::test, provided that the Makefile is configured accordingly.
Executing Individual Test Functions
If you wish to run a specific set of tests, you can call the relevant function by passing it as an argument to the script. Here are some examples:
Message Tests:
./test.sh openim::test::msg
Authentication Tests:
./test.sh openim::test::auth
User Tests:
./test.sh openim::test::user
Friend Tests:
./test.sh openim::test::friend
Group Tests:
./test.sh openim::test::group
Each of these commands will run the test suite associated with the specific functionality of the OpenIM service.
Detailed Function Test Examples
Testing Message Sending and Receiving:
To test message functionality, the openim::test::msg function is called. It will register a user, send a message, and clear messages to ensure that the messaging service is operational.
./test.sh openim::test::msg
Testing User Registration and Account Checks:
The openim::test::user function will create new user accounts and perform a series of checks on these accounts to verify that user registration and account queries are functioning properly.
./test.sh openim::test::user
Testing Friend Management:
By invoking openim::test::friend, the script will test adding friends, checking friendship status, managing friend requests, and handling blacklisting.
./test.sh openim::test::friend
Testing Group Operations:
The openim::test::group function tests group creation, member addition, information retrieval, and member management within groups.
./test.sh openim::test::group
Log Output
Each test function will output logs to the terminal to confirm the success or failure of the tests. These logs are crucial for identifying issues and verifying that each part of the service is tested thoroughly.
Each function logs its success upon completion, which aids in debugging and understanding the test flow. The success message is standardized across functions:
openim::log::success "<Test suite name> completed successfully."
By following the guidelines and instructions outlined in this document, you can effectively utilize the test.sh script to test and verify the OpenIM RPC services' functionality.
Function feature
| Function Name | Corresponding API/Action | Function Purpose |
|---|---|---|
openim::test::msg |
Messaging Operations | Tests all aspects of messaging, including sending, receiving, and managing messages. |
openim::test::auth |
Authentication Operations | Validates the authentication process and session management, including token handling and forced logout. |
openim::test::user |
User Account Operations | Covers testing for user account creation, retrieval, updating, and overall management. |
openim::test::friend |
Friend Relationship Operations | Ensures friend management functions correctly, including requests, listing, and blacklisting. |
openim::test::group |
Group Management Operations | Checks group-related functionalities like creation, invitation, information retrieval, and member management. |
openim::test::send_msg |
Send Message API | Simulates sending a message from one user to another or within a group. |
openim::test::revoke_msg |
Revoke Message API (TODO) | (Planned) Will test the revocation of a previously sent message. |
openim::test::user_register |
User Registration API | Registers a new user in the system to validate the registration process. |
openim::test::check_account |
Account Check API | Checks if an account exists for a given user ID. |
openim::test::user_clear_all_msg |
Clear All Messages API | Clears all messages for a given user to validate message history management. |
openim::test::get_token |
Token Retrieval API | Retrieves an authentication token to validate token management. |
openim::test::force_logout |
Force Logout API | Forces a logout for a test user to validate session control. |
openim::test::check_user_account |
User Account Existence Check API | Confirms the existence of a test user's account. |
openim::test::get_users |
Get Users API | Retrieves a list of users to validate user query functionality. |
openim::test::get_users_info |
Get User Information API | Obtains detailed information for a given user. |
openim::test::get_users_online_status |
Get User Online Status API | Checks the online status of a user to validate presence functionality. |
openim::test::update_user_info |
Update User Information API | Updates a user's information to validate account update capabilities. |
openim::test::get_subscribe_users_status |
Get Subscribed Users' Status API | Retrieves the status of users that a test user has subscribed to. |
openim::test::subscribe_users_status |
Subscribe to Users' Status API | Subscribes a test user to a set of user statuses. |
openim::test::set_global_msg_recv_opt |
Set Global Message Receiving Option API | Sets the message receiving option for a test user. |
openim::test::is_friend |
Check Friendship Status API | Verifies if two users are friends within the system. |
openim::test::add_friend |
Send Friend Request API | Sends a friend request from one user to another. |
openim::test::get_friend_list |
Get Friend List API | Retrieves the friend list of a test user. |
openim::test::get_friend_apply_list |
Get Friend Application List API | Retrieves friend applications for a test user. |
openim::test::get_self_friend_apply_list |
Get Self-Friend Application List API | Retrieves the friend applications that the user has applied for. |
openim::test::add_black |
Add User to Blacklist API | Adds a user to the test user's blacklist to validate blacklist functionality. |
openim::test::remove_black |
Remove User from Blacklist API | Removes a user from the test user's blacklist. |
openim::test::get_black_list |
Get Blacklist API | Retrieves the blacklist for a test user. |
openim::test::create_group |
Group Creation API | Creates a new group with test users to validate group creation. |
openim::test::invite_user_to_group |
Invite User to Group API | Invites a user to join a group to test invitation functionality. |
openim::test::transfer_group |
Group Ownership Transfer API | Tests the transfer of group ownership from one member to another. |
openim::test::get_groups_info |
Get Group Information API | Retrieves information for specified groups to validate group query functionality. |
openim::test::kick_group |
Kick User from Group API | Simulates kicking a user from a group to test group membership management. |
openim::test::get_group_members_info |
Get Group Members Information API | Obtains detailed information for members of a specified group. |
openim::test::get_group_member_list |
Get Group Member List API | Retrieves a list of members for a given group to ensure member listing is functional. |
openim::test::get_joined_group_list |
Get Joined Group List API | Retrieves a list of groups that a user has joined to validate user's group memberships. |
openim::test::set_group_member_info |
Set Group Member Information API | Updates the information for a group member to test the update functionality. |
openim::test::mute_group |
Mute Group API | Tests the ability to mute a group, disabling message notifications for its members. |
openim::test::cancel_mute_group |
Cancel Mute Group API | Tests the ability to cancel the mute status of a group, re-enabling message notifications. |
openim::test::dismiss_group |
Dismiss Group API | Tests the ability to dismiss and delete a group from the system. |
openim::test::cancel_mute_group_member |
Cancel Mute Group Member API | Tests the ability to cancel mute status for a specific group member. |
openim::test::join_group |
Join Group API (TODO) | (Planned) Will test the functionality for a user to join a specified group. |
openim::test::set_group_info |
Set Group Information API | Tests the ability to update the group information, such as the name or description. |
openim::test::quit_group |
Quit Group API | Tests the functionality for a user to leave a specified group. |
openim::test::get_recv_group_applicationList |
Get Received Group Application List API | Retrieves the list of group applications received by a user to validate application management. |
openim::test::group_application_response |
Group Application Response API (TODO) | (Planned) Will test the functionality to respond to a group join request. |
openim::test::get_user_req_group_applicationList |
Get User Requested Group Application List API | Retrieves the list of group applications requested by a user to validate tracking of user's applications. |
openim::test::mute_group_member |
Mute Group Member API | Tests the ability to mute a specific member within a group, disabling their ability to send messages. |
openim::test::get_group_users_req_application_list |
Get Group Users Request Application List API | Retrieves a list of user requests for group applications to validate group request management. |