Skip to content

Fix CI test reliability and add tmux shell plugin tests (#1014)#1027

Open
GauravS11112003 wants to merge 4 commits into
denisidoro:masterfrom
GauravS11112003:shell-plugin-tests
Open

Fix CI test reliability and add tmux shell plugin tests (#1014)#1027
GauravS11112003 wants to merge 4 commits into
denisidoro:masterfrom
GauravS11112003:shell-plugin-tests

Conversation

@GauravS11112003

Copy link
Copy Markdown

Summary

This PR adds a dedicated tmux-driven test suite for the bash, zsh, and fish shell widgets under shell/, so plugin behaviour is exercised inside real interactive shells instead of only checking that navi widget <shell> prints something containing navi.

It also hardens CI around third-party tldr usage and non-interactive test runs (no TTY), so the main ./tests/run job stays reliable on GitHub Actions.

What’s included

  • tests/shell/run — drives each shell in tmux, sources the matching plugin, sends Ctrl+G, and asserts on sentinel output from tiny fixtures in tests/shell/cheats/.
  • tests/shell/lib.bash — tmux helpers (session start/stop, send-keys, pane capture, wait-for regex).
  • Minimal rc files under tests/shell/rc/ so plugins load in a predictable interactive session.
  • .github/workflows/shell-tests.ymlpath-filtered workflow (only when shell/**, tests/shell/**, or that workflow file changes) so unrelated PRs do not pay for zsh/fish/tmux setup.
  • Regression-style check for multi-line snippet handling (same class of bug as discussed in #1010): two-line fixtures must still produce two distinct sentinel lines after the widget runs.

CI / integration test notes

  • tldr: CI installs tealdeer and sets client.tealdeer: true for the test config; the cache is primed with tldr --update before the third-party test.
  • stty: Integration wrapper only runs stty sane when stdin is a TTY, so headless CI does not open /dev/tty and fail under set -e.
  • Shell suite: Waits for the prompt with a regex that tolerates tmux stripping trailing spaces; forces a screen-capable TERM for sessions on runners that default to TERM=dumb.

Follow-ups (out of scope here)

  • Nushell / Elvish / PowerShell plugins and different keybindings (e.g. Alt-h for elvish).
  • Multi-line prompt repaint after fzf (e.g. tide/starship) as a dedicated scenario.
  • Overlap with #1008 can be split into a later PR once this harness is merged.

Closes #1014.

Refs #1010.

Introduce tests/shell with bash/zsh/fish coverage and deterministic
fixtures; wire a shell-tests workflow gated on shell/ and tests/shell/.
Closes denisidoroGH-1014. Covers denisidoroGH-1010-style multiline snippet behavior.
Use cargo-installed tealdeer in CI and enable client.tealdeer in
tests/config; prime tldr cache. Improve fish tmux launcher quoting,
relax pane sentinel matching, extend multiline timeouts, and silence
non-tty stty noise in integration tests.
Match tmux prompt lines without requiring a trailing space; force
screen-capable TERM for plugin sessions. Prime tealdeer with tldr
--update before the integration test.
Gate stty sane on stdin being a tty to avoid /dev/tty redirects in
non-interactive CI. Expect docker in tldr best-match output without
requiring contiguous \"docker ps\" after page layout churn.
@GauravS11112003

Copy link
Copy Markdown
Author

@denisidoro just a follow-up on this PR.

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.

Create a dedicated test suite for the shell plugin to prevent regressions

1 participant