Skip to content

Restore tests broken by post-command refactor#15

Draft
Copilot wants to merge 2 commits into
masterfrom
copilot/fix-trigger-issue
Draft

Restore tests broken by post-command refactor#15
Copilot wants to merge 2 commits into
masterfrom
copilot/fix-trigger-issue

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 16, 2026

Tests were silently disabled after PR #12 moved h5inspect_post execution inside app.run(), causing CI to pass on all subsequent master commits with zero tests running.

Why tests broke

ratatui::init() moved inside run() — panics in non-TTY CI environments (enable_raw_mode() fails without a real terminal), making TestBackend-based tests impossible.

Sync event polling replaced async handlerevents.rs was changed from a tokio-spawned EventStream task to synchronous crossterm::event::poll(). A blocking call inside async fn run() starves the tokio executor, so tokio::select! timeouts never fire and tests hang.

Changes

  • app.rs: run() now accepts Terminal<B: Backend> + a reinit_terminal: impl Fn() -> Terminal<B> callback, preserving the in-loop post-command behavior (no app state loss) without hardcoding ratatui::init()
  • events.rs: Restored the async EventHandler using EventStream in a spawned tokio task with receiver.recv().await in the event loop — compatible with tokio::select! cancellation
  • main.rs: Passes ratatui::init() terminal and reinit closure to run(); tests uncommented and updated to pass TestBackend terminal + no-op reinit
// tests now pass a TestBackend — no real TTY needed
app.run(
    terminal,
    || Terminal::new(TestBackend::new(200, 120)).unwrap(),
)
Original prompt

explain why this didn't trigger on the recent commits to master and fix it


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

…ic over backend, restore async event handler

Co-authored-by: HalFrgrd <4559349+HalFrgrd@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix issue with trigger not activating on recent commits Restore tests broken by post-command refactor Mar 16, 2026
Copilot AI requested a review from HalFrgrd March 16, 2026 14:28
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