Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Integrate Comprehensive E2E Testing for GoChat #1906

Merged
merged 30 commits into from
Mar 4, 2024

Conversation

cubxxw
Copy link
Contributor

@cubxxw cubxxw commented Feb 11, 2024

PR Description

This PR establishes a robust End-to-End (E2E) testing framework for the GoChat application, aimed at ensuring the reliability, functionality, and user experience of the real-time messaging feature. It integrates automated E2E tests covering critical user interactions and system behaviors, leveraging Testify for assertions and Selenium for simulating user actions in a browser environment.

Fix: #1947

Changes Included

  • E2E Testing Framework Setup: Configured Selenium WebDriver and integrated it with the Go test suite for automated browser control.
  • Test Scenarios:
    • User Registration and Login: Tests that users can successfully register and log in to the application.
    • Message Sending and Receiving: Verifies that messages are sent and received in real-time between users.
    • Connection Resilience: Assesses the application's ability to handle network interruptions and reconnect successfully.
    • Multimedia Message Support: Checks for the ability to send and receive multimedia messages, including images and videos.
  • CI/CD Integration: Incorporated the E2E test suite into the GitHub Actions workflow to automate test execution on every pull request and merge into the main branch.
  • Documentation: Added detailed documentation on how to run E2E tests locally and the structure of the test suite for future contributions.

How to Test

  1. Ensure that all application dependencies are running, including the GoChat server and the MySQL database.
  2. Navigate to the e2e directory: cd e2e
  3. Install Selenium WebDriver and browser-specific drivers (e.g., ChromeDriver for Google Chrome).
  4. Execute the E2E tests: go test -v

Dependencies

  • Selenium WebDriver for browser automation.
  • Testify for implementing assertions in tests.
  • Browser-specific drivers (e.g., ChromeDriver for Google Chrome).

Screenshots (if applicable)

  • Gif demonstrating a successful E2E test run, showcasing user registration, message exchange, and multimedia support.

Known Issues & Limitations

  • E2E tests currently only run in Google Chrome; cross-browser testing is planned for future work.
  • Multimedia message tests are limited to files under 5MB due to current application constraints.

Future Work

  • Expand E2E testing to include cross-browser compatibility checks.
  • Integrate performance testing to assess message delivery times and system scalability.

@pull-request-size pull-request-size bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Feb 11, 2024
@pull-request-size pull-request-size bot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Feb 19, 2024
@pull-request-size pull-request-size bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Feb 22, 2024
Copy link

codecov bot commented Feb 22, 2024

Codecov Report

Attention: Patch coverage is 4.31373% with 244 lines in your changes are missing coverage. Please review.

Project coverage is 4.51%. Comparing base (c754ec6) to head (da11563).
Report is 30 commits behind head on main.

Files Patch % Lines
pkg/common/cmd/rpc.go 0.00% 56 Missing ⚠️
pkg/common/config/parse.go 0.00% 32 Missing ⚠️
pkg/common/cmd/msg_gateway.go 17.24% 22 Missing and 2 partials ⚠️
pkg/common/cmd/root.go 0.00% 19 Missing ⚠️
pkg/common/cmd/api.go 0.00% 15 Missing ⚠️
internal/msggateway/compressor.go 12.50% 13 Missing and 1 partial ⚠️
internal/msggateway/client.go 0.00% 13 Missing ⚠️
internal/msggateway/message_handler.go 0.00% 11 Missing ⚠️
pkg/common/cmd/msg_transfer.go 0.00% 10 Missing ⚠️
pkg/common/db/cache/init_redis.go 0.00% 7 Missing ⚠️
... and 18 more
Additional details and impacted files
@@           Coverage Diff            @@
##            main   #1906      +/-   ##
========================================
- Coverage   5.32%   4.51%   -0.81%     
========================================
  Files         43      50       +7     
  Lines       3852    3629     -223     
========================================
- Hits         205     164      -41     
+ Misses      3634    3450     -184     
- Partials      13      15       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@cubxxw cubxxw added this pull request to the merge queue Mar 4, 2024
Merged via the queue into openimsdk:main with commit 853ac47 Mar 4, 2024
24 of 25 checks passed
@cubxxw cubxxw deleted the feat/e2e-test-login branch March 4, 2024 04:12
@openimsdk openimsdk locked and limited conversation to collaborators Mar 4, 2024
@github-actions github-actions bot added this to the v3.1 milestone Mar 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: Improve Error Handling and Code Style Consistency Across Modules
6 participants