Skip to content

Conversation

@terraboops
Copy link
Owner

@terraboops terraboops commented Jan 23, 2026

Summary

  • Add Prometheus metrics endpoint for monitoring (/metrics on configurable port)
  • Add integration test suite with in-process XMPP client
  • Add E2E test script using go-sendxmpp for real client compatibility testing
  • Add STARTTLS support for TLS encryption
  • Add CI workflow with test and E2E jobs

Changes

Observability

  • Prometheus metrics: connection counts, message counts, auth success/failure, stanza processing times
  • Metrics served on configurable port (default 9090)

Testing

  • Integration tests (tests/integration.rs): In-process tests covering authentication, roster, presence, messaging, MUC, and MAM
  • E2E tests (scripts/e2e-test.sh): Uses go-sendxmpp to test against a running server with real TLS

STARTTLS Support

  • New tls.rs module with MaybeT stream wrapper for plain/TLS connections
  • Byte-level stream reading (real XMPP clients don't send newlines between stanzas)
  • Proper namespace injection for minidom XML parsing
  • TlsConfig in configuration for cert/key paths
  • Tested with go-sendxmpp and Android Conversations app

MUC Enhancements

  • Added get_room_messages() for MUC message archive queries (MAM)
  • Room MAM handler for retrieving group chat history

CI

  • GitHub Actions workflow with Rust build, clippy, format checks
  • Integration test job
  • E2E test job that downloads go-sendxmpp and runs against live server

Test plan

  • cargo test - 19 integration tests pass
  • cargo clippy - no warnings
  • cargo fmt --check - properly formatted
  • E2E tests pass with go-sendxmpp
  • Manual testing with Android Conversations app (login, MUC, messaging)

@terraboops terraboops changed the title Add system tests and observability infrastructure Add integration tests, observability, and STARTTLS support Jan 24, 2026
claude and others added 6 commits January 23, 2026 22:16
- Add tracing instrumentation with spans throughout server code
- Add Prometheus metrics (connections, auth, stanzas, errors, latencies)
- Add XML trace logging (CHATTERMAX_XML_TRACE env var)
- Create comprehensive system test suite with 19 integration tests:
  - Connection and stream negotiation tests
  - SASL authentication tests (PLAIN)
  - Resource binding and session establishment
  - Protocol tests (ping, disco, roster)
  - Conversations-compatible login sequence test
- Fix self-closing XML tag extraction in stream parser
- Add GitHub Actions CI workflow

https://claude.ai/code/session_01LFGkff9HGRZ2yerQcB5BoF
- Run cargo fmt to fix formatting
- Rename from_str() methods to parse() in stanza.rs to avoid clippy warning
- Use as_deref() instead of as_ref().map() in db.rs
- Iterate over map values directly in muc.rs
- Add #[allow(dead_code)] for unused test helper methods
- Use io::Error::other() instead of io::Error::new(ErrorKind::Other, ...)
- Remove unused import PathBuf

https://claude.ai/code/session_01LFGkff9HGRZ2yerQcB5BoF
- Rename tests/system.rs to tests/integration.rs to clarify purpose
- Integration tests verify protocol correctness with a minimal test client
- Add scripts/e2e-test.sh for end-to-end testing with real XMPP clients
  (go-sendxmpp or sendxmpp) to validate real-world compatibility
- Update CI workflow to reference renamed test file

The integration tests ensure protocol compliance, while e2e tests
validate that real third-party XMPP clients can connect and operate.

https://claude.ai/code/session_01LFGkff9HGRZ2yerQcB5BoF
- Update e2e-test.sh to support multiple XMPP clients:
  - go-sendxmpp (preferred)
  - sendxmpp (Perl)
  - python3-slixmpp (fallback, used in CI)
- Add embedded Python test script using slixmpp for non-TLS connections
- Add e2e job to CI that:
  - Installs python3-slixmpp via apt
  - Runs the e2e test script against a real server instance
- E2E tests validate real client compatibility, not just protocol correctness

https://claude.ai/code/session_01LFGkff9HGRZ2yerQcB5BoF
- Add TLS module with MaybeT stream wrapper for plain/TLS connections
- Rewrite stream handling to use byte-level reading instead of line-based
  (real XMPP clients don't send newlines between stanzas)
- Add add_default_namespace() to inject xmlns='jabber:client' into stanzas
  (required for proper minidom parsing)
- Track TLS state in Session for feature negotiation
- Simplify e2e tests to use go-sendxmpp with proper TLS skip flag

Tested with go-sendxmpp and Android Conversations app.
- Add TlsConfig struct to config module
- Add get_room_messages() to database for MUC message history
- Fix test harness to match updated Router::new signature
@terraboops terraboops force-pushed the claude/xmpp-tests-observability-KeStD branch from 0ae403d to b8243be Compare January 24, 2026 06:21
@terraboops terraboops merged commit ec5b118 into main Jan 24, 2026
6 checks passed
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