Skip to content

test: add integration tests for real-time collaboration WebSocket sessions - #1706

Open
mahek-builds wants to merge 8 commits into
imDarshanGK:mainfrom
mahek-builds:main
Open

test: add integration tests for real-time collaboration WebSocket sessions#1706
mahek-builds wants to merge 8 commits into
imDarshanGK:mainfrom
mahek-builds:main

Conversation

@mahek-builds

@mahek-builds mahek-builds commented Jul 28, 2026

Copy link
Copy Markdown

…sions

Description

Added integration tests for real-time collaboration WebSocket sessions to verify user presence synchronization, name parameter sanitization, and connection/session cleanup.
Specifically, added:

  • test_presence_sync_broadcasts_on_join_and_leave: Verifies that presence updates are correctly broadcasted when clients join or disconnect.
  • test_presence_sync_handles_name_sanitization: Verifies name defaults (Anonymous), handling of whitespace, and enforcing name length limit constraints (throwing 1008 code).
  • test_presence_sync_session_cleanup: Verifies that rooms are deleted and cleanly reset upon user disconnection.

Related Issue

Fixes #

Type of change

  • Bug fix
  • New feature / enhancement
  • Documentation update
  • Test addition
  • Refactor

Checklist

  • I have read CONTRIBUTING.md
  • My branch is up to date with main
  • I have run pytest -v and all tests pass
  • I have not introduced duplicate issues or features
  • My PR title follows the format: feat/fix/docs/test: short description
  • I have added tests for new features (Level 2 and 3 issues)
  • No hardcoded secrets or API keys in my code
  • This PR is linked to a GSSoC 2026 issue

Screenshots (if frontend change)

Test evidence

backend/tests/test_collaboration_ws.py::test_collaboration_ws_connection PASSED
backend/tests/test_collaboration_ws.py::test_collaboration_ws_invalid_session PASSED
backend/tests/test_collaboration_code_update_broadcasts PASSED
backend/tests/test_collaboration_multiple_clients PASSED
backend/tests/test_collaboration_invalid_json_message PASSED
backend/tests/test_collaboration_ping_returns_pong PASSED
backend/tests/test_collaboration_ws.py::test_presence_sync_broadcasts_on_join_and_leave PASSED
backend/tests/test_collaboration_ws.py::test_presence_sync_handles_name_sanitization PASSED
backend/tests/test_collaboration_ws.py::test_presence_sync_session_cleanup PASSED

======================= 9 passed, 116 warnings in 5.72s =======================

pytest -v
# paste output

@mahek-builds mahek-builds changed the title test: add integration tests for real-time collaboration WebSocket ses… test: add integration tests for real-time collaboration WebSocket sessions Jul 28, 2026

@mahek-builds mahek-builds left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pls review my pr and merge this and give me points for gssoc

@imDarshanGK imDarshanGK left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mahek-builds

Copy link
Copy Markdown
Author

@imDarshanGK I fixed the issue

@imDarshanGK imDarshanGK left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mahek-builds

mahek-builds commented Jul 30, 2026

Copy link
Copy Markdown
Author

@imDarshanGK I fixed the issue
image

@imDarshanGK imDarshanGK left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mahek-builds

Copy link
Copy Markdown
Author
image @imDarshanGK FIXED

@imDarshanGK

Copy link
Copy Markdown
Owner

@mahek-builds issue number?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants