Skip to content

test: 34 unit tests for bot and store packages#48

Merged
devitway merged 1 commit intomainfrom
test/bot-store-coverage
Apr 5, 2026
Merged

test: 34 unit tests for bot and store packages#48
devitway merged 1 commit intomainfrom
test/bot-store-coverage

Conversation

@devitway
Copy link
Copy Markdown
Contributor

@devitway devitway commented Apr 5, 2026

Summary

  • Bot debounce: dedup within window, expiry, concurrent safety, hash isolation
  • Bot updates: monotonic IDs, push/poll, offset filtering, timeout, bot isolation
  • Bot relay: hub lifecycle, IsLocalURL SSRF protection (localhost, private, metadata, link-local)
  • Store: ListBots, RenameBot, BotByID, ListChannels, RenameChannel, SetChannelMessageReplyTo, CleanOldChannelMessages, UserChats, ChatUserID, ChatBotID, ActiveInvite, MessageCount, CleanExpiredFileTokens

Coverage

Package Before After
bot 20.5% 28.8%
store 73.2% 87.5%
total 34.0% 38.6%

199 to 233 tests (+34).

Test plan

  • go vet clean
  • go test ./... — 233 tests pass
  • No goleak failures (debouncer uses testDebouncer helper without goroutine)

@devitway devitway force-pushed the test/bot-store-coverage branch from 8f8510b to fcd5856 Compare April 5, 2026 16:50
Bot package 20.5% → 28.8%:
- debounce: dedup within window, expiry, concurrent safety
- updates: monotonic IDs, push/poll, offset filtering, timeout, bot isolation
- relay: hub lifecycle, IsLocalURL SSRF protection

Store package 73.2% → 87.5%:
- bots: ListBots, RenameBot, BotByID
- channels: ListChannels, RenameChannel, SetChannelMessageReplyTo, CleanOldChannelMessages
- chats: UserChats, ChatUserID, ChatBotID
- invites: ActiveInvite
- files: MessageCount, CleanExpiredFileTokens

Total: 199 → 233 tests, 34.0% → 38.6% coverage
@devitway devitway force-pushed the test/bot-store-coverage branch from fcd5856 to 173c4e4 Compare April 5, 2026 16:54
@devitway devitway merged commit 503b83a into main Apr 5, 2026
7 checks passed
@devitway devitway deleted the test/bot-store-coverage branch April 5, 2026 16:58
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.

1 participant