Skip to content

Migrate integration tests away from Python#529

Open
vitalyster wants to merge 4 commits into
masterfrom
slixmpp
Open

Migrate integration tests away from Python#529
vitalyster wants to merge 4 commits into
masterfrom
slixmpp

Conversation

@vitalyster
Copy link
Copy Markdown
Collaborator

No description provided.

@vitalyster vitalyster force-pushed the slixmpp branch 22 times, most recently from 43e6bf9 to 34023a8 Compare March 31, 2026 08:48
@vitalyster vitalyster changed the title sleekxmpp -> slixmpp Migrate integration tests away from Python Jun 2, 2026
@vitalyster vitalyster force-pushed the slixmpp branch 6 times, most recently from f0f515f to 15efaed Compare June 3, 2026 06:13
Replace Python XMPP tests (sleekxmpp/slixmpp) with C++ AdminInterface
protobuf-based integration tests. Use raw TCP IRC client to connect
directly to ngircd for message receive verification.

Test changes:
- Add C++ integration test framework (test_chat.cpp) using AdminInterface
  protobuf commands (connect_user, join_room, send_room_message, etc.)
- Add IRC client (IrcClient) for message receive verification on ngircd
- Add tests: muc_join_leave, muc_echo, muc_pm, muc_away, muc_topic
- Delete all Python integration test files (~1360 lines)
- Add run.sh to start spectrum2, wait for backend, run integration test
- Extend CMake build for integration test target

Backend fix:
- Fix stale IRC session blocking reconnect in handleLoginRequest
  (disconnected sessions were never cleaned from m_sessions map)
- Add MyIrcSession::isConnected() accessor

AdminInterface:
- Add chat commands: ConnectUser, DisconnectUser, JoinRoom, LeaveRoom,
  SendMessage, SendRoomMessage

Slack:
- Disable Slack frontend from main binary (ODR collision with JoinRoomCommand)
- Rename Slack join_room/leave_room to join_slack_room/leave_slack_room
- Restore Slack unit tests with unique command names

Config:
- Remove data_path from prosody.cfg.lua
- Write backend logs to backend.log file

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@aibot505
Copy link
Copy Markdown

aibot505 commented Jun 3, 2026

Summary

Replace Python XMPP integration tests with C++ protobuf-based tests using raw TCP IRC client for receive verification.

Changes

New integration tests (tests/integration/)

  • test_chat.cpp — AdminInterface protobuf tests: muc_join_leave, muc_echo, muc_pm, muc_away, muc_topic
  • run.sh — starts spectrum2, waits for backend, runs test binary
  • CMakeLists.txt — integration test build target
  • IrcClient uses raw TCP sockets to ngircd:6667, joins #channel, parses PRIVMSG

Deleted Python tests

Remove all 19 Python test files (~1360 lines): start.py, libcommuni/*.py, libpurple_jabber/*.py, slack_jabber/*.py

AdminInterface (libtransport/AdminInterface.cpp)

Add chat commands: connect_user, disconnect_user, join_room, leave_room, send_message, send_room_message

Backend (backends/libcommuni/)

  • Fix stale disconnected IRC session blocking reconnect in handleLoginRequest
  • Add MyIrcSession::isConnected()

Slack frontend

  • Disable from main binary to resolve ODR collision with AdminInterface JoinRoomCommand
  • Rename join_room/leave_room to join_slack_room/leave_slack_room to avoid name conflict
  • Keep Slack unit tests enabled with updated command names

CI (.github/workflows/main.yml)

  • Add ngircd service container on port 6667
  • Run tests with --network host

Config

  • Backend logs to backend.log instead of syslog
  • Remove data_path from prosody.cfg.lua

Known issue

Backend IRC connection not yet established via AdminInterface connect_user — message delivery through transport path pending.

vitalyster and others added 3 commits June 3, 2026 11:41
In spectrum2 server mode, MUC rooms must use transport encoding:
#channel%localhost@localhost instead of #channel@localhost.
This lets the backend correctly map to IRC channel #channel.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.

2 participants