# Full automated test suite (~2 min)
./tests/telegram/test_telegram_integration.sh
# Quick smoke test (~10 sec)
./tests/telegram/quick_test.sh
# Just compile and unit test (~30 sec)
cargo test telegram --lib- 20+ automated tests covering all fixes
- 6 test phases: Code quality, build, config, health, features, manual
- Colored output with pass/fail indicators
- Detailed summary at the end
./tests/telegram/test_telegram_integration.sh- 4 essential tests for quick feedback
- <10 second execution time
- Perfect for pre-commit checks
./tests/telegram/quick_test.sh- Generates test messages of various lengths
- Tests message splitting functionality
- 8 different message types
# Generate a long message (>4096 chars)
python3 tests/telegram/generate_test_messages.py long
# Show all message types
python3 tests/telegram/generate_test_messages.py all- Comprehensive testing documentation
- Troubleshooting guide
- Performance benchmarks
- CI/CD integration examples
cd /Users/abdzsam/zeroclaw
# Make scripts executable (already done)
chmod +x tests/telegram/test_telegram_integration.sh tests/telegram/quick_test.sh
# Run the full test suite
./tests/telegram/test_telegram_integration.shExpected output:
โกโกโกโกโกโกโกโกโกโกโกโกโกโกโกโกโกโกโกโกโกโกโกโกโกโกโกโกโกโก
โโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโ โโโโโโโโโโ โโโโโโ โโโ โโโ
...
๐งช TELEGRAM INTEGRATION TEST SUITE ๐งช
Phase 1: Code Quality Tests
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Test 1: Compiling test suite
โ PASS: Test suite compiles successfully
Test 2: Running Telegram unit tests
โ PASS: All Telegram unit tests passed (24 tests)
...
Test Summary
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Total Tests: 20
Passed: 20
Failed: 0
Warnings: 0
Pass Rate: 100%
โ ALL AUTOMATED TESTS PASSED! ๐
# Guided setup
zeroclaw onboard
# Or channels-only setup
zeroclaw onboard --channels-onlyWhen prompted:
- Select Telegram channel
- Enter your bot token from @BotFather
- Enter your Telegram user ID or username
zeroclaw channel doctorExpected output:
๐ฉบ ZeroClaw Channel Doctor
โ
Telegram healthy
Summary: 1 healthy, 0 unhealthy, 0 timed out
# Terminal 1: Start the channel
zeroclaw channel startIn Telegram:
- Find your bot
- Send:
Hello bot! - Verify: Bot responds within 3 seconds
# Generate a long message
python3 tests/telegram/generate_test_messages.py long- Copy the output
- Paste into Telegram to your bot
- Verify:
- Message is split into 2+ chunks
- First chunk ends with
(continues...) - Middle chunks have
(continued)and(continues...) - Last chunk starts with
(continued) - All chunks arrive in order
python3 tests/telegram/generate_test_messages.py word- Send to bot
- Verify: Splits at word boundaries (not mid-word)
After running all tests, verify:
- โ All 20 automated tests passed
- โ Build completed successfully
- โ Binary size <10MB
- โ Health check completes in <5s
- โ No clippy warnings
- โ Bot responds to basic messages
- โ Long messages split correctly
- โ Continuation markers appear
- โ Word boundaries respected
- โ Allowlist blocks unauthorized users
- โ No errors in logs
- โ Response time <3 seconds
- โ Memory usage <10MB
- โ No message loss
- โ Rate limiting works (100ms delays)
# Clean build
cargo clean
cargo build --release
# Update dependencies
cargo update# Check config
cat ~/.zeroclaw/config.toml | grep -A 5 telegram
# Reconfigure
zeroclaw onboard --channels-only# Test bot token directly
curl "https://api.telegram.org/bot<YOUR_TOKEN>/getMe"
# Should return: {"ok":true,"result":{...}}# Enable debug logging
RUST_LOG=debug zeroclaw channel start
# Look for:
# - "Telegram channel listening for messages..."
# - "ignoring message from unauthorized user" (if allowlist issue)
# - Any error messagesAfter all fixes, you should see:
| Metric | Target | Command |
|---|---|---|
| Unit test pass | 24/24 | cargo test telegram --lib |
| Build time | <30s | time cargo build --release |
| Binary size | ~3-4MB | ls -lh target/release/zeroclaw |
| Health check | <5s | time zeroclaw channel doctor |
| First response | <3s | Manual test in Telegram |
| Message split | <50ms | Check debug logs |
| Memory usage | <10MB | ps aux | grep zeroclaw |
Add to your workflow:
# Pre-commit hook
#!/bin/bash
./tests/telegram/quick_test.sh
# CI pipeline
./tests/telegram/test_telegram_integration.sh-
Run the tests:
./tests/telegram/test_telegram_integration.sh
-
Fix any failures using the troubleshooting guide
-
Complete manual tests using the checklist
-
Deploy to production when all tests pass
-
Monitor logs for any issues:
zeroclaw daemon # or RUST_LOG=info zeroclaw channel start
If all tests pass:
- โ Message splitting works (4096 char limit)
- โ Health check has 5s timeout
- โ Empty chat_id is handled safely
- โ All 24 unit tests pass
- โ Code is production-ready
Your Telegram integration is ready to go! ๐
- Issues: https://github.com/zeroclaw-labs/zeroclaw/issues
- Docs: testing-telegram.md
- Help:
zeroclaw --help