Skip to content

fix: E2E test reliability — wizard auto-cancel + CI bot isolation#14

Open
pmyagkov wants to merge 15 commits intomasterfrom
features/e2e-reliability
Open

fix: E2E test reliability — wizard auto-cancel + CI bot isolation#14
pmyagkov wants to merge 15 commits intomasterfrom
features/e2e-reliability

Conversation

@pmyagkov
Copy link
Copy Markdown
Owner

Summary

  • Auto-cancel active wizard when user sends a new command (instead of swallowing the command as wizard input, causing cascading test failures)
  • Isolate CI bot from local dev bot — separate @ci_belgrade_squash_bot on test server with its own group "CI Racket Science", preventing long-polling token collisions
  • Limit E2E concurrency to 1 run at a time via GitHub Actions concurrency group
  • Parameterize group chat ID via MAIN_CHAT_ID env var in seed and E2E fixtures

Test plan

  • CI unit/integration tests pass (auto-triggered)
  • CI E2E tests pass with the new isolated bot
  • Local E2E tests still work with .env.test (unchanged)

🤖 Generated with Claude Code

pmyagkov and others added 9 commits February 25, 2026 17:35
When a wizard is active and the user sends a different command (not /cancel),
the wizard is now cancelled and the command is processed normally. Previously,
the command text was sent to the wizard as input, causing cascading failures
in E2E tests.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Separate CI environment file to avoid bot token collision between local
development and CI runs. Also adds MAIN_CHAT_ID to .env.test for
parameterized group chat configuration.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Read group chat ID from MAIN_CHAT_ID environment variable in seed.ts
and E2E fixtures, falling back to the existing default. This allows
CI to use a different group chat than local development.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Swap .env.test with .env.ci before starting services so CI uses its own
bot credentials. Add concurrency group to ensure only one E2E job runs
at a time, preventing bot token conflicts between parallel PR runs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
CI Squash Bot (@ci_belgrade_squash_bot) on test server:
- Bot token for CI-only long polling
- Group "CI Racket Science" for announcements
- Log chat "Dev Squash Bot Logger" (shared)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Bot crashed in CI because admin hadn't /started the CI bot yet.
Wrap setMyCommands for admin scope in try-catch so it logs a warning
instead of crashing. Also parameterize admin_id via ADMIN_ID env var.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Bot responses in Docker on GitHub Actions are slower than local.
Use CI env var to apply a 3x multiplier to all E2E timeouts.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ocal dev

- E2E job runs inside mcr.microsoft.com/playwright container (no browser install)
- Bot runs directly via tsx instead of Docker Compose in CI
- Add Dockerfile.dev for local dev with pre-installed production deps
- Replace docs/DEPLOYMENT.md with comprehensive docs/CI-CD.md

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@pmyagkov pmyagkov force-pushed the features/e2e-reliability branch from 3986873 to 36457c2 Compare February 25, 2026 16:35
pmyagkov and others added 6 commits February 25, 2026 17:50
3x (6s) was not enough for Telegram test server in GHA environment.
5x gives 10s for bot responses and 50s for page loads.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Health check passed before Telegram connection was established.
Now bot.init() completes first, ensuring bot is ready when /health returns ok.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
/health now returns 200 only after bot.start() onStart fires,
ensuring the bot is actually receiving Telegram messages before
E2E tests begin.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Previous CI runs leave unconfirmed updates in Telegram. When a new bot
instance starts, it processes all stale updates (old commands from prior
runs), flooding the chat and causing E2E test timeouts.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- navigateToChat() now uses sidebar click when already on Telegram
  (reliable mid-session navigation vs unreliable hash + reload)
- finalize/unfinalize test: navigate to group chat after announcing
- cancel/restore test: navigate to group chat after announcing

Both tests were looking for announcements and inline buttons in the bot
DM, but these only exist in the group chat.

Co-Authored-By: Claude Opus 4.6 <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.

1 participant