Repository navigation
Replace the tmux integration suite with parallel mini.test child tests - #25
Merged
Merged
Conversation
The tmux suite took ~9 minutes: ~180 fixed sleeps, a fresh tmux session and nvim per scroll phase, and every scenario run serially. The unit specs took 12s. Integration tests now drive headless child Neovim instances through mini.test (pinned, fetched into deps/ by tests/deps.sh). The child reads its own grid with nvim__inspect_cell, and tests/helpers/child.lua renders plain and ANSI rows byte-identical to tmux capture-pane, so the existing visual checks (tests/helpers/verify.lua, formerly the verify.lua script) run unchanged. All 85 static and scroll captures match the tmux ones byte for byte. Fixed sleeps are replaced by a real idle signal: util/pending tracks armed timers and in-flight async processes at the plugin's timer and process sites, and child:settle() waits for it. tests/run_all.lua runs two unit shards plus one job per test file across all cores: the full suite takes ~9s (36s serial). It also fails a job when a collected mini.test case never reports, which mini.test alone does not catch. Also: - tests/run.lua exits non-zero on a failing spec instead of idling, and gains DIFFBANDIT_SPECS / DIFFBANDIT_SPECS_SKIP. Git fixture helpers shared by several specs move into 00_harness so subsets run alone. - tests/smoke/tmux.sh keeps one real-TUI check under tmux. - CI runs the parallel suite and the smoke test.
…her timers mini.test marks a case that left notes (MiniTest.skip) with an uppercase O/X, which the dropped-case guard did not count: CI, without lua-language-server, reported 2 of 4 merge cases. The pending unit check asserted the global outstanding count, which a timer armed by an earlier spec can change mid-wait; it now tracks its own tokens by label.
The test could not fail, in bash or after the port. It counted Session:render, but debounced scroll repaints go through rerender_for_viewport, which paints via session.render.render directly, so every burst recorded 0 renders. DBRapidScroll also fed every <C-e> inside one command, so DiffBandit saw one scroll event per burst. The counter now wraps session.render.render, which every paint goes through. Each <C-e> is typed separately and processed before the next, so each one is its own scroll event (80 events now give 3 paints, 1800 give 56). A new check fails the test if the scrolls arrive coalesced, which would hide the debounce again. DBRapidScroll is gone. Removing the debounce now fails the test (80 events, 80 renders).
GitHub deprecated Node 20 for actions; checkout@v4 and cache@v4 were being forced onto Node 24 with a warning. checkout v7 and cache v6 run on Node 24 natively. Their other changes (fork-PR checkout refused under pull_request_target/workflow_run, credential file location, ESM) do not affect this workflow.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The full test run drops from ~9 minutes to ~9 seconds (36s with one worker).
sleepsHow it works
tests/deps.shfetches it into the gitignoreddeps/). The child draws its full grid without a UI.tests/helpers/child.luareads each cell's text and RGB colors throughnvim__inspect_celland produces plain and ANSI rows identical totmux capture-pane [-e] -p. The existing visual checks therefore run unchanged;verify.luamoves totests/helpers/verify.luaas a module.lua/diffbandit/util/pending.luatracks armed timers and in-flight async processes. It is hooked intoui.schedule_once, the folder, queue-prefetch, merge and panel timers, andprocess.run_async/run_raw_async.child:settle()waits until nothing is outstanding. This is the only plugin-side change, and the plugin itself never reads the tracker.nvim -l tests/run_all.luaruns two unit shards and one job pertests/integration/test_*.lua, each with its own artifacts and XDG/git sandbox.DIFFBANDIT_TESTS=scroll,gitandDIFFBANDIT_JOBS=N.vim.waitcan silently lose a case.tests/smoke/tmux.shchecks one screen in a real TUI under tmux. CI runs it as its own step.Verification
run.shassertion is ported with its message.Also in this PR
The scroll-perf test can now fail. It could not before, in bash either: it counted
Session:render, which debounced scroll repaints bypass, and its scrolls reached DiffBandit as one event per burst. It now counts every paint and delivers each<C-e>as its own scroll event (1,800 events give ~56 paints). Removing the debounce makes it fail with 80 renders for 80 events, and a new check fails it if the scrolls ever arrive coalesced again.tests/run.luanow exits non-zero on a failing spec. Before, headless nvim sat idle on the startup error.tests/run.luagainsDIFFBANDIT_SPECSandDIFFBANDIT_SPECS_SKIP. The docs described a spec filter, but it didn't exist.The git fixture helpers several specs use move from
20_git_mergeinto00_harness, so any subset of specs runs on its own.README, the help file, AGENTS.md and the spec documents are updated.
tests/integration/run.shis removed.Known gaps (not addressed here)
kitty/detect.luaandkitty/tmux.luatake nopendingtoken. No integration test uses kitty.lua-language-serverisn't installed, as it did before. CI doesn't install it.